<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
<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
<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?
<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?
<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?
<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]
<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…]
<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]
<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
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> 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