ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.23.1 | 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
<travis-ci> crystal-lang/crystal#f23a126 (master - Merge pull request #4996 from asterite/bug/3502-type-parameter-in-alias): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/278415848
<DeBot> https://github.com/crystal-lang/crystal/pull/4996 (Semantic: don't find type parameter in alias)
<FromGitter> <faustinoaq> I have a question, ECR templates are inlined and embedded to binary executable when a project is compiled, so Would this approach be faster that reading file system each time like all common web frameworks do?
<FromGitter> <bew> yeah totally
<FromGitter> <bew> the templating file is read & parsed at compile time, where other templating needs to do this at runtime (they'll probably read & parse only once, and keep the parsed template somewhere in memory)
weston1 has joined #crystal-lang
<FromGitter> <georgeu2000> How do I declare this instance variable? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59c459b1cfeed2eb6538ec9a]
<FromGitter> <georgeu2000> It is an array of Int32.
<FromGitter> <georgeu2000> I get `Can't infer the type of instance variable '@abundants' of Calculator`.
<FromGitter> <bew> you need to declare it as `@abundants : Array(Int32)`
<FromGitter> <georgeu2000> `instance variable '@abundants' of Foo was not initialized in all of the 'initialize' methods, rendering it nilable`, so it seems I need to initialize it in the `initialize` method...
<FromGitter> <bew> depends on what you need, if it can be nil, you can declare it as an `Array(Int32)?` (note the `?`, making it nilable), or you can init it in `initialize` either with a default value (empty array?) or with your code
rohitpaulk has joined #crystal-lang
<FromGitter> <georgeu2000> Oh, I see. Thanks.
greengriminal has joined #crystal-lang
weston1 has quit [Ping timeout: 252 seconds]
vegai has quit [Remote host closed the connection]
<crystal-gh> [crystal] asterite opened pull request #5017: Remember STDIN, STDOUT and STDERR blocking state when program begins and restore it at the end (master...bug/2713-fix-blocking) https://git.io/vdvMu
rohitpaulk has quit [Ping timeout: 260 seconds]
<crystal-gh> [crystal] Sija opened pull request #5018: Use `TypeNode#union_types` where possible (master...pr-4995-followup) https://git.io/vdvMj
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 252 seconds]
bmcginty has quit [Ping timeout: 240 seconds]
thitch has joined #crystal-lang
bmcginty has joined #crystal-lang
thitch has quit [Quit: Page closed]
rohitpaulk has joined #crystal-lang
greengriminal has quit [Quit: This computer has gone to sleep]
rohitpaulk has quit [Ping timeout: 248 seconds]
rohitpaulk has joined #crystal-lang
thews has quit [Ping timeout: 240 seconds]
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 255 seconds]
thews has joined #crystal-lang
thews has quit [Changing host]
thews has joined #crystal-lang
<FromGitter> <ansarizafar> I have initiated a class defined in a module. How can access its methods
<FromGitter> <ansarizafar> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59c49592c101bc4e3af60f30]
<FromGitter> <bew> did you read the documentation? https://crystal-lang.org/docs
<FromGitter> <bew> you can access those method like any other methods in any classes
<FromGitter> <bew> as in `my_log = WebWare::Log.new; my_log.logme("msg", color)`
rohitpaulk has quit [Ping timeout: 252 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <ansarizafar> I have read guide/api documentation. I have initiated the calls like this WebWare::Log.new without assigning it to a variable as mentioned in the guide https://crystal-lang.org/docs/syntax_and_semantics/modules.html my question is how can I access methods from a different file
<FromGitter> <bew> you just need the module in a separate file, not the last line. In another file, require the file with the module (see https://crystal-lang.org/docs/syntax_and_semantics/requiring_files.html), then you can instantiate your class (save the instance to a variable) and use it's methods.
<FromGitter> <ansarizafar> Another related question is how can I create singleton object . I don't want to initiate Log class in every file.
<FromGitter> <bew> 2 ways (maybe more): with a constant (intialized before everything), with a class method (initialized on first demand). example: https://carc.in/#/r/2rv5
rohitpaulk has quit [Ping timeout: 260 seconds]
<FromGitter> <ansarizafar> class variable did the job me.
<FromGitter> <bararchy> So, i opened a channel for supporting crystal-fann if anyone needs it: https://gitter.im/crystal-fann/Lobby
vegai has joined #crystal-lang
rohitpaulk has joined #crystal-lang
DTZUZO has quit [Ping timeout: 240 seconds]
DTZUZO has joined #crystal-lang
snsei_ has quit [Remote host closed the connection]
snsei has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
mark_66 has joined #crystal-lang
<FromGitter> <sdogruyol> Morning everyone
<FromGitter> <sdogruyol> @bararchy great job with crystal-fann πŸ‘
rohitpaulk has quit [Ping timeout: 264 seconds]
Groogy has quit [Disconnected by services]
Groogy_ is now known as Groogy
<Groogy> Morning!
Groogy2 has joined #crystal-lang
p0p0pr37 has quit [Read error: Connection reset by peer]
p0p0pr37 has joined #crystal-lang
p0p0pr37 has joined #crystal-lang
manveru has quit [Ping timeout: 255 seconds]
saadq_ has quit [Ping timeout: 255 seconds]
rohitpaulk has joined #crystal-lang
manveru has joined #crystal-lang
saadq has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
snsei has quit [Remote host closed the connection]
<FromGitter> <krypton97> morning all, just found this awesome git rank
<FromGitter> <krypton97> seems that apple beat microsoft x)
<FromGitter> <sdogruyol> lol
<FromGitter> <sdogruyol> Crystal beats Scala there
<FromGitter> <sdogruyol> it should be taken with a grain of salt :P
<FromGitter> <faustinoaq> Yeah, scala is a great language, crystal still needs a lot of work to have a community like scala. ⏎ ⏎ They even have a scalacenter with a scala "stairs" πŸ˜„ ⏎ ⏎ https://www.youtube.com/watch?v=Bh5mWHQgpkg ... [https://gitter.im/crystal-lang/crystal?at=59c4d0aa614889d47528fb35]
<FromGitter> <sdogruyol> lol
<FromGitter> <krypton97> apple, google and microsoft on first 3 places, what a surprise :) ..Sometimes I wonder how popular these languages would be without google's/ apple's back
claudiuinberlin has joined #crystal-lang
<FromGitter> <krypton97> nice scala stairs
claudiuinberlin has quit [Client Quit]
_whitelogger has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 246 seconds]
early has quit [Quit: Leaving]
early has joined #crystal-lang
lapinferoce has joined #crystal-lang
flaviodesousa has joined #crystal-lang
Philpax_ has joined #crystal-lang
Philpax has quit [Ping timeout: 246 seconds]
bmcginty has quit [Ping timeout: 248 seconds]
bmcginty has joined #crystal-lang
<Groogy> when a macro for logging accidentally allocates memory for strings and it just kills our performance and it took way too long to find that out <_<
<FromGitter> <ziprandom> hey @sdogruyol is there a way to have kemal auto re[compile/start] while developing?
SteppenII has joined #crystal-lang
SteppenII has quit [Client Quit]
<FromGitter> <krypton97> @ziprandom check it out
<FromGitter> <krypton97> https://github.com/samueleaton/sentry
<FromGitter> <ziprandom> @krypton97 tried it, it doesn't work. can't compile in release mode. in dev mode the binary does nothing. not even shoe `--help` output :/
<FromGitter> <jose-rodrigues> @ziprandom What do you mean by `the binary does nothing` even whenm you compile directly with crystal?
lapinferoce has quit [Ping timeout: 255 seconds]
<FromGitter> <ansarizafar> Beginner Question: Is there any global exception handler in Crystal?
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
<Yxhuvud> not be default, but you can always wrap whatever you are writing with begin .. rescue .. end. I'd advise strongly to not do that though.
<FromGitter> <zyriuse75> @krypton97 thank for the link man πŸ‘
<ShalokShalom> Papierkorb: You said your bindings are ready for Tier 1 KDE?
<FromGitter> <krypton97> np m8 ;)
<FromGitter> <krypton97> @ziprandom try to submit an issue, haven't used it so far
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 246 seconds]
ShalokShalom_ has joined #crystal-lang
ShalokShalom has quit [Ping timeout: 252 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Client Quit]
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Client Quit]
<FromGitter> <imonmyown> Hi all :)
<FromGitter> <imonmyown> What are the generally accepted marshalling tools, or if none are available what is the preferred way to store application settings locally?
<FromGitter> <bew> you can use JSON or YAML
rohitpaulk has quit [Ping timeout: 252 seconds]
<FromGitter> <bew> be sure to check the docs https://crystal-lang.org/api/0.23.1/JSON.html#mapping(properties,strict=false)-macro & https://crystal-lang.org/api/0.23.1/YAML.html#mapping(properties,strict=false)-macro
rohitpaulk has joined #crystal-lang
<FromGitter> <imonmyown> Thanks @bew
rohitpaulk has quit [Ping timeout: 246 seconds]
ShalokShalom_ is now known as ShalokShalom
<FromGitter> <imonmyown> What would be the right mapping for a single YAML array? ⏎ ⏎ ```class Foo ⏎ YAML.mapping([] of Integer) ⏎ end``` ⏎ ⏎ Doesn't cut it apparently... :( [https://gitter.im/crystal-lang/crystal?at=59c50b26cfeed2eb653babfc]
<FromGitter> <imonmyown> Do I have to put it behind a key?
<FromGitter> <bew> yes
<FromGitter> <bew> or use
<FromGitter> <bew> `Array(Int32).from_yaml(some_yaml)` directly
<FromGitter> <imonmyown> Great, thanks
hightower3 has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Client Quit]
hightower4 has quit [Ping timeout: 240 seconds]
lapinferoce has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
rohitpaulk has joined #crystal-lang
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
lapinferoce has quit [Quit: WeeChat 1.9]
<FromGitter> <faustinoaq> Official API search needs some work, devdocs is a great tool πŸ‘
gcds has joined #crystal-lang
<gcds> Hi, is there implementation of PBKDF2 on Crystal?
<FromGitter> <faustinoaq> No as far I know πŸ˜… ⏎ ⏎ You can use https://crystalshards.xyz to find crystal projects.
rohitpaulk has quit [Ping timeout: 246 seconds]
greengriminal has joined #crystal-lang
flaviodesousa has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
mark_66 has quit [Remote host closed the connection]
<gcds> Maybe someone could help me. I am trying to compile std lib and get problem I think on mac somehow std lib cant find libcrypto. Maybe someone has encountered this problem? pkg-config libcrypto doesnt return nothing...
<gcds> it does return sorry but still I cant build :(
snsei has joined #crystal-lang
<gcds> i think I know the problem my openssl is to old
<gcds> too*
<FromGitter> <Sly777> Hey all, I'm trying to make crystal app with Kemal, Granite ORM on postgres. My question is I created one model that needs to update password to encrypted one. But on the build, It's giving error as *instance variable '@password' of User must be (String | Nil), not Crypto::Bcrypt::Password* ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59c52907bac826f054ea517d]
<FromGitter> <fridgerator> `.to_s`
sstory has joined #crystal-lang
<crystal-gh> [crystal] aurimasniekis opened pull request #5021: Added `pkcs5_pbkdf2_hmac` to `lib_crypto.cr` and `pkcs5.cr` (master...feature/opensll_pbkdf2_implementation) https://git.io/vdfyl
<FromGitter> <Sly777> But after that, How can I cast to Bcrypt again to compare password?
<FromGitter> <Sly777> Btw. I'm really new on crystal so It can be dumb question :D
<FromGitter> <fridgerator> something lilke ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59c52a77614889d4752ab35e]
<FromGitter> <Sly777> Thanks @fridgerator !
<FromGitter> <fridgerator> sure
<gcds> yay... the same error I had on my machine is now on CircleCI :D
<FromGitter> <luislavena> @gcds CircleCI for OSX? Same solution you applied locally you might want to apply to CI, might recommend install newer OpenSSL using Homebrew.
<gcds> luislavena, Locally I just used PKG_CONFIG_PATH flags to help find brew version of openssl so it worked out, but I have no idea how to fix circleci build.
<gcds> ahhh its osx build
<gcds> now I got it :D
<gcds> hmm it did not worked like I expected trying something out :(
sstory has left #crystal-lang [#crystal-lang]
tatey has quit [Quit: ZNC - http://znc.in]
tatey has joined #crystal-lang
Philpax_ has quit [Ping timeout: 255 seconds]
<gcds> I am feeling bit like idiot... the original `PKCS5_PBKDF2_HMAC_SHA1` is found but additional `PKCS5_PBKDF2_HMAC` method is not found then its in the same lib. Even then in OpenSSL `PKCS5_PBKDF2_HMAC_SHA1` wraps a call `PKCS5_PBKDF2_HMAC`
<gcds> Ok i reproduced the error again and fixed with simple flag. https://gist.github.com/aurimasniekis/422e6dfaf3b256d1d9bcea40ae54ef72
<gcds> but the same thing does not work on CircleCI :(
<FromGitter> <ansarizafar> Why I am getting method undefined error? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59c53959614889d4752b0445]
<FromGitter> <georgeu2000> What are you trying to do? Define a class?
astronavt has joined #crystal-lang
<FromGitter> <fridgerator> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59c53b9ecfeed2eb653ca869]
<FromGitter> <fridgerator> or `extend self` inside the module
greengriminal has quit [Quit: This computer has gone to sleep]
<FromGitter> <georgeu2000> How to define a `Hash( Int32, Int32 )` with an initial value of 0 for each key?
<FromGitter> <Rinkana> You dont
<FromGitter> <georgeu2000> Tried `Hash.new( Int32, Int32 ){ 0 }` but it did not work. ⏎ Seems like you can according to https://github.com/crystal-lang/crystal/blob/e2a1389e8165fb097c785524337d7bb7b550a086/src/hash.cr#L28
<FromGitter> <Rinkana> Hash keys are unique so there can be one 0
<FromGitter> <georgeu2000> Oops. I meant value.
thews has quit [Excess Flood]
thews has joined #crystal-lang
thews has quit [Changing host]
thews has joined #crystal-lang
greengriminal has joined #crystal-lang
greengriminal has quit [Quit: This computer has gone to sleep]
gcds has quit [Read error: Connection reset by peer]
greengriminal has joined #crystal-lang
greengriminal has quit [Client Quit]
<FromGitter> <bew> @georgeu2000 `Hash(Int32, Int32).new(default_value: 0)` I guess?
<FromGitter> <georgeu2000> It worked. Thanks!
greengriminal has joined #crystal-lang
greengriminal has quit [Quit: This computer has gone to sleep]
greengriminal has joined #crystal-lang
<FromGitter> <faustinoaq> @kbrsh Hey man, Moon (http://moonjs.ga) looks amazing, great work! πŸ‘
<FromGitter> <krypton97> the rusters started to rewrite the libc in pure rust. That's impressive
<FromGitter> <krypton97> https://github.com/japaric/steed
<FromGitter> <jwaldrip> Can you use macros to construct case statements?
<FromGitter> <jwaldrip> Seems like I get an error when trying to do so
greengriminal has quit [Quit: Leaving]
<FromGitter> <bew> make sure to enclose it with `{% begin %} ... {% end %}` as explained here https://crystal-lang.org/docs/syntax_and_semantics/macros.html#pitfalls
Groogy has quit [Disconnected by services]
Groogy2 is now known as Groogy
Groogy_ has joined #crystal-lang
<FromGitter> <sdogruyol> @krypton97 that's some big effort :)
<FromGitter> <jwaldrip> with self yeild does not seem to be working
<FromGitter> <bew> can you be *a bit* more precise?
<FromGitter> <jwaldrip> hold on, putting together an example
<FromGitter> <jwaldrip> actually, just self does not work
<FromGitter> <jwaldrip> in the block
<FromGitter> <jwaldrip> nvm :-)
<FromGitter> <krypton97> Well, it's unix based and a good part of the code is copy pasted . I guess not so many devs wanna mess with win api
<FromGitter> <sdogruyol> It's not that but more likely there arent much devs who knows much about win32 stuff @krypton97
<FromGitter> <krypton97> Ikr. There's also musl which seems to do better than the gnu implementation https://www.musl-libc.org/
<FromGitter> <krypton97> unix based again :)
<FromGitter> <sdogruyol> I
astronavt has quit [Remote host closed the connection]
<RX14> i am so confused by what i've done to the compiler
<crystal-gh> [crystal] asterite opened pull request #5022: Increase the precision of Time and Time::Span to nanoseconds (master...feature/time) https://git.io/vdJCp
<FromGitter> <papilip> Hello All, Do you know who is responsible for the Crystal logo and its reuse ?
<FromGitter> <papilip> Yes but noby is mentio
<RX14> does it not answer your questions?
<FromGitter> <papilip> No, i want reuse logo for your local group
<FromGitter> <papilip> I dont know if its possible or not
<RX14> i suggest you email spalladino@manas.tech
<RX14> he can at least direct you to the right person
<FromGitter> <papilip> Thank you very much
<FromGitter> <mverzilli> as long as you don't charge for joining the group, it's totally ok
<RX14> oh there you go
<RX14> problem solved :)
<FromGitter> <papilip> @mverzilli thank you, joining Crystal-French is totaly free of chare ;-)
<FromGitter> <papilip> If somebody com, it’s for work and give some time
<FromGitter> <mverzilli> great! make sure to let @ysbaddaden know about those activities, nothing legal, just because he might be interested
<FromGitter> <sdogruyol> @RX14 what've you done?
<FromGitter> <papilip> @mverzilli I saw @ysbaddaden in our gitter channel
<FromGitter> <mverzilli> cool then :)
<RX14> @sdogruyol i don't know and thats the problem
<RX14> doesnt help that the parser_spec.cr seems to have the ability to crash emacs
<FromGitter> <sdogruyol> and here I am trying make wayland work with gnome..
<FromGitter> <sdogruyol> oh god
<FromGitter> <faustinoaq> Wayland works pretty well n KDE now πŸ˜‰
<FromGitter> <faustinoaq> > doesnt help that the parser_spec.cr seems to have the ability to crash emacs ⏎ ⏎ RX14, maybe is related to this issue πŸ‘‰ https://github.com/crystal-lang/crystal/issues/2713 ⏎ ⏎ Vim sometimes fails because this issue too. [https://gitter.im/crystal-lang/crystal?at=59c57345177fb9fe7ef16a67]
<RX14> uhh no
<RX14> emacs is an X11 application
<RX14> well thats how I use it at least
<FromGitter> <faustinoaq> lol, I used to use emacs in terminal
<RX14> i never ever experienced that bug anyway
<RX14> i think my terminal support nonblocking IO lol
<FromGitter> <faustinoaq> lol
<FromGitter> <faustinoaq> https://vimeo.com/233411965
<FromGitter> <faustinoaq> https://github.com/crystal-lang/crystal/issues/2713 is a bit annoying πŸ˜…
<FromGitter> <faustinoaq> I use this πŸ‘‡ in my `.bashrc` ⏎ ⏎ ```STDIN.blocking = true``` [https://gitter.im/crystal-lang/crystal?at=59c574e8c101bc4e3afa234f]
<FromGitter> <faustinoaq> compiled to binary, of course πŸ˜‰
snsei has quit [Remote host closed the connection]
<RX14> you execute that after every command?
<FromGitter> <faustinoaq> yes πŸ˜…
<FromGitter> <krypton97> I'm just wondering, couldn't crystal borrow some code from go when it comes to adding win support?
<crystal-gh> [crystal] ysbaddaden closed pull request #5022: Increase the precision of Time and Time::Span to nanoseconds (master...feature/time) https://git.io/vdJCp
<RX14> @krypton97 no
<FromGitter> <krypton97> Well, was expected
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
_whitelogger has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
snsei has quit [Remote host closed the connection]
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
<FromGitter> <bew> @faustinoaq switch to zsh, I never had the mentioned issue about blocking/non-blocking
<FromGitter> <bew> (but I can reproduce under bash though)
<FromGitter> <faustinoaq> πŸ‘
<FromGitter> <faustinoaq> Oh my Zsh is very impressive!
<FromGitter> <fridgerator> Oh-my-zsh is cool
<FromGitter> <crisward> Weird how these star gazers are growing in parallel for these ruby based languages - http://www.timqian.com/star-history/#crystal-lang/crystal&elixir-lang/elixir&ruby/ruby
<FromGitter> <faustinoaq> Interesting! πŸ‘
<FromGitter> <faustinoaq> Crystal began to grow at mid 2014, so aprox. 3 yrs. ago. This confirm me that Crystal is relatively new language. However We have achieved a lot so far. ⏎ ⏎ If we think to be stable in 1 year, then Crystal will be a language with aprox. 7 years in construction.
<FromGitter> <faustinoaq> Just take JavaScript, 7 days + 1 man = ready for production! (Netscape: what would be wrong, no?)