qard has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duane has quit [Ping timeout: 256 seconds]
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
<FromGitter>
<jeffutter> I'm pretty new to Crystal. I'm trying to figure out if there is some way to get access to tags when parsing a YAML document, any suggestions?
<FromGitter>
<bew> @straight-shoota do you know if there is a way to use a converter without a YAML (or JSON for that matter) without the mapping macro? like a simple thing like `Array(String).from_yaml ...` but each String obj would be created from a Converter.. Can't seem to find an easy way to do this..
moei has quit [Quit: Leaving...]
bonemind has joined #crystal-lang
flaviodesousa has joined #crystal-lang
<FromGitter>
<straight-shoota> I don't think so
<FromGitter>
<straight-shoota> Converter is only used by mapping macro
alex`` has quit [Quit: WeeChat 2.0.1]
moei has joined #crystal-lang
<f1refly>
Can somebody here give me a hint why my code won't compile? I'm trying to create a singleton-like log class
return0e has quit [Remote host closed the connection]
Papierkorb has joined #crystal-lang
Papierkorb has left #crystal-lang ["Konversation terminated!"]
return0e has joined #crystal-lang
<FromGitter>
<aisrael> @f1refly Because in between `@@obj = Logger.new(STDOUT)` and the `return @@obj` theoretically, another fiber (or thread) could run and set `@@obj` back to `nil`
<FromGitter>
<yxhuvud> Because the compiler isn't smart enough to figure out nothing else is chnaging the @@variable.
return0e has quit [Read error: Connection reset by peer]
<f1refly>
Ah, i didn't think of that. Yes, thats the problem
return0e_ has quit [Ping timeout: 264 seconds]
<f1refly>
I'll try to work around it with a mutex
<FromGitter>
<aisrael> I don't think a mutex is needed. The `||=` should be enough. There may be a corner case where (depending on the generated binary code) another thread can come in between the comparison of `@@obj != nil` and the assignment, but is that really a problem with `Logger`?
return0e has joined #crystal-lang
<f1refly>
No, it isn't for the logger, but i wanted to create a universal singleton class that could potentially run into problems
<FromGitter>
<aisrael> Well, you could use a constant.`LOGGER = Logger.new(STDOUT)` ⏎ But you don't get lazy initialization that way
<f1refly>
It could go really bad though if i were to use the singleton with another class, since it could mean data loss when a new object is created, handed over and then discarded after potential manipulation
<FromGitter>
<bararchy> that's awsome, didn't thought the syntax is ok with that\
<FromGitter>
<bararchy> yap, GG me for not testing first
<FromGitter>
<bararchy> sorry
alex`` has quit [Ping timeout: 264 seconds]
alex`` has joined #crystal-lang
alex`` has quit [Client Quit]
alex`` has joined #crystal-lang
<FromGitter>
<mrfoto> hey - long time hobby crystal user here
<FromGitter>
<mrfoto> got a raspberry pi zero - because why not
<FromGitter>
<mrfoto> I see arm compilation is native in crystal but as far as I can tell it's still very hard/impossible to get crystal running on raspberry pi
<FromGitter>
<mrfoto> the semi-official repo (portalier) is a couple of versions behind
<RX14>
oh, thats unfortunate
<FromGitter>
<mrfoto> and built against the old raspbian - jessie, not the current one - stretch
<RX14>
hmm
<FromGitter>
<mrfoto> so I'm a high level dev (coming from Ruby) so all this llvm stuff is way over my head :D but I am wondering if it would be possible to build binaries for arm processors with every release
<RX14>
maybe we should have raspbian packages as part of the official release
<RX14>
since it comes up quite often...
<FromGitter>
<mrfoto> well that would be AWESOME :D
<RX14>
@mrfoto it's actually not that hard to cross-compile
<RX14>
well... if you can get the LLVM versions to sync up
<FromGitter>
<mrfoto> but yeah, LLVM versions and all that `cc` thingy - I gave up :D
<FromGitter>
<mrfoto> the whole reason why I think it would be good to have them as a part of official release is ⏎ a) yeah, it comes up often - I saw similar topics all over the place ⏎ b) crystal is much more resource efficient than ruby so it's perfect for a resource constrained env like rpi, especially the zero one
<RX14>
hmm
<RX14>
that'd actually be quite hard
<FromGitter>
<mrfoto> ah, ok - like I said this is all way over my head :P maybe we just need to ping whoever is maintaining portalier to do a better job or provide some sort of instructions to get recent versions
<FromGitter>
<straight-shoota> automatic build would require a arm CI runner
<FromGitter>
<j8r> we can use a qemu-static-arm to run arm code on ARM Docker image on x86_64
benharri has joined #crystal-lang
<FromGitter>
<straight-shoota> yeah but emulated is not the real arch
<RX14>
it's more than good enough
<RX14>
although it'll take aaages to compile
<FromGitter>
<straight-shoota> yes, it's better than nothing and should suffice to provide packages
<FromGitter>
<straight-shoota> with the right setup it could even cross-compile from x64 and only link on qemu-arm
<FromGitter>
<mrfoto> well it would take aaaages to compile on rpi 0 as well :D
<RX14>
less time than emulated
<FromGitter>
<mrfoto> really? emulation shouldn't be held back by the CPU power - while rpi 0 has armv6 @ 700mhz :D
<RX14>
uhh
<RX14>
emulation is super slow
<RX14>
like really really slow
<FromGitter>
<straight-shoota> qemu emulates the entire arm cpu
<FromGitter>
<j8r> Yes, python and php needs 30minutes at least
<FromGitter>
<straight-shoota> there is no hardware acceleration
<FromGitter>
<mrfoto> well than how about getting some rpis and build on them? we can raise funds :P
<FromGitter>
<j8r> scaleway's one are good, but then a rework of the CI will be needed :-/
<RX14>
even if we had raspis we'd probably not use them
<RX14>
since the CI currently runs on circleci
<RX14>
and so you can't just plug whatever machine in
<FromGitter>
<j8r> I've searched if Circle CI supports ARM - nothing found
<RX14>
no it doesn't
<FromGitter>
<j8r> One time builds with qemu is good enough - better than nothing
<RX14>
and even then it'd likely be later armv8 instead of arnv7/6
<RX14>
or whatever raspbian compiles for these days
<FromGitter>
<mrfoto> well it doesn't have to be official official. If there's a set of instructions provided one can run binaries can be made available once the release is out - independent of the official CI
<RX14>
yeah
<FromGitter>
<j8r> aarch64 is backward compatible - nothing to worry :-)
<FromGitter>
<straight-shoota> so it's an easy working solution right now
<RX14>
yes
<RX14>
wuehlmaus, you're using llvm6
<wuehlmaus>
that's the problem?
<RX14>
yep
<wuehlmaus>
oh
<FromGitter>
<straight-shoota> circleci 2.0 was really a huge improvement
<RX14>
i'm not 100% on how homebrew works
<wuehlmaus>
i think i just used brew and upgraded
<RX14>
but you might need to link? the old llvm@5 package
<RX14>
homebrew is weird
qard has joined #crystal-lang
<RX14>
everyone should just use linux :)
<FromGitter>
<mrfoto> brew install crystal-lang will require llvm@5 and it'll work just fine
<FromGitter>
<mrfoto> I fresh installed it this morning :P
<RX14>
we really need a proper "nightly release download page"
<FromGitter>
<mrfoto> anyway, I don't think rpi build needs to be a part of CI run - it can be a separate thingy like this portalier was. as long as it's updated regularly or there is some sort of automation that does it
<RX14>
instead of the nightly release artifacts being cooped up on circleci
<wuehlmaus>
i have llvm5 installed , how can i switch the make process to use it instead of 6.0 ?
<RX14>
do you have llvm-config-5?
<wuehlmaus>
it doesn't complete llvm-config-5
<wuehlmaus>
but brew says i have llvm5
<wuehlmaus>
ah, i think it is one correction in the PATH
<wuehlmaus>
ah, that was it
<wuehlmaus>
and brew told me
<wuehlmaus>
i just neclected to read it :)
<wuehlmaus>
neglected
<RX14>
ok
<wuehlmaus>
bam, it worked :)
<RX14>
make crystal LLVM_CONFIG=llvm-config-5
<RX14>
and you should be done
<RX14>
idh
<RX14>
ish
<wuehlmaus>
environment variables are cool :)
<FromGitter>
<mrfoto> @RX14 0.23.1-1 so yeah a year, not 2 years. still not quite fresh :P
benharri has quit [Quit: benharri]
Disrecollection has quit [Quit: Leaving.]
benharri has joined #crystal-lang
<FromGitter>
<straight-shoota> yeah but 0.24.1 released less than 3 months ago, until then 0.23.1 was the most recent release
bonemind has quit [Quit: WeeChat 2.0.1]
<benharri>
how's it going :)
<FromGitter>
<j8r> Other topic, how create an `alias` for named tuple?
<FromGitter>
<bararchy> in HTTP::Context.body, what is the way I can read it all? just handle as standard IO? is it Memory::IO ? the type is IO+ w\e that means
<benharri>
straight-shoota: did you run in to this at all?
Groogy has joined #crystal-lang
shalmezad has quit [Quit: This computer has gone to sleep]
rohitpaulk has joined #crystal-lang
qard has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
qard has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 246 seconds]
qard has quit [Client Quit]
qard has joined #crystal-lang
p0p0pr37 has joined #crystal-lang
mangoicedtea has joined #crystal-lang
azur_kind has quit [Remote host closed the connection]
shalmezad has joined #crystal-lang
shalmezad has quit [Remote host closed the connection]
mangoicedtea has quit [Ping timeout: 245 seconds]
alex`` has quit [Quit: WeeChat 2.0.1]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
<Groogy>
Am I blind but I can't find a pow function or anything :/
<Groogy>
nvm I was blind and found it
duane has quit [Ping timeout: 265 seconds]
duane has joined #crystal-lang
<Yxhuvud>
groogy! long time not being here!
qard has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
qard has joined #crystal-lang
<FromGitter>
<straight-shoota> benharri, I'm not sure about the initial problem with crystal, but the valgrind report looks like https://github.com/Microsoft/WSL/issues/120
<FromGitter>
<straight-shoota> what windows build are you using?