ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.24.2 | 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
pabs has joined #crystal-lang
<RX14> well thats confusing and hard to read: http://owo.sh/20248d.png
<FromGitter> <bew> ahahah you need more colors
<RX14> nah it uses all of them
<RX14> it's just an unlucky hash collision
<FromGitter> <bew> how many colors do you have? 16? 256?
<RX14> 16
<RX14> its fine because usually people with the same colour have different nick length
<FromGitter> <bew> "usually"
duane has joined #crystal-lang
duane has quit [Ping timeout: 260 seconds]
rojo has joined #crystal-lang
rojo is now known as akaiiro
bbobb has quit [Ping timeout: 256 seconds]
alex`` has quit [Ping timeout: 255 seconds]
TCZ has joined #crystal-lang
TCZ has quit [Quit: Leaving]
thews_ has quit [Excess Flood]
thews has joined #crystal-lang
thews has joined #crystal-lang
thews has quit [Changing host]
duane has joined #crystal-lang
pabs has quit [Ping timeout: 248 seconds]
pabs has joined #crystal-lang
slott has joined #crystal-lang
slott has quit [Remote host closed the connection]
akaiiro has quit [Quit: akaiiro]
pabs has quit [Ping timeout: 245 seconds]
pabs has joined #crystal-lang
pabs has quit [Ping timeout: 264 seconds]
pabs has joined #crystal-lang
slott has joined #crystal-lang
slott has quit [Remote host closed the connection]
slott has joined #crystal-lang
slott has quit [Remote host closed the connection]
slott has joined #crystal-lang
slott has quit [Client Quit]
slott has joined #crystal-lang
slott has quit [Remote host closed the connection]
slott has joined #crystal-lang
slott has quit [Remote host closed the connection]
<FromGitter> <bararchy> RX14 lol, you need to upgrade to 256 colors ;)
Liothen has quit [Remote host closed the connection]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 256 seconds]
rohitpaulk has joined #crystal-lang
Liothen has joined #crystal-lang
duane has quit [Ping timeout: 256 seconds]
dragonkh has joined #crystal-lang
bbobb has joined #crystal-lang
bbobb has quit [Client Quit]
dragonkh has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
alex`` has joined #crystal-lang
johndescs_ has joined #crystal-lang
johndescs has quit [Ping timeout: 256 seconds]
johndescs_ is now known as johndescs
<ben___> Awesome !! Linux 4.17 supports fully KTLS - thats pretty cool! When will Crystal use it? Any plans? New system call looks pretty simple 😁
<FromGitter> <bararchy> didn't know about it TBH
<FromGitter> <bararchy> fully means they added decryption too?
<ben___> Yes, 4.13 is only sending, now incoming too, so complete handshake via kernel - that's terrible cool
<FromGitter> <bararchy> Reading on it https://github.com/ktls/af_ktls
<FromGitter> <bararchy> btw, one thing I hated about SSL\TLS in Windows is that the system uses the OS kernel for TLS, this means that ciphers, protocols and configurations happen in the registry and effect all applications. ⏎ This in turn meant that you couldn't close TLS1.0 because SQL-Express bugged and didn't work with TLS1.2
<ben___> My last experience with that in C and openssl bio API was about 2012, but I know about the ressources it needs, so that now the kernel does would be more than great
<FromGitter> <bararchy> interesting how this will work with hardware ecceleration
<ben___> What hardware is already capable of? Are CPUs already? And than, what's about KVM virtual CPUs? But kernel is already pretty cool
<FromGitter> <bararchy> ben___ I mean this: https://en.wikipedia.org/wiki/SSL_acceleration
<ben___> Ah ok, yes, i know - that's pretty cool, ok. I am looking on cloud based server instances for low budget projects :)
dragonkh has joined #crystal-lang
gmk has joined #crystal-lang
gmk has quit [Client Quit]
<ben___> Something wrong pasted: after complete handshake via kernel :)
gewo has quit [Quit: WeeChat 1.6]
Raimondi has quit [Ping timeout: 244 seconds]
Raimondi has joined #crystal-lang
marius has quit [Quit: baj]
rohitpaulk has quit [Ping timeout: 256 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 264 seconds]
rohitpaulk has joined #crystal-lang
dragonkh has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<FromGitter> <hmans> Last night I had a dream about Crystal 0.25 being released
<FromGitter> <bararchy> Omg same dream here
<FromGitter> <bcardiff> You are not alone :-) Shards 0.8.0 will come bundled in 0.25 . There are many changes in 0.25 w.r.t. 0.24 and I am trying to check some PR to hopefully avoid some extra headaches.
<FromGitter> <hmans> I love you Brian
<FromGitter> <bcardiff> :-)
rohitpaulk has quit [Ping timeout: 265 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 256 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 245 seconds]
rohitpaulk has joined #crystal-lang
<ben___> 😁
<FromGitter> <bararchy> we need a doom clock where 00:00 is the release date
<FromGitter> <bararchy> and @bcardiff will move the time based on todays estimation
<ben___> 😁😁
<crystal-gh> [crystal] bcardiff closed pull request #4787: Added Float32 and Float64 consts (master...float_consts) https://git.io/v7VH0
<FromGitter> <bcardiff> With this new release all distributed binaries are built by circleci. The manual part is publishing. That will come handy for the release process.
<FromGitter> <bcardiff> BTW: I will be in Budapest for the following days. If there is someone from there fill free to ping me. :-)
<ben___> Oh oh guys... He would go traveling... Seems there is no 0.25 at these days 😨
<ben___> 🚦🚨
rohitpaulk has quit [Ping timeout: 265 seconds]
rohitpaulk has joined #crystal-lang
<ben___> Please... Understand... Trump is waiting for 0.25 ... Are you really want to go traveling??
<ben___> XD
<crystal-gh> [crystal] bcardiff closed pull request #5380: Execute 128bits Hasher specs that are now passing (master...execute-128bits-hasher-specs) https://git.io/vbgJI
<FromGitter> <bcardiff> I've been travelling the last month
<FromGitter> <bcardiff> I'm in Prage ready to catch a train to Budapest.
<FromGitter> <bararchy> omg nooo lol
<ben___> Rofl
<FromGitter> <bararchy> no 0.25 this week i guess
<FromGitter> <bararchy> 2 day train hahah
<ben___> It sounds like Catch me if you can
<ben___> xD
<ben___> Guys, I have a good idea :) we must increase the pressure for him... From now we all should sing about 0.25 on IRC so he MUST do it!! sing! Sing! SING! 🎶🎵🎼
<ben___> I willl wait fooor 0.25 - oh when will it come - i wait for 0.25 - oooh when will it coooomee - I will waaaiiitt fooor 0.25 .... And now all together 😁
<FromGitter> <j8r> @bcardiff is there a plan to also build for ARM64 (with qemu)? If needed, I can provide an alpine:edge image with it inside and crystal 0.24.2
<FromGitter> <Grabli66> Where are no issues for 0.25. Release?
<faustinoaq> Interesting...
<travis-ci> crystal-lang/crystal#de3c95e (master - Execute 128bits Hasher specs that are now passing (#5380)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/388215213
<DeBot> https://github.com/crystal-lang/crystal/pull/5380 (Execute 128bits Hasher specs that are now passing)
<ben___> @faustinoaq: you mean the gap between swift and C#?
<faustinoaq> ben___ .NET and C# are very fast now
<ben___> @faustinoaq: yes, definitely, Microsoft is doing a good job..
<FromGitter> <faustinoaq> lol
<ben___> lol
<ben___> But crazy
<ben___> 😁
<FromGitter> <faustinoaq> Oh
<ben___> I hate benchmarks
<ben___> 😁
<faustinoaq> hehe
<faustinoaq> Hey RX14 @asterite take a look: https://www.reddit.com/message/messages/c36ksg
<faustinoaq> Someone wants /r/crystal to publish some chemistry stuff :)
<FromGitter> <bcardiff> For now there is no new artifacts in the release. @j8r
<FromGitter> <bcardiff> @faustinoaq yes. To focus on the new features and breaking changes mainly.
<faustinoaq> @bcardiff Nice!
<txdv> peachpie is not about speed
<FromGitter> <hmans> ❤️🎉☕️🔮
<txdv> its about creating a migration path from shit code to something useful
<FromGitter> <faustinoaq> ^^ https://www.reddit.com/message/messages/c36ksg (for moderators)
<ben___> You can't make something useful of it
<ben___> Ah ... A fully another question... Is 0.25 out??
<ben___> 😁😅
<ben___> 😏
<z64> ben___: no, not yet
<ben___> :)
<FromGitter> <hmans> I have 0.25
<FromGitter> <hmans> IN MY PANTS
<FromGitter> <hmans> I'm sorry. Sometimes it's hard for me to balance professionalism vs. excitement.
<FromGitter> <hmans> Mmm.
<z64> o
<ben___> Far away from my laptop.. I know, I had to write my code or read the source, but just wanna ask.. In Golang the coroutines are very effective and you can calculate many things in time/coroutines - how effective are fibers already? Must we wait for parallelism or are they already as useful as in golang for easy splitting such jobs? I am not meaning waiting for IO, just on calculations.. Any good recommendations or don't do
<ben___> yet? :)
<ben___> There shouldn't be a newline before yet ?!
<FromGitter> <bararchy> they won't give performance benifit if this is what you're asking
<FromGitter> <bararchy> unless IO etc..
<ben___> Ah ok yes, that's my question :)
<faustinoaq> wait... Crystal is already using pthread and Thread/Mutex/sync/wait are available (with :nodoc:), can I do parallelism in crystal using primitives?
<faustinoaq> Just like doing parallelism on C :)
<FromGitter> <bararchy> yeha, just dont: ⏎ 1) allocate ⏎ 2) IO ⏎ 3) File [https://gitter.im/crystal-lang/crystal?at=5b16837535e25f39974e5db3]
<FromGitter> <bararchy> no Fiber also
<FromGitter> <bararchy> so no sleep
<faustinoaq> Oh ok +1
<FromGitter> <bararchy> libc.sleep should work though
<faustinoaq> So I would need `LibC.usleep` or something similar
<FromGitter> <bararchy> yeha
<FromGitter> <bararchy> :)
<FromGitter> <bararchy> look here -> https://gist.github.com/oprypin/00953b336673719dba25
<faustinoaq> Oh, yeah, nice! :)
<ben___> Oh, I can do run release like build release? Cool
<FromGitter> <bararchy> you can also `spec --release` :)
<ben___> Cool
<ben___> Crystal is awesome
<ben___> :)
<FromGitter> <bararchy> I heard 0.25 is going to be even better ;)
<ben___> What?
<ben___> run --faster --release :)
<FromGitter> <bararchy> Lol, Version 0.25, the talk on the street say it's gonna be crazy
<FromGitter> <bararchy> Hahah
<FromGitter> <bararchy> Try `--lto=thin`
<FromGitter> <bararchy> Should decrease compile time on release mode
<ben___> Ok now I am waiting for it too
<ben___> :)
<FromGitter> <bararchy> Though for me it didn't work, I got sigfault when trying thin lto
<ben___> My two lines of code are already compiled in 20s :)
<ben___> Ok I will try don't know
dragonkh has joined #crystal-lang
<FromGitter> <schoening> I dont want to worry about premature optimisation. But this looks like I am doing something very wrong with all those #to_f32 ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b168a62b6eece791ddef103]
<z64> @schoening you can use literals, i.e. `0_f32`
<jeromegn> @bararchy woah, is that Thread::Mutex thing something new? I thought anything having to do with `Thread` was crashy
<jeromegn> oh, it's just undocumented, has been around for 2 years
<FromGitter> <bararchy> @schoening https://github.com/crystal-lang/crystal/pull/6074
<FromGitter> <bararchy> so in next version crystal the compiler will handle this for you
<FromGitter> <bararchy> jeromegn "Here be dragons"
<jeromegn> :)
<FromGitter> <bararchy> it's undocumented and scary for a reason, Crystal does not support multi-htreading and can crash unless you use those very strictly
<FromGitter> <schoening> Cool :)
<FromGitter> <schoening> Also really happy so hear there is progress with crystal! Its fun to code in for a change for me
<FromGitter> <schoening> Ugh, I keep forgetting how to do a proper nil check. if (@target.not_nil!) gives an error when trying to access the methods of the object that is potentially nil. But I forgot the correct way, anyone?
<FromGitter> <bararchy> ```if (target = @target) ⏎ do stuff with target ⏎ end ⏎ ``` [https://gitter.im/crystal-lang/crystal?at=5b168dedf9f2e56cf2416fd0]
<z64> yeah you want to avoid `.not_nil!` assertions except where it makes sense to (i.e. if foo is nil, then water isn't wet)
<FromGitter> <bararchy> so..... @schoening .... what game are you building? :)
<FromGitter> <schoening> Haha, uhm. Let's wait until I am a little further than not being able to figure out nil checks before I tell you about it. Otherwise I just reward my brain by talking about it rather than accomplishing something @bararchy :p
<FromGitter> <bararchy> I get you, have fun :)
<z64> there's some good sections in https://crystal-lang.org/docs (see the if..var section for instance) that has a lot of details on how to handle `nil`
<ben___> 6074 is really cool
return0e_ has quit [Read error: Connection reset by peer]
return0e has joined #crystal-lang
<FromGitter> <gdotdesign> @schoening there is `.try` https://crystal-lang.org/api/0.24.2/Object.html#try%28%26block%29-instance-method
<FromGitter> <alex-kampa> I have installed openssl_ext, but require "openssl_ext" gives me the following error:
<FromGitter> <alex-kampa> /usr/bin/x86_64-linux-gnu-ld: cannot find -lgmp ⏎ collect2: error: ld returned 1 exit status ⏎ Error: execution of command failed with code: 1: `cc "${@}" -o '/home/alex/.cache/crystal/crystal-run-test.tmp' -rdynamic -lgmp `command -v pkg-config > /dev/null && pkg-config --libs libssl || printf %s '-lssl -lcrypto'` `command -v pkg-config > /dev/null && pkg-config --libs libcrypto || printf %s
<FromGitter> ... '-lcrypto'` -lpcre -lgc -lpthread /usr/share/crystal/src/ext/libcrystal.a -levent -lrt -ldl -L/usr/lib -L/usr/local/lib`
<FromGitter> <alex-kampa> Does anyone here have any experience with generating RSA keypairs in crystal?
dragonkh has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
duane has joined #crystal-lang
<ben___> Hmm ... libgmp3-dev?
<FromGitter> <bararchy> `apt-get install libgmp-dev`
<FromGitter> <bararchy> or libgmp3
<FromGitter> <alex-kampa> Hi @bararchy - thanks, istaling libgmp-dev did have an effect of changing the error message, so that was useful!
<FromGitter> <bararchy> lol
<FromGitter> <bararchy> :)
<FromGitter> <bararchy> what do you get now?
<FromGitter> <alex-kampa> alex@ubuntu-2gb-fsn1-1:~/tattle$ crystal src/test.cr ⏎ *main.o: In function `_*crystal_main': ⏎ /usr/share/crystal/src/openssl/lib_ssl.cr:213: undefined reference to `SSL_library_init' ⏎ /usr/share/crystal/src/openssl/lib_ssl.cr:213: undefined reference to `SSL_load_error_strings' ⏎ /usr/share/crystal/src/openssl/lib_ssl.cr:213: undefined reference to `OPENSSL_add_all_algorithms_noconf' ...
<FromGitter> <alex-kampa> (test.cr being just:
<FromGitter> <alex-kampa> require "socket" ⏎ require "openssl" ⏎ require "openssl_ext"
<FromGitter> <bararchy> What's openssl_ext ?
<FromGitter> <bararchy> Also do you have `libssl-dev` installed ?
rohitpaulk has quit [Ping timeout: 248 seconds]
<FromGitter> <alex-kampa> 1) https://github.com/randomstate/openssl_ext 2) yes
<FromGitter> <alex-kampa> also I just made it work on ubuntu pon windows. The errors are from a linux ubuntu machine.
<ben___> Windows WSL?
<FromGitter> <alex-kampa> Issue solved - https://github.com/crystal-lang/crystal/issues/4680 - crystal doesn't work with OpenSSL 1.1.0f (Debian 9)
<FromGitter> <alex-kampa> So needed to do "apt install libssl1.0-dev" (on the ubuntu on winodws i have openssl 1.0.2 that's why it worked...)
<FromGitter> <bararchy> 👍
<FromGitter> <bararchy> So... Shards 0.8 released with `Compatibility with Crystal 0.25.`
<FromGitter> <bararchy> ;)
<ben___> 🎉
pbodev1 has joined #crystal-lang
<FromGitter> <vlazar> 🎉
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
<FromGitter> <schoening> o_o wow.. --release literally gave me 10x performance boost
<ben___> On wich action?
<FromGitter> <schoening> was that to me?
<FromGitter> <bararchy> @schoening I guess so, also interested to know
<FromGitter> <bararchy> :)
<ben___> Yes :)
<FromGitter> <schoening> I used "Time.now - @time" to measure performance of my game loop, which is a while loop with a sleep inside a .. fiber? (I use spawn) I do a whole bunch of circle to circle collision detection in that loop. And it went from 0.1 second to 0.01 second with the --release flag 😄 ⏎ (I set the @time at the beginning of the loop and calculate BEFORE the sleep, before anyone is asking hehe..)
<ben___> Hmm, pretty, EVERY benchmarking only with release flag 😜💫
dragonkh has joined #crystal-lang
bbobb has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 256 seconds]
<FromGitter> <DRVTiny> MessagePack... Anybody knows, can i serialize NamedTuple to msgpack and restore from msgpack - to NamedTuple? ⏎ ⏎ ```Something.from_msgpack( { s: [1,2,3], t: [4,5,6] }.to_msgpack )``` ⏎ ⏎ How?? [https://gitter.im/crystal-lang/crystal?at=5b16bc82b6eece791ddfcd2c]
dragonkh has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<z64> @DRVTiny `NamedTuple(s: Array(Int32), t: Array(Int32)).from_msgpack(bytes)`
<jokke> there's no syntax highlighting for crystal in gitlab? wtf? :(
<jokke> in case you want to migrate from github this might come in handy to batch publish your projects: https://gitlab.com/snippets/1721041
<FromGitter> <DRVTiny> @FromIRC Wow, msgpack added from_msgpack method for all basic data types? I was sure that i must invent my own classes for all from_mgspack conversions!
rohitpaulk has joined #crystal-lang
<FromGitter> <DRVTiny> Thank you! It's a pitty that this simple and very important possibility was not mentioned in msgpack documentation
<z64> it should be implemented for all basic primitives, yeah
rohitpaulk has quit [Ping timeout: 256 seconds]
<z64> no problem
return0e has quit [Read error: Connection reset by peer]
return0e has joined #crystal-lang
bbobb has quit [Ping timeout: 245 seconds]
greengriminal has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 265 seconds]
rohitpaulk has joined #crystal-lang
<crystal-gh> [crystal] splattael opened pull request #6163: Compiler: ensure parentheses inside assign value. Re-open of #5571 (master...pr-5571) https://git.io/vhB9d
dragonkh has joined #crystal-lang
greengriminal has quit [Quit: This computer has gone to sleep]
greengriminal has joined #crystal-lang
<FromGitter> <DRVTiny> I've defined: ⏎ ⏎ ```t={s: [] of Int32}``` ⏎ ⏎ How to assign [1, 2, 3] to t[:s] ? :) [https://gitter.im/crystal-lang/crystal?at=5b16db86160c567d1606c906]
<z64> i believe its because of how a NamedTuple is stored, you can't replace the array it was created with with another one. you could do `foo[:t].replace([1, 2, 3])`
rohitpaulk has quit [Ping timeout: 256 seconds]
<z64> which will copy from another array's internal buffer into the existing one
<z64> (instead of replacing the reference to the array altogether)
<z64> note that this is "slow", and for things like NamedTuple or a struct you ideally want to avoid mutating them and instead instantiate them right away with the values you want
return0e has quit [Read error: Connection reset by peer]
return0e has joined #crystal-lang
<FromGitter> <DRVTiny> @z64 Strange that t[:s] << 15 - works, but t[:s]+=[4,5,6] - doesn't work. Very unpredictable behaviour...
<FromGitter> <DRVTiny> > note that this is "slow" ⏎ Maybe using hash instead of NamedTuple will help me in such situation?
return0e has quit [Read error: Connection reset by peer]
return0e has joined #crystal-lang
<z64> @DRVTiny - yes that works because you're modifying the *existing* array instead of trying to replace the array with a *new* one
<z64> when you write `[] of Int32` and `[1, 2, 3]`, both of these create new arrays
<FromGitter> <DRVTiny> But when i was trying to do t[:s] += ⏎ ⏎ 1) it is also was attempt to copy data from array from the rightmost to array on the leftmost side
<FromGitter> <DRVTiny> i.e. from [4,5,6] to empty t[:s] array
<z64> note that `a += 5` is syntax sugar that actually expands to `a = a + 5`
<FromGitter> <DRVTiny> But for Array it is a concatenation operation
<Yxhuvud> Uhm, no. Why do you think that? It creates a new array.
<z64> @DRVTiny yes its concatenation but as i tried to explain, `+=` expands into *reassignment*, which as you saw earlier, `t[:s] = [1, 2, 3]` does not work (for the reasons i already described)
<z64> i.e. when you write `t[:s] += [1, 2, 3]` this gets rewritten to `t[:s] = t[:s] + [1, 2, 3]`
<FromGitter> <DRVTiny> I think that concatenation is a copying data from one place to another, where new data will be pushed to the "tail"...
<z64> it depends on what it is
Liothen has quit [Changing host]
Liothen has joined #crystal-lang
<FromGitter> <DRVTiny> I.e. i think that arr1+=arr2 is arr2.each { |el| arr1 << el }
<z64> it isn't
<FromGitter> <DRVTiny> I understand, thank you very much!
<FromGitter> <DRVTiny> Concatenation is not so obvious as i think about it :)
<z64> you can go on https://crystal-lang.org/api and look at Array for the `+` method and `View Source`, it might explain more / make it more obvious. and you're welcome
<Yxhuvud> the concat method have that meaning though.
<Yxhuvud> but += aint that
<FromGitter> <DRVTiny> concat ! Yes, i completely forgot it, tank you too - it is exactly what i need
<FromGitter> <DRVTiny> Am i right that t[:s].replace([1,2,3]) is a fully equivalent for t[:s].concat([1,2,3]) ?
<z64> it isn't concatenation, it will overwrite the array's contents
<z64> `t[:s].replace([1])` then `t[:s].replace([2])`, results in `t[:s] #=> [2]`
<z64> `Array(T)#concat(other)` is a different method and does what you think it does, appends the contents of `other`
<FromGitter> <DRVTiny> Ahh, sorry, i mean: for empty arrays it is the same
<z64> yeah, an empty array isn't special in how you work with instances of it
<FromGitter> <DRVTiny> t={s: [] of Int32} ⏎ t[:s].replace([1,2,3]) ⏎ ⏎ #is completely the same as ⏎ ... [https://gitter.im/crystal-lang/crystal?at=5b16e9124eaffb692d844e7e]
GoldenBear has quit [Quit: ZNC 1.6.3+deb1 - http://znc.in]
<z64> well, yes, in this particular example it is the same result
<z64> further calls to #replace or #concat after that of course will be different
<FromGitter> <DRVTiny> Ok, understand
<z64> if you already have `[1, 2, 3]` though you should just instantiate the NamedTuple with it right away, i.e. `t = {s: [1, 2, 3]}`
<z64> instead of modifying it
<FromGitter> <DRVTiny> No, in my case arrays inside the NamedTuple feeds completely with some data from Redis
<FromGitter> <DRVTiny> Initially all that arrays is empty
Liothen has quit [Quit: The Dogmatic Law of Shadowsong]
That_Guy_Anon has joined #crystal-lang
Liothen has joined #crystal-lang
<z64> right. if you can, wait until you have the data from redis before creating it and returning it to the rest of your program. just an optimization
<z64> anyways, i gotta go - good luck! :)
p0p0pr37_ has joined #crystal-lang
p0p0pr37 has quit [Read error: Connection reset by peer]
p0p0pr37_ is now known as p0p0pr37
<FromGitter> <faustinoaq> Would be nice to have colored diffs on `crystal spec` like this: https://github.com/avajs/ava#magic-assert
Liothen has quit [Changing host]
Liothen has joined #crystal-lang
<Yxhuvud> faustinoaq: perhaps if it possible to turn off. I run them from my editor and that buffer handle color codes very well
<ben___> Yes, very nice
duane has quit [Ping timeout: 276 seconds]
akaiiro has joined #crystal-lang
<Yxhuvud> and why do I always end up hacking elisp when I start coding in crystal :/
akaiiro has quit [Quit: The Lounge - https://thelounge.chat]
akaiiro has joined #crystal-lang
akaiiro has quit [Remote host closed the connection]
dragonkh has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
pbodev1 has quit [Quit: ChatZilla 0.9.93 [Firefox 56.0/20170903140023]]
<FromGitter> <bararchy> For the Machine Learning enthuseists, we are adding an experimental feature into SHAInet that would allow the use of Evolution Strategies as an optimizer -> https://github.com/NeuraLegion/shainet/pull/73
That_Guy_Anon has quit [Read error: Connection reset by peer]
<FromGitter> <Willamin> So I know this is a crazy request, but I'm super duper curious if I can do something with the Crystal standard library. I would like to be able to write a macro that takes a block and can utilize the names of the block's arguments. I looked at Crystal::Macros::Block, but it doesn't seem like I can access the block's arguments' names. Anyone here able to point me in the right direction? ⏎ ⏎ Don't worry -
<FromGitter> ... this is just for fun, not a production project 😆
That_Guy_Anon has joined #crystal-lang
greengriminal has quit [Quit: This computer has gone to sleep]
FromGitter has quit [Remote host closed the connection]
oprypin has quit [Quit: Bye]
FromGitter has joined #crystal-lang
oprypin has joined #crystal-lang
<FromGitter> <HCLarsen> Is there a method for iterating over a hash and modifying it's contents? There's #map for arrays, but I don't see an equivalent for hashes.
<ben___> @HCLarsen: k v or both? #each, #each_key, #each_value? Or am i wrong?
<FromGitter> <Willamin> @HCLarsen Hash implements the Enumerable interface, so you should be able to map it
<FromGitter> <HCLarsen> Both.
<FromGitter> <HCLarsen> That's what I thoguht @Willamin, but Hash#map returns an array, not a hash.
<FromGitter> <HCLarsen> Right now I'm looping through the hash with #each and assigning the changed keys and values to another hash.
<FromGitter> <HCLarsen> It works, but I'm curious if there's a simpler way.
<ben___> I do not understand, here you can do it? What exactly should happen?
That_Guy_Anon has quit [Quit: Leaving]
<FromGitter> <Willamin> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b170350160c567d16076dbc]
<FromGitter> <Willamin> That might be *close* to what you want
<FromGitter> <HCLarsen> Close, but no cigar.
<FromGitter> <HCLarsen> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b1703a616f64961240d02f7]
<FromGitter> <HCLarsen> That's what I'm looking for, but in one method that doesn't require me declaring a second hash.
<FromGitter> <Willamin> I think what you've got there is the best you can get
<FromGitter> <HCLarsen> I think you're right, but it never hurts to ask.
<FromGitter> <Willamin> If you'll be using it a lot, you could always reopen the Hash class, add your correct map method, then use that as if it was in the stdlib
<ben___> 👍
<FromGitter> <HCLarsen> Yeah, gotta love extending core classes.
<FromGitter> <HCLarsen> So far, I just need it in one place, but if it keeps coming up, that's exactly what I'll do.
<FromGitter> <Willamin> oh! hey ya go
<FromGitter> <Willamin> take my example from earlier
<FromGitter> <Willamin> and then do
<FromGitter> <Willamin> ```upcased_h.to_h```
<FromGitter> <Willamin> You can call #to_h on an array of two-element tuples to get a hash
<FromGitter> <Willamin> Might be worth opening an issue, I would also expect there to be a Hash#map_to_h method
greengriminal has joined #crystal-lang
akaiiro has joined #crystal-lang
moei has quit [Quit: Leaving...]
greengriminal has quit [Quit: Leaving]
alex`` has quit [Quit: WeeChat 2.1]
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 264 seconds]
Raimondii is now known as Raimondi
<faustinoaq> Hi @/all Have someone used this: https://github.com/ipfs/ipfs with crystal? :)
moei has joined #crystal-lang