ChanServ changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Fund Crystal's development: https://crystal-lang.org/sponsors | GH: https://github.com/crystal-lang/crystal | Docs: https://crystal-lang.org/docs | Gitter: https://gitter.im/crystal-lang/crystal
notzmv has quit [Ping timeout: 272 seconds]
<FromGitter> <Blacksmoke16> heh
ur5us has quit [Ping timeout: 255 seconds]
<FromGitter> <Blacksmoke16> ofc PHP has this method built in https://www.php.net/manual/en/function.getimagesize.php
ua__ has quit [Remote host closed the connection]
notzmv has joined #crystal-lang
ur5us has joined #crystal-lang
<FromGitter> <Blacksmoke16> should `Char` define a `to_u8!` method that delegates to `#ord` so that you can do like `Bytes['G', 'I', 'F']`?
<FromGitter> <Blacksmoke16> well `ord.to_u8`
<FromGitter> <Blacksmoke16> guess it wouldnt work for all chars so prob not worth it
ua_ has joined #crystal-lang
ur5us has quit [Remote host closed the connection]
ur5us has joined #crystal-lang
alekhine has joined #crystal-lang
<alekhine> I'm a sort-of beginner. If I want to learn crystal, should I just go and learn Ruby first?
<alekhine> Hello everyone, btw
<FromGitter> <Blacksmoke16> i wouldn't then you'd have to unlearn a bunch of stuff πŸ˜‰
<alekhine> Gotcha. Are there any decent resources yet?
<FromGitter> <Blacksmoke16> https://crystal-lang.org/reference/ is a good one
<alekhine> Thanks
<alekhine> I can execute shell commands withing the language?!
<alekhine> ?!?!?!
<FromGitter> <Blacksmoke16> pretty sure you can do that in pretty much any lang but yea
<alekhine> Wait, really?
<FromGitter> <Blacksmoke16> ruby, php, go, etc at least
<alekhine> How about C?
<FromGitter> <Blacksmoke16> yup
<alekhine> Wow, that is... some new information
<FromGitter> <Blacksmoke16> has it's uses, but if thats all you need just write up a bash script
<alekhine> Nah, I want a compiled language
<alekhine> So, here's my real question
<alekhine> Is crystal fun to write?
<alekhine> I've been learning for about a year and a half, but I have not yet found a language I really enjoy using
<FromGitter> <Blacksmoke16> i think so yes, but i dont think it'll help you much if all you want to do is execute a bunch of shell commands
<alekhine> Lol, don't worry about that. That was just something I wasn't aware of, I won't be wrapping all my scripts in c now
<FromGitter> <Blacksmoke16> that's what bash is for :)
<alekhine> lol you're right. or python i guess
<FromGitter> <Blacksmoke16> python wouldn't help much either if all you want to do is like ⏎ ⏎ ```cd /some/dir ⏎ cp /some/thing.txt ./ ⏎ some command --foo``` [https://gitter.im/crystal-lang/crystal?at=60ee6b3ed2556414f5628b1a]
<alekhine> Bash is still very good at file manipulation. Though I use fish :)
<FromGitter> <Blacksmoke16> by bash i more so kinda meant `.sh` file
<FromGitter> <Blacksmoke16> or whatever shell you use yea
<alekhine> Yeah, Shell languages
<alekhine> Well that answers my questions, I'll go install crystal
<FromGitter> <Blacksmoke16> πŸ‘
<alekhine> night
alekhine has left #crystal-lang [Konversation terminated!]
<ua_> I kinda wonder why he's set on compiled language
lucf117 has quit [Remote host closed the connection]
Guest60 has joined #crystal-lang
Guest60 has quit [Client Quit]
ur5us has quit [Ping timeout: 255 seconds]
<FromGitter> <HertzDevil> "splats" in the macro language for the most part are just aliases of `join`
<FromGitter> <HertzDevil> they are not to be confused with ast node inspection
<kevinsjoberg> Is this a bug or not? https://play.crystal-lang.org/#/r/bjk8 I know @Blacksmoke16 was playing around with this a bit yesterday, but I don't know for a fact if its a bug or a limitation. Would like to try fix it if its a bug.
<kevinsjoberg> Perhaps I should fail it as a bug in upstream and see what the outcome is?
<kevinsjoberg> file*
<FromGitter> <wyhaines> Your `add_b` does work. What fails is actually the puts. ⏎ ⏎ Add a macro line to show you B after you assign to it: ⏎ ⏎ ``` {% ⏎ B[key] = { type: @type.name, value: value } ⏎ pp B ⏎ %}``` ... [https://gitter.im/crystal-lang/crystal?at=60ee96c57b5a415e65e58c45]
<kevinsjoberg> @wyhaines, sorry I should have been clear. Yes, the macro works. I know the `puts` is the culprit, but I'd still expect it to work.
<kevinsjoberg> Why is it breaking upon trying to access the constant at runtime?
<FromGitter> <wyhaines> The error is being thrown from the c rystal_sigfault_handler, and my guess right now is that there is some sort of loop that is entered in the compiled code, but not the interpreted code, which is why there is the behavior difference. ⏎ ⏎ I'd be curious to see if it still fails on the current crystal main branch, since at least some of that code has changed a little.
ur5us has joined #crystal-lang
elf_fortrez has joined #crystal-lang
mfiano has joined #crystal-lang
elf_fortrez has quit [Ping timeout: 246 seconds]
<mfiano> Hello :)
<mfiano> New user here. How long has crystal-lang.org been down?
<jhass[m]> Seems up for me :)
<mfiano> Odd. It is down for me both at home and at work. Secure connection failed due to PR_END_OF_FILE_ERROR
<jhass[m]> maybe some common "security software"?
<kevinsjoberg> Up for me as well.
<mfiano> I don't have any such thing, but finally seems to work now and I did nothing.
<mfiano> Sorry for the noise :)
<FromGitter> <alexherbo2> do you have an example of use for iterator `of`?
<FromGitter> <alexherbo2> https://crystal-lang.org/api/1.0.0/Iterator.html#of(element:T)-class-method
ur5us has quit [Ping timeout: 255 seconds]
<jhass[m]> The single element overload specifically?
<FromGitter> <HertzDevil> it seems to happen because you are adding a `MacroId` to that `NamedTuple`
<FromGitter> <HertzDevil> this also breaks for example
<FromGitter> <HertzDevil> ```A = [] of Int32 ⏎ {% A << "1".id %} ⏎ A``` [https://gitter.im/crystal-lang/crystal?at=60eeff00951c58084edb4720]
<FromGitter> <HertzDevil> `Unhandled exception: can't execute `__temp_499[0] = 1` at eval:1:5: `1` has no type (Exception)`
<FromGitter> <lodenos> I’ve a little question about `Int128` how work’s behing that’s use SSE4 or not ?
<kevinsjoberg> @HertzDevil should it break though?
<kevinsjoberg> Looking at the compiler code, it’s clear MacroId is the culprit, but I still think it should be able to deduce the type here.
elf_fortrez has joined #crystal-lang
avane has quit [Ping timeout: 258 seconds]
<mfiano> Curious, why does crystal not have traditional block-level symbol table semantics?
<FromGitter> <Blacksmoke16> :shrug: maybe a better question for the forums?
elf_fortrez has quit [Ping timeout: 246 seconds]
terminalpusher has joined #crystal-lang
<terminalpusher> where can I watch the recorded video of the Crystal 1.0 conference?
<FromGitter> <Blacksmoke16> they're not released publicly yet
<terminalpusher> alright then I will wait for longer
terminalpusher has quit [Remote host closed the connection]
f1refly has quit [Ping timeout: 258 seconds]
f1refly has joined #crystal-lang
avane has joined #crystal-lang
jcs has joined #crystal-lang
ur5us has joined #crystal-lang
<FromGitter> <RespiteSage> Is there any way to use a module with `macro included` to include an inner class in a generic class which has an instance variable of the type of that generic class?
<FromGitter> <RespiteSage> That was complicated to write, so here's an example: https://carc.in/#/r/bjqq
ur5us has quit [Remote host closed the connection]
ur5us has joined #crystal-lang
mookie has joined #crystal-lang
<FromGitter> <Blacksmoke16> @RespiteSage https://carc.in/#/r/bjra nice
<FromGitter> <Blacksmoke16> i feel like what you have should work as i would think it would pick up `T` from the including type
<FromGitter> <respitesage:matrix.org> Huh. Yeah, I would also expect it to work.
<FromGitter> <Blacksmoke16> @RespiteSage https://github.com/crystal-lang/crystal/issues/9488