ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.29.0 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
<FromGitter> <watzon> jokke I'm pretty sure you link in the same way you would if you were trying to use it in a C program
<FromGitter> <watzon> Other than that idk, you're in unexplored territory for me
<FromGitter> <watzon> Which is rare. Congrats.
<FromGitter> <watzon> Lol
<FromGitter> <watzon> How could I go about type restricting a class instead of an instance? For instance I want instance variable `@foo` to be of type `Bar.class`, not `Bar` but I can't do `@foo : Bar.class`
<FromGitter> <Blacksmoke16> sure you can
<FromGitter> <watzon> How? I just tried and it doesn't work
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/77go
<FromGitter> <Blacksmoke16> must be doing something wrong?
<FromGitter> <watzon> Weird, I must have
<FromGitter> <Blacksmoke16> indeed
<FromGitter> <watzon> Ahh this is the issue ⏎ ⏎ ```client : HTTPClient.class? = nil``` [https://gitter.im/crystal-lang/crystal?at=5d267faef867ec1687e7e5a2]
<FromGitter> <watzon> Can't have a question mark
<FromGitter> <Blacksmoke16> has to be `HTTPClient?.class`
<FromGitter> <watzon> Oh interesting
<FromGitter> <Blacksmoke16> which is basically `Union(HTTPClient | Nil)`
<FromGitter> <watzon> Yup that works
<FromGitter> <watzon> Thanks haha
<FromGitter> <Blacksmoke16> np
<FromGitter> <watzon> I was scratching my head because I was sure I'd done it before
<FromGitter> <Blacksmoke16> :P
<jokke> hm interesting
<jokke> i get it to build
<jokke> (and link)
<jokke> but then: ./test: error while loading shared libraries: libxclib.so: cannot open shared object file: No such file or directory
<jokke> in ldd i also see: libxclib.so => not found
<jokke> here's how i tried to do it: https://p.jokke.space/PhLH/
<FromGitter> <watzon> Ready for another WatzonProjectβ„’? Lol
<FromGitter> <dscottboggs_gitlab> woah @jokke what is that pastebin you have?
<FromGitter> <watzon> Reviving this old project
<jokke> that's filebin
<FromGitter> <watzon> https://p.jokke.space/PhLH/cr a little better
<jokke> yeah :)
<jokke> autodetection doesn't always work
<jokke> and when it works crystal is always detected as ruby :P
<jokke> dscottboggs_gitlab: it's quite versatile. and has a great command line client. :)
<FromGitter> <watzon> Yeah that's one of the downsides to having such a similar syntax
<jokke> basically, i _think_ i'd have to statically link that one library
<FromGitter> <dscottboggs_gitlab> jokke sweet thank you I've been looking for a solution like that
<jokke> the one i'm building
<jokke> because it's not in the usual search path i assume
<FromGitter> <dscottboggs_gitlab> TBF crystal is a pretty obscure language
<jokke> rust outputs also a .a file but if i try to link that i get a ton of undefined reference errors
<FromGitter> <dscottboggs_gitlab> Like I really like it but it's not as popular as I'd like
<jokke> make it more popular then ;)
<FromGitter> <dscottboggs_gitlab> jokke, interesting. I wonder why that is.
<FromGitter> <dscottboggs_gitlab> well, I'd have to be popular first, or make something popular :p
<FromGitter> <dscottboggs_gitlab> I wish LLVM had some sort of standardized ABI to allow interop between LLVM languages. That would really make all of these obscure but very nice LLVM languages like Rust, Crystal, V, etc, be a lot more useful and verstile -- one language could take advanatage of another's libraries
<jokke> that's exactly what i'm trying to do :P
<FromGitter> <dscottboggs_gitlab> *please* fucking do πŸ˜€
<jokke> i wrote this one lib in rust and want to use it in crystal
<jokke> but it doesn't seem to be trivial :D
<FromGitter> <dscottboggs_gitlab> but like I feel like LLVM would need to make that a core feature of the compiler
<jokke> or i'm just stupid
<FromGitter> <dscottboggs_gitlab> no you're not it's *incredibly* difficult
<jokke> llvm is veeeery low level though
<FromGitter> <dscottboggs_gitlab> that's the level at which you'd need to have interop
<jokke> why?
<FromGitter> <dscottboggs_gitlab> because at any higher level the languages would be very different
<jokke> well all of them support exposing unmangled functions
<FromGitter> <dscottboggs_gitlab> like a function is a function, an int is an int, but a C++ class is not a Crystal class is not a Ruby class etc
<jokke> sure
<jokke> but that's already at c level
<jokke> or how to say
<FromGitter> <dscottboggs_gitlab> like you can export a crystal `fun` or `struct` which is marked `@[Extern]` but not a `class` or `def` which is what most libraries would use
<jokke> this is basically all it took: https://p.jokke.space/m-n67/
<jokke> yes
<jokke> that's true
<jokke> and _that_s inredibly difficult
<FromGitter> <dscottboggs_gitlab> Oh crap did your example you just posted work??
<jokke> it worked when i tried it with c
<jokke> last_error probably won't work
<FromGitter> <dscottboggs_gitlab> BTW I have to say your rust is very nice and readable compared to most examples I've seen
<jokke> LOL
<FromGitter> <dscottboggs_gitlab> > it worked when i tried it with c ⏎ ⏎ but not Crystal?
<jokke> this is like the first time i've written rust
<FromGitter> <dscottboggs_gitlab> Oh that's probably why
<jokke> ok i did some adventofcode a while back
<FromGitter> <dscottboggs_gitlab> Not doing something very complicated tends to lead to not using advanced (ugly) language features
<jokke> yeah i guess
<jokke> i don't like the error handling in rust at all
<FromGitter> <dscottboggs_gitlab> no?
<jokke> it's way better than in go of course
<jokke> but i much prefer exceptions
<FromGitter> <dscottboggs_gitlab> I mean *of course* haha
<jokke> but that's probably just because i'm used to it
<FromGitter> <dscottboggs_gitlab> exceptions are expensive
<jokke> yeah
<FromGitter> <tenebrousedge> I tend to think of that being pretty irrelevant
<jokke> but i don't really care
<jokke> i prefer my code to be readable
<jokke> exceptions let me keep the code flat
<FromGitter> <dscottboggs_gitlab> Idk I mean there's a balance to be had
<jokke> lol i'm going great lengths just to avoid shelling out to xclip :D
<FromGitter> <dscottboggs_gitlab> If you totally don't care about efficiency but care about your code being readable, modern Python with type hints would be the obvious language of choice in my mind, unless your working with web server stuff specifically then I'd go with Crystal.
<jokke> and now it's 3:15am
<jokke> ugh i hate python
<FromGitter> <dscottboggs_gitlab> Pyhon + web = 😬
<FromGitter> <tenebrousedge> apparently there's type checking for Ruby too
<jokke> it's such a broken language
<jokke> i prefer crystal over ruby in almost any case
<FromGitter> <dscottboggs_gitlab> > and now it's 3:15am ⏎ ⏎ oof get some rest bro
<jokke> yeah. gotta go to work tomorrow :D
<FromGitter> <dscottboggs_gitlab> which is a broken language, python or ruby?
<jokke> python
<FromGitter> <dscottboggs_gitlab> why's that?
<jokke> imo
<FromGitter> <dscottboggs_gitlab> I mean like Python3.6+
<jokke> i mean it's getting better since list comprehensions but i think it's a very limited function which doesn't really inspire you to write good code
<jokke> s/function/language/
<jokke> as opposed to ruby
<jokke> if you want to talk about interpreted languages
<jokke> ruby is a very beautifully crafted consistent language
<FromGitter> <dscottboggs_gitlab> I don't think it's very consistent
<jokke> pythons version of OO is a joke in comparison
<FromGitter> <dscottboggs_gitlab> Ruby is a little to flexible for my taste
<jokke> you mean because of aliases?
<jokke> yeah
<jokke> ok
<FromGitter> <dscottboggs_gitlab> not just aliases but like type inference and stuff too
<jokke> type inference in ruby?
<jokke> with consistency i meant the OO model of ruby
<jokke> no null pointers, no weird things that aren't objects.
<FromGitter> <tenebrousedge> everything is a message sent to an object
<jokke> yeah
<FromGitter> <tenebrousedge> and almost anything can be redefined at runtime
<FromGitter> <dscottboggs_gitlab> > and almost anything can be redefined at runtime ⏎ ⏎ doesn'
<jokke> not necessarily
<FromGitter> <tenebrousedge> there are safe ways to redefine things
<jokke> but i'm not a huge fan of crazy metaprogramming magic
<jokke> sometimes it just gets too much with ruby, although i think it's commonly viewed as a last resort instead of the norm
<jokke> kinda like crystal macros
<FromGitter> <dscottboggs_gitlab> I can't run `shards install` on my project
<FromGitter> <dscottboggs_gitlab> if I run `shards install -v` it freezes on the last dev depdency install at this point... ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d2690460c8c4114d90b018c]
<FromGitter> <dscottboggs_gitlab> there's no error -- it jus stops there
<FromGitter> <Blacksmoke16> rip
<jokke> ameba takes some time
<jokke> sure it stops forever?
<FromGitter> <Blacksmoke16> normally it says its making bin tho
<jokke> yeah true
<FromGitter> <dscottboggs_gitlab> i left it sit while I went out to the store yesterday or the day before
<jokke> heh ok it shouldn't take that long
<jokke> maybe 10 secs
<jokke> Blacksmoke16 any ideas bout that linking issue?
<FromGitter> <dscottboggs_gitlab> yeah it usually stops on the postinstall make step for a while, this is after the last thing is fetched
<FromGitter> <Blacksmoke16> naw man, i know like nothing about c
<FromGitter> <dscottboggs_gitlab> I've uninstalled and reinstalled `crystal`, and `shards`, as well as removed the data in `~/.cache/shards`
<jokke> i should maybe ask jhass. I think he made some lib with locally built shared objects..
<jokke> but it's 3:30am for him, too. so maybe i should just call it a day :D
<jokke> night guys. Thanks for the help!
<FromGitter> <Blacksmoke16> o/
<FromGitter> <tenebrousedge> this whole "round Earth" thing was just a bad idea. No one likes time zones >_<
<FromGitter> <Blacksmoke16> what are you talking about? the earth is flat
<FromGitter> <dscottboggs_gitlab> well...it may not be 03:30 here but I'm going to bed anyway. I hope I can figure out this shards issue so I can code on my primary system again soon
<FromGitter> <dscottboggs_gitlab> good night ✌️
<FromGitter> <Blacksmoke16> o/
<FromGitter> <dscottboggs_gitlab> OH WAIT
<FromGitter> <dscottboggs_gitlab> I left it sit for a while and now I've got... ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d2692f7bea9f3574131871c]
<FromGitter> <dscottboggs_gitlab> πŸ˜†
<FromGitter> <Blacksmoke16> something like that prob
<FromGitter> <dscottboggs_gitlab> oh great
<FromGitter> <dscottboggs_gitlab> You wanna know something fun?
<FromGitter> <Blacksmoke16> hm?
<FromGitter> <dscottboggs_gitlab> This issue is only happening on one of my computers
<FromGitter> <tenebrousedge> it must be possessed
<FromGitter> <Blacksmoke16> https://downloadmoreram.com/
<FromGitter> <dscottboggs_gitlab> The computer it's happening on has 24GB of RAM and 2 Xeons
<FromGitter> <Blacksmoke16> :squinty_eyes:
<FromGitter> <dscottboggs_gitlab> The computer that's working fine has a Core 2 Duo and 4GB of RAM
<FromGitter> <Blacksmoke16> what shards version you on
<FromGitter> <Blacksmoke16> could maybe downgrade back to 0.8.x
<FromGitter> <dscottboggs_gitlab> `0.9.0`, both systems are Manjaro
<FromGitter> <dscottboggs_gitlab> yeah I was thinking that
<FromGitter> <tenebrousedge> bug report says that limiting the potential versions helps
<FromGitter> <watzon> Eww manjaro
<FromGitter> <watzon> Haha
<FromGitter> <dscottboggs_gitlab> what's wrong with manjaro?
<FromGitter> <tenebrousedge> I love the Arch wiki but I think Arch and derivatives are for people with lots more time than I have
<FromGitter> <watzon> From a telegram group that I'm in: ⏎ ⏎ Manjaro - rolling back your system clock since 2015. ⏎ ⏎ https://manjaro.github.io/expired_SSL_certificate/ (deleted out of shame in late 2018, use wayback) ... [https://gitter.im/crystal-lang/crystal?at=5d269486acab0914d8e72de5]
<FromGitter> <watzon> I loved Antergos, but the project is dead now
<rkeene> What thing should I do while I'm in Seattle ?
<FromGitter> <tenebrousedge> the Pike Place Market is fun
<FromGitter> <tenebrousedge> they will throw fish at you o_o
<rkeene> What if I don't want things thrown at me ?
<FromGitter> <dscottboggs_gitlab> > Delays package updates for 'testing' and yet still completely breaks with a regular update ⏎ ⏎ Ooof
<FromGitter> <tenebrousedge> there is a lovely tea shoppe there too
<rkeene> I just got finished with an over 4 hour interview process
<rkeene> So, things that don't require thinking, or talking
<FromGitter> <watzon> I tried Manjaro for several months a couple years ago. Had nothing but issues. Antergos was nice because it was pure arch, just with packages installed.
<FromGitter> <dscottboggs_gitlab> TBH I've been wishing I had the horsepower for silverfish or something immutable. I had an idea awhile back to install AUR packages into docker containers but never got it working with GUI
<rkeene> dscottboggs, What you need is AppFS :-D
<FromGitter> <dscottboggs_gitlab> I haven't had any issues with Manjaro in a long time. I had an issue or two with dependency hell from too many AUR packages, but since then I've been running it on my laptop for a while and just installed it on my main server/desktop about 2 months ago
<FromGitter> <dscottboggs_gitlab> rkeene, thank you I'll take a look at that
<rkeene> Hee hee hee
<FromGitter> <dscottboggs_gitlab> rkeene, I could swear I've heard of that before, I had no idea you wrote it. Is it really just one C and one TCL file + deps?
<FromGitter> <girng> can you get the same performance out of python as ruby tho?
<FromGitter> <girng> as crystal*
<FromGitter> <dscottboggs_gitlab> @girng, no I specifically said if you don't care about performance
<FromGitter> <girng> oh ic, yeah
<FromGitter> <dscottboggs_gitlab> if you do then the decision becomes a lot tougher
<FromGitter> <dscottboggs_gitlab> Or if you're making a web server
<rkeene> dscottboggs, I mentioned it to you before, yeah, it's real small -- packages are just files on disk, this handles getting them to a point where you can use them
<FromGitter> <dscottboggs_gitlab> just tried removing ameba from the shards.yml, didn't help. i'm gonna try building a fresh shards from source and see what happens
<FromGitter> <dscottboggs_gitlab> shards built from source *also* does the same thing...perhaps there will be a more helpful error since it is built from source rather than static
<FromGitter> <dscottboggs_gitlab> a freshly compiled shards v0.8.1 does not seem to experience this issue
Raimondi has quit [Ping timeout: 258 seconds]
duane has joined #crystal-lang
laaron- has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
DTZUZO has joined #crystal-lang
<FromGitter> <Blacksmoke16> Yea probably an issue with the new solver the new version implemented
_whitelogger has joined #crystal-lang
duane has quit [Ping timeout: 258 seconds]
ht_ has joined #crystal-lang
ht_ has quit [Quit: ht_]
laaron- has quit [Remote host closed the connection]
laaron has joined #crystal-lang
rohitpaulk has joined #crystal-lang
Raimondi has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 248 seconds]
Raimondii is now known as Raimondi
rohitpaulk has quit [Remote host closed the connection]
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 245 seconds]
Raimondii has quit [Ping timeout: 258 seconds]
absolutejam has joined #crystal-lang
Raimondi has joined #crystal-lang
absolutejam has quit [Ping timeout: 244 seconds]
<FromGitter> <j8r> Absolutely
absolutejam has joined #crystal-lang
<FromGitter> <girng> Hi Julien!!!
<FromGitter> <girng> How are you bro?? I've missed you. Where have you been?
<FromGitter> <j8r> @girng thanks, me? I'm there quite regularly, from time to time
<FromGitter> <girng> Nice, glad to see you
<FromGitter> <j8r> @tenebrousedge not manjaro, as easy as, fedora
<FromGitter> <j8r> @dscottboggs_gitlab what DE have you?
DTZUZO has quit [Ping timeout: 258 seconds]
<jokke> watzon: oh Antergos sounds nice
<jokke> i've been an arch user for more than 7 years now..
<jokke> but it's not a distro i would recommend for everyone :D
<jokke> but i like my edges bleeding and jagged :D
<jokke> also i like to tinker
<jokke> as you might've noticed yesterday when i tried to get a rust lib to link with a crystal program until 3 am :D
<jokke> it's a distro for these kinds of people :D
DTZUZU has quit [Ping timeout: 246 seconds]
DTZUZU has joined #crystal-lang
<jokke> aaanyhow, anyone here now who knows how to link locally compiled .so files into a crystal program?
sorcus has joined #crystal-lang
<FromGitter> <j8r> why?
<FromGitter> <j8r> `crystal build --static` doesn't fit the purpose?
moei has joined #crystal-lang
DTZUZU has quit [Ping timeout: 245 seconds]
DTZUZU has joined #crystal-lang
<FromGitter> <girng> i think he was ahving an issue with that on his o
<FromGitter> <girng> his OS
blassin27826 has joined #crystal-lang
absolutejam1 has joined #crystal-lang
blassin2782 has quit [Ping timeout: 246 seconds]
DTZUZU has quit [Ping timeout: 246 seconds]
DTZUZU has joined #crystal-lang
<FromGitter> <dscottboggs_gitlab> @j8r I'm on i3 on my server/desktop, Plasma on my laptop
DTZUZO has joined #crystal-lang
ddffg has joined #crystal-lang
ddffg has quit [Ping timeout: 248 seconds]
ddffg has joined #crystal-lang
ddffg has quit [Ping timeout: 246 seconds]
lucasb has joined #crystal-lang
duane has joined #crystal-lang
alex`` has joined #crystal-lang
woodruffw has quit [Ping timeout: 258 seconds]
woodruffw has joined #crystal-lang
Yxhuvud has quit [Read error: Connection reset by peer]
ht_ has joined #crystal-lang
Yxhuvud has joined #crystal-lang
absolutejam has quit [Ping timeout: 245 seconds]
duane has quit [Ping timeout: 245 seconds]
absolutejam has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<jokke> dscottboggs_gitlab: yeah?
<jokke> have i missed something?
<FromGitter> <dscottboggs_gitlab> You were asking about linking to crystal?
<jokke> yeah but that's basic
<jokke> the problem is building an extension in something other than crystal and linking that extension
<FromGitter> <dscottboggs_gitlab> You should be able to define `fun`s, and link to it, I think? As long as it's compatible with the C ABI...
<FromGitter> <dscottboggs_gitlab> like when building C bindings you use the headers to write `fun foo(args : T) : U` for each `U foo(T args);` C function in the headers, then link to the corresponding object file
<FromGitter> <dscottboggs_gitlab> Wouldn't it work the same for other languages, if they're able to create exportable equivalents of C functions/Crystal `fun`s?
<jokke> yes :) sure, that's what i'm doing
rohitpaulk has quit [Remote host closed the connection]
<FromGitter> <dscottboggs_gitlab> > @[Link(ldflags: "...")] will pass those flags directly to the linker, without modification. For example: @[Link(ldflags: "-lpcre")] ⏎ ⏎ so you need to figure out how to link your `.so` file to a C library, and what option you need to pass to `clang`/`gcc`, then put that option in a `@[Link]` annotation. ⏎ ⏎ .... I think [https://gitter.im/crystal-lang/crystal?at=5d2783e13b41924785a0987a]
rohitpaulk has joined #crystal-lang
alex`` has quit [Ping timeout: 245 seconds]
alex`` has joined #crystal-lang
<jokke> yeah i know :) that's also what i'm doing :P And it's compiling and linking but in the end if i run ldd on the binary i get a not found for the .so file
<FromGitter> <dscottboggs_gitlab> huh. that's weird
duane has joined #crystal-lang
JuanMiguel has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 246 seconds]
JuanMiguel has quit [Quit: Saliendo]
<FromGitter> <artmadeit> hi is there a way to extends the Integer types to support factorial with this syntax:`5.!`
<FromGitter> <Blacksmoke16> like a method called `!`?
<FromGitter> <artmadeit> yeah, but in the docs says..`Note: ! (not) cannot be defined as a method (its meaning can't be changed).` in the operators section
<FromGitter> <dscottboggs_gitlab> https://carc.in/#/r/77kb
<FromGitter> <dscottboggs_gitlab> interesting
<FromGitter> <Blacksmoke16> then id vote no
<FromGitter> <dscottboggs_gitlab> you could do _! but yeah it doesn't look like that's possible
<FromGitter> <artmadeit> I've tried with `def _!` but this error happens `Syntax error in eval:2: expecting any of these tokens: IDENT, CONST, `, <<, <, <=, ==, ===, !=, =~, !~, >>, >, >=, +, -, *, /, //, !, ~, %, &, |, ^, **, [], []?, []=, <=>, &+, &-, &*, &** (not 'UNDERSCORE')`
<FromGitter> <Blacksmoke16> imo just do `def factorial` or whatever
<FromGitter> <Blacksmoke16> is more clear
<FromGitter> <dscottboggs_gitlab> I agree but I also think `_!` not being recognized is a bug
<FromGitter> <artmadeit> https://carc.in/#/r/77kd ...
<FromGitter> <artmadeit> I'm thinking of leaving it like that, using just factorial, if there's a way (don't if it'll work using macros)
<FromGitter> <artmadeit> *don't know if it'll work using macros
<FromGitter> <Blacksmoke16> it wont
<FromGitter> <Blacksmoke16> you cant have a method starting with `_`
<FromGitter> <Blacksmoke16> but again, id just do `5. factorial `
<FromGitter> <Blacksmoke16> but :shrug:
<FromGitter> <artmadeit> thanks for your replies πŸ˜ƒ
ht_ has quit [Remote host closed the connection]
<FromGitter> <dscottboggs_gitlab> > you cant have a method starting with `_` ⏎ ⏎ Oh
<FromGitter> <Blacksmoke16> i lied
<FromGitter> <Blacksmoke16> but might be a bug? book says `Method names begin with a lowercase letter `
<FromGitter> <bew> you can use a unicode exclamation mark like `❗`: https://carc.in/#/r/77kv But good luck with telling people to copy/paste the symbol everytime they want to use it :D
<FromGitter> <Blacksmoke16> rofl
<FromGitter> <Blacksmoke16> thats great
<FromGitter> <Blacksmoke16> go make a PR :P
<FromGitter> <bew> ahah I would never merge something like that, even in my dreams
<FromGitter> <bew> about `_!`, could be a bug, as a method named `_bla` works well, but I wouldn't say making `_!` work is super duper high priority^^
<FromGitter> <Blacksmoke16> id even be for making `_bla` throw an error
<FromGitter> <bew> not necessarily, could be useful semantic-wise to show a clear distinction between some public-public method and some public-but-internal (for example) methods
<FromGitter> <dscottboggs_gitlab> > I wouldn't say making _! work is super duper high priority^^ ⏎ ⏎ I didn't think so πŸ˜†
<FromGitter> <Blacksmoke16> `public-but-internal ` like what?
<FromGitter> <Blacksmoke16> that you could use protected or private for
<FromGitter> <dscottboggs_gitlab> idk I'm more for like, don't break things unless you have to. If the syntax doesn't break things let people do it
<FromGitter> <bew> no example in mind @Blacksmoke16, I just feel like there could be a usecase like that
<FromGitter> <Blacksmoke16> i suppose
<FromGitter> <bew> gotta go, some document to write before sleeping (argh..) see ya!
<FromGitter> <dscottboggs_gitlab> I don't get why `!` can't be defined though... I wouldn't think `def !` would be for the prefix use, I'd think it'd be for like that guy wanted to do, `something.!`. It's obviously already compiler magic. why not have the compiler define a regular function instead of just saying "no"
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d27a34454d3383937edc70e]
<FromGitter> <Blacksmoke16> stblib defines these
<FromGitter> <dscottboggs_gitlab> @bew good luck
<FromGitter> <asterite> @dscottboggs_gitlab `!` can't be overwritten because it affects type flow: `if !a` means that in the `else` branch `a` is truthy. If you could redefine that it wouldn't be possible to know this is always true
<FromGitter> <dscottboggs_gitlab> I just meant that it seems weird to me that `def !` defines the prefix ! syntax instead of a regular method named `!`
<FromGitter> <dscottboggs_gitlab> not that I think you should be able to change the meaning of `!a`, that would be terrible lol
<FromGitter> <dscottboggs_gitlab> or is `!a` the same as `a.!`?
<FromGitter> <dscottboggs_gitlab> nope `!` just doesn't work. I mean, whatever, there's bigger things to worry about haha
absolutejam has quit [Ping timeout: 248 seconds]
absolutejam has joined #crystal-lang
absolutejam1 has quit [Ping timeout: 246 seconds]
absolutejam1 has joined #crystal-lang
DTZUZO has quit [Ping timeout: 248 seconds]
absolutejam has quit [Ping timeout: 258 seconds]
alex`` has quit [Ping timeout: 245 seconds]
<FromGitter> <bew> > I just meant that it seems weird to me that `def !` defines the prefix ! syntax instead of a regular method named `!` ⏎ @dscottboggs_gitlab i like that :)
<FromGitter> <dscottboggs_gitlab> :)
<FromGitter> <bew> but then how to (syntax-wise) define prefix operators like `-` or `~`, maybe a special syntax?
<FromGitter> <dscottboggs_gitlab> what about `def -self`?
<FromGitter> <dscottboggs_gitlab> is there no way to differentiate between the prefix and infix `-` syntaxes?
<FromGitter> <bew> what's the difference?
<FromGitter> <dscottboggs_gitlab> ` - 5` is "negative 5" but `0 - 5` is "zero minus 5"
<FromGitter> <bew> oh that, for the method definition, the difference is done without or with an argument
<FromGitter> <dscottboggs_gitlab> Oh I see
<FromGitter> <dscottboggs_gitlab> then I don't see any conflicts. You can't do `something.-` because `-` isn't a valid identifier outside of the special operator methods. But doing `something.!` makes sense because methods can already end in in `!`... same for `?`
<FromGitter> <watzon> Why does `FileUtils` exist? Shouldn't most, if not all, of that functionality be in either `Dir` or `File`?
<FromGitter> <dscottboggs_gitlab> probs because FileUtils (http://ruby-doc.org/stdlib-2.6.3/libdoc/fileutils/rdoc/FileUtils.html) exists
<FromGitter> <dscottboggs_gitlab> I've used it before in small scripts
moei has quit [Quit: Leaving...]
<FromGitter> <dscottboggs_gitlab> Kinda like the global ``` method -- it's not *that* useful to most projects, but someone's using it, and what harm does it do, so why take it out?
<FromGitter> <watzon> I mean, there's no reason it couldn't stay, but there are a lot of duplicate methods
<FromGitter> <dscottboggs_gitlab> hm, that's fair
<FromGitter> <watzon> With the RFC for shrinking the standard library I'd be surprised if they don't want to do something about that
<FromGitter> <dscottboggs_gitlab> yeah tbh it definitely seems like it could be moved to a crystal-community shard
<FromGitter> <Blacksmoke16> Pretty sure there is an issue about it
<FromGitter> <dscottboggs_gitlab> maybe it could get some more features then, and be a more useful
<FromGitter> <dscottboggs_gitlab> haha nice
<FromGitter> <dscottboggs_gitlab> @bew https://github.com/crystal-lang/crystal/issues/7959
<FromGitter> <bew> πŸ‘
<FromGitter> <watzon> Honestly if another option were provided I'd never use `!` as a method. Given the methods `Int#!` and `Int#factorial` I'd choose the second every time.
<FromGitter> <watzon> Just personal preference
<FromGitter> <watzon> Oh btw, I got a job where I get to use Crystal!
<FromGitter> <Blacksmoke16> oh/
<FromGitter> <watzon> Yup, I am now working for NeuraLegion 😁
<FromGitter> <watzon> And the best part is they're using some of my personal projects, such as Cadmium. So I'm getting paid to work on my FOSS projects
<FromGitter> <watzon> Fucking dream come true
<FromGitter> <Blacksmoke16> nice one!
<FromGitter> <watzon> Super excited. Right now I'm working on watzon/marionette which will be a port of Puppeteer for Crystal
lucasb has quit [Quit: Connection closed for inactivity]
<FromGitter> <bew> @watzon it's amazing!!! Have fun! Marionette (nice name) looks very nice too ;)
<FromGitter> <watzon> Thanks! It's going to be a lot of work to get it working correctly. But then I think I'm going to make Arachnid use it exclusively. It'll make for such a powerful crawler.