Guest6663 has quit [Remote host closed the connection]
<FromGitter>
<schoening> Is anyone using the crystal package for sublime text?
snsei has quit [Remote host closed the connection]
Qchmqs has joined #crystal-lang
<FromGitter>
<rishavs> i am
zaiste has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
msg has joined #crystal-lang
msg is now known as Guest68033
olek_poz has joined #crystal-lang
hooo has joined #crystal-lang
<hooo>
why is crystal so slow?
<Yxhuvud>
slow how?
Guest68033 has quit [Remote host closed the connection]
<hooo>
i read somewhere that it's slower than ruby sometimes
<Yxhuvud>
You should be more specific. Usually it is at least a magnitude faster, but there are some places where the ruby devs have optimized things in ways the crystal devs havn't.
zaiste has joined #crystal-lang
<hooo>
when is it gonna be finished?
<hooo>
also whats the compile time like? i dont want to wait
<hooo>
no offense but there are many new languages based on llvm... idk if crystal really stands out in any way. They all claim to be "fast"
<hooo>
I just tried to compile it and it says "you need a crystal executable on your path". Wow what a FAIL!
<FromGitter>
<ezrast> In case you're not trolling, Crystal is self-hosted. You do indeed need Crystal to compile Crystal.
<hooo>
ezrast: then the github repo should just include the latest crystal binary and use that. very ergonomically bad for newcomers
<FromGitter>
<ezrast> Trolling, then. Gotcha.
<hooo>
I'm not trolling, I'm telling you the truth
soveran has joined #crystal-lang
<FromGitter>
<mverzilli> thanks for the truth hooo! :heart:
<FromGitter>
<schoening> @rishavs do you know if there is a way to disable / modify the removal of extra whitespace?
msg has joined #crystal-lang
msg is now known as Guest71432
<hooo>
i asked when crystal is finished and nobody responded!!
soveran has quit [Ping timeout: 260 seconds]
olek_poz has quit [Ping timeout: 260 seconds]
<hooo>
ok i tried it out, imo crystal compiles too slowly
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
<hooo>
500ms for a tiny example project
<FromGitter>
<schoening> Is there a command list for gitter? Specifically #ignore?
Guest71432 has quit [Remote host closed the connection]
<FromGitter>
<crisward> @schoening Thinking the same thing... I think whoever setup the room can boot..
<hooo>
why you so arrogant?? i am pointing out REAL problems with crystal
rafadc has joined #crystal-lang
mark_66 has joined #crystal-lang
olek_poz has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
<FromGitter>
<sdogruyol> @hooo there's no arrogance these are all known issues / improvements
<FromGitter>
<sdogruyol> thanks for pointing out :+1:
<FromGitter>
<rishavs> @hooo yep. Crystal's compile times need to be improved. But as the language is still in alpha, i think its not the highest priority task for now. If i am not mistaken, in the v21 release, some compile time stuff were added so they may make the wait shorter.
<FromGitter>
<schoening> I dunno why you two are doing this.. Hes clearly a troll.
<FromGitter>
<rishavs> regarding binaries, as one beginner to another, i think you are talking about WIndows binaries? they are currently in dev
<FromGitter>
<rishavs> o.0 he might be. but i am giving him the benefit of doubt
<FromGitter>
<rishavs> when i started, i also had similar questions, so i dunno....
<FromGitter>
<rishavs> btw @schoening , sorry i missed your question. unfortunately i dont know. If the whitespace is uniform (like when converting 2psace indent to 4 spaces), i often use Ctrl+H
<FromGitter>
<schoening> Yeah, that's a noble thing to do. I might be a bit fast to judge those things
msg has joined #crystal-lang
msg is now known as Guest31912
<FromGitter>
<rishavs> :D personally, the biggest improvement i want in Crystal is in error message. they are rarely helpful for qabsolute beginners like me. I am so impressed with what elm is doing and hope we can pick some of that stuff up
<FromGitter>
<schoening> Thanks for the link @rishavs ! But sadly it didn't work. The plugin itself seems to remove the whitespace (It does not happen if I change to ruby syntax highlighting for instance) doesnt your plugin auto indent everything on save?
<FromGitter>
<rishavs> strangely no. I use 4 spaces as indents and they stay fine on save.
<FromGitter>
<schoening> And you are just using the package from the package installer? Coz I can only see one package
<FromGitter>
<rishavs> i only have the main crystal package installed.
<FromGitter>
<rishavs> nothing else.
Guest31912 has quit [Remote host closed the connection]
<FromGitter>
<schoening> Alright. Well I just have to deal with that mystery for now :p Thank you for your help tho!
msg has joined #crystal-lang
msg is now known as Guest22659
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
<FromGitter>
<rishavs> what does "&->" mean in crystal?
<FromGitter>
<sdogruyol> -> is a Proc and adding & in front of it means pass the proc as a block
<FromGitter>
<rishavs> thanks!
Guest22659 has quit [Remote host closed the connection]
msg has joined #crystal-lang
msg is now known as Guest17266
Rinkana has joined #crystal-lang
soveran has quit [Remote host closed the connection]
Guest17266 has quit [Remote host closed the connection]
vegai has joined #crystal-lang
bjz has joined #crystal-lang
bjz has quit [Client Quit]
bjz has joined #crystal-lang
go|dfish has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter>
<dreyks> but hen again you should have extend self in the Main module
<FromGitter>
<rishavs> yep that worked. Thanks!
<FromGitter>
<dreyks> :: is for referencing constants, i.e. `Main::SOMETHING`
rafadc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter>
<rishavs> ah, ok
msg has joined #crystal-lang
msg is now known as Guest45695
Kug3lis has joined #crystal-lang
Philpax_ is now known as Philpax
<FromGitter>
<schoening> Why doesn't this work? ⏎ I get the following error: ⏎ *undefined method 'x' for Nil (compile-time type is (Node | Nil))* ⏎ But I am checking if the value is nil beforehand ⏎ ... [https://gitter.im/crystal-lang/crystal?at=58ad835421d548df2c421831]
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 240 seconds]
<FromGitter>
<muscar> hey, guys. while trying to use stumpy_png with crystal 0.21.0 I noticed that some modules/types were renamed in the standard library (Zlib.Reader and Writer and CRC32). I made a PR to fix the inconsistencies, but I wonder what's the best approach to versioning shards. context: https://github.com/l3kn/stumpy_png/pull/11
<FromGitter>
<dreyks> @schoening use `node.parent.try`
<FromGitter>
<dreyks> or assign it to a local
<FromGitter>
<dreyks> parent = node.parent
<FromGitter>
<asterite> @muscar When Crystal reaches 1.0 there won't be breaking changes anymore. Until then expect them, and shards will have to update to these changes... there's no way to version things if the core language changes if you want to use the latest language/std
<FromGitter>
<muscar> thanks @asterite
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 260 seconds]
<FromGitter>
<schoening> @dreyks Thanks! Assigning it to a local variable did the trick. ⏎ I tried looking up *.try* in the api but I did not find an example that made me understand it. Could you perhaps explain what I should pass into the block?
<FromGitter>
<dreyks> it yields your variable which is guaranteed to be not nil
<FromGitter>
<schoening> Thanks! I'll read through it, does it mention why the local variable check worked when the node.parent check did not?
<FromGitter>
<schoening> Cool, try block explained. Got it. Thank you very much :D @dreyks
bjz has joined #crystal-lang
bjz_ has quit [Ping timeout: 260 seconds]
<FromGitter>
<dreyks> yeah, local variables cannot be changed by other thread, while instance variables or method call result can change after you check it for nil
<FromGitter>
<f> @sdogruyol Thanks buddy! :) I hope it will get better.
<FromGitter>
<f> With your great support!
msg has joined #crystal-lang
msg is now known as Guest45919
<Rinkana>
Oh wow, i already have two stars for my 3D engine.
<Rinkana>
Probably trough crystalshards.xyz
Guest45919 has quit [Ping timeout: 268 seconds]
Rinkana has quit [Quit: Page closed]
<FromGitter>
<andreaTP> @hi this should be a really newbie question, parsing json I always ends up with errors: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ ends up with ```unexpected char '' at 1:1 (JSON::ParseException)``` [https://gitter.im/crystal-lang/crystal?at=58ada49fde50490822fee2a9]
<FromGitter>
<andreaTP> cannot understand what I'm doing wrong, json file passed is perfectly valid....
<FromGitter>
<luislavena> @andreaTP can you simply put the contents of the JSON file that is failing and do `JSON.parse(contents)` instead?
<FromGitter>
<luislavena> without seeing the JSON contents, we can't tell why is failing, so better if you can reduce the issue.
<FromGitter>
<luislavena> getting `unexpected char` might indicate the JSON file contains non-UTF8 contents, but without seeing what is inside the json file you're loading, hard to tell
<FromGitter>
<andreaTP> in java/scala we usually use triple quoted strings that allow quoting inside
<FromGitter>
<andreaTP> @crisward sounds like a bug?
<FromGitter>
<luislavena> @andreaTP actually is a bug on the generated JSON, the escaped `"` (`\"`) perhaps needs to be escaped too.
<FromGitter>
<crisward> Are you reading your json from a file?
<FromGitter>
<andreaTP> yep
<FromGitter>
<andreaTP> @luislavena if it is a string I agree, since it is a file it doesn't need to be escaped again...
<FromGitter>
<andreaTP> it is just plain json
<FromGitter>
<crisward> Sounds like a bug to me. Can't believe I've not had this one. I'm parsing json all over the place.
<FromGitter>
<andreaTP> facing it while trying to run my very first real world Crystal program :-S
<FromGitter>
<andreaTP> any workaround to properly escape on ```"```
<FromGitter>
<andreaTP> ?
msg has joined #crystal-lang
<FromGitter>
<crisward> before you parse, you could perhaps do a gsub on the string, replace all \" with \\". Not sure how many slashes you'll need in both though, as they'll also need escaping.
msg is now known as Guest33828
Guest33828 has quit [Remote host closed the connection]
Qchmqs has quit [Ping timeout: 260 seconds]
rafadc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter>
<andreaTP> :-S there is no macro to escape properly?
<FromGitter>
<crisward> I'm using crystal 0.21.0. Don't think that make any difference though
greengriminal has joined #crystal-lang
<FromGitter>
<drosehn> Consider how crystal parses this string: "println(\"hello world!\")"
<FromGitter>
<drosehn> Let me get that highlighted: `"println(\"hello world!\")"`
<FromGitter>
<drosehn> the first `"` starts a character string. the `\"` tells *crystal* to include a single `"` in that string. The `\` is used-up when crystal parses the string, so that crystal won't use the `"` to terminate the string. Repeat that for the second `\"`. And then the final `"` terminates the string for crystal.
<FromGitter>
<drosehn> Using `p` to print a string value is very helpful, but it might leave you with the wrong impression when the string includes characters which need to be escaped. Try: `printf "'%s'\n", "println(\"hello world!\")"`
<FromGitter>
<drosehn> which prints `'println("hello world!")'`, without the backslashes.
mark_66 has quit [Remote host closed the connection]
olek_poz has quit [Ping timeout: 260 seconds]
<FromGitter>
<rishavs> hi. i want to call a model (which is inside a module) from another module. How do i achieve it? ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Here i want to call the Post model and get the result in the dataset object. [https://gitter.im/crystal-lang/crystal?at=58adc19b872fc8ce626dc080]
<FromGitter>
<idchlife> Did you include Models module?
<Papierkorb>
rishavs, just write the modules separated by :: in front: Posts::Post
Kug3lis_ has joined #crystal-lang
Kug3lis has quit [Ping timeout: 240 seconds]
Kug3lis_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter>
<rishavs> @idchlife yep. ⏎ @Papierkorb, How so? I tried `dataset = Crecto::Repo.all(Models::Post, query)` that didnt work
<FromGitter>
<idchlife> @rishavs what error do you get?
Guest71630 has quit [Remote host closed the connection]
msg has joined #crystal-lang
msg is now known as Guest29178
zaiste has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter>
<rishavs> added the error to the gist. it is too large to paste here
<FromGitter>
<idchlife> As I can guess from the error - DB Module lacks of
<Papierkorb>
> undefined method 'mapping' for DB:Module
olek_poz has joined #crystal-lang
<FromGitter>
<idchlife> undefined method 'mapping' for DB:Module
<FromGitter>
<idchlife> Exactly
<FromGitter>
<rishavs> How do you manage to see all that? o.0 All i saw was scary wall of text....
<FromGitter>
<rishavs> i'll see if i am missing and requires and do shards update
soveran has quit [Remote host closed the connection]
<FromGitter>
<idchlife> Stack trace is like
<Papierkorb>
rishavs, the most important thing is to look at the error message, not all that other stuff. Important messages are always at the beginning, or the end of outputs like this. The single worst thing you can do is scrolling around while thinking to your self "I've no idea what this is supposed to tell me". One is right in that it's hard to decipher, while scrolling, what it's trying to tell you: That's because you're trying to read text
<Papierkorb>
without context.
<Papierkorb>
rihavs, Look it from another perspective: The one who designed the error output (even if huge) was a fellow programmer. There will be some kind of logic behind it. For shell output, it's mostly at the bottom, as that's what you'll see first after the command ran through.
<FromGitter>
<rishavs> thanks! i'll keep it in mind. currently wrangling with some missing dotenv variable. other errors have disappears.
zaiste has joined #crystal-lang
<FromGitter>
<rishavs> all right, all done. everything works fne now. Thanks @papierkorb and @idchlife
greengriminal has quit [Quit: This computer has gone to sleep]
greengriminal has joined #crystal-lang
<FromGitter>
<andreaTP> @crisward @luislavena just to report, it was a character encoding problem, converting first the file from UTF-8 to ASCII do the trick and everything works smoothly (b.t.w Go fail the very same way :-))
msg has joined #crystal-lang
msg is now known as Guest55967
<FromGitter>
<luislavena> @andreaTP the JSON file I tested was UTF-8, so perhaps there was a non-ascii space in there that made things go crazy, but happy to hear it works now :D
greengriminal has quit [Quit: This computer has gone to sleep]
<FromGitter>
<dreyks> utf-8 issues with files can be related to BOM
A124 has quit [Quit: '']
A124 has joined #crystal-lang
<FromGitter>
<Rinkana> @Papierkorb thanks, that works.
<FromGitter>
<crisward> Anyone else got Crystal Play throwing errors for 0.21.0 on mac?
olek_poz has quit [Ping timeout: 268 seconds]
zaiste has quit [Ping timeout: 268 seconds]
Svenskunganka has quit [Quit: leaving]
<FromGitter>
<fridgerator> yep, not working for me
<FromGitter>
<ezrast> @crisward @luislavena @andreaTP Just for the record, `\` is a control character inside `%()` strings. `%({"text": "println(\\"hello world!\\")"})` (two backslashes at a time, not three) works.
<FromGitter>
<ezrast> or `%q({"text": "println(\"hello world!\")"})`
<FromGitter>
<bcardiff> @crisward / @fridgerator #4061 fixes the play and and some specs to stress the playground prelude. But I don't understand yet why that fix is needed so it there might be a hidden bug in the compiler. Help is welcome to reduce the bug :-)
<FromGitter>
<lhz> @ezrast: Ah, great! Was trying to use a `def included` as in Ruby, but that didn't work. So there is a macro, cool. :)
Kug3lis has joined #crystal-lang
Kug3lis has quit [Client Quit]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
gloscombe has quit [Remote host closed the connection]
<FromGitter>
<drosehn> @crisward : thanks for the note about`brew switch libevent`. I'm sure that's much better than my cheating tactic of creating symlinks!
<RX14>
lucky my old script for provisioning KVM machines still works almost flawlessly on amazon
<RX14>
making great progress on ec2 jenkins slaves sao far tonight
<FromGitter>
<bcardiff> @crisward check #4061 again, I change the fix and might give you a clue for your usage. Although yes, the previos fix might be better, but actually #3988 needs to be fixed.
<Papierkorb>
schoening, instead of `if !x`, you can also do `unless x`. But that's being picky for now, looks like you're getting accustomed to the language quick :)
soveran has joined #crystal-lang
olek_poz has quit [Ping timeout: 260 seconds]
<RX14>
looks like running jenkins slaves on t2.medium works well
<RX14>
i'll update the AMI to include a bunch of llvm versions too