ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.31.0 | 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
duane has quit [Ping timeout: 276 seconds]
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 252 seconds]
chemist69 has quit [Ping timeout: 276 seconds]
chemist69 has joined #crystal-lang
rohitpaulk has joined #crystal-lang
_whitelogger has joined #crystal-lang
ht_ has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 268 seconds]
rohitpaulk has joined #crystal-lang
early has quit [Quit: Leaving]
early` has joined #crystal-lang
ht_ has quit [Remote host closed the connection]
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 276 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 265 seconds]
rohitpaulk has joined #crystal-lang
sorcus has quit [Ping timeout: 246 seconds]
rohitpaulk has quit [Ping timeout: 246 seconds]
rohitpaulk has joined #crystal-lang
go|dfish has joined #crystal-lang
fyber has quit [Read error: Connection reset by peer]
rohitpaulk has quit [Ping timeout: 268 seconds]
rohitpaulk has joined #crystal-lang
f1reflyylmao has quit [Ping timeout: 276 seconds]
urist__ has joined #crystal-lang
urist__ has quit [Quit: WeeChat 1.9.1]
urist__ has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
Flipez has quit [Read error: Connection reset by peer]
Flipez5 has joined #crystal-lang
Flipez5 is now known as Flipez
Flipez has quit [Client Quit]
Flipez has joined #crystal-lang
<FromGitter> <j8r> @TheM3tabaron on my x86-64 PC. I haven't tested the gist for a while, t
<FromGitter> <j8r> You can also look at https://github.com/j8r/dockerfiles/tree/master/crystal-alpine to have up-to-date Alpine dependencies
rohitpaulk has quit [Ping timeout: 276 seconds]
rohitpaulk has joined #crystal-lang
urist__ has quit [Quit: WeeChat 1.9.1]
rohitpaulk has quit [Ping timeout: 268 seconds]
maxpowa has quit [Ping timeout: 245 seconds]
sagax has quit [Remote host closed the connection]
maxpowa has joined #crystal-lang
<FromGitter> <j8r> why `Base64.encode` creates new lines?!
<FromGitter> <j8r> It's RFC compliant, but a but annoying
<FromGitter> <j8r> ok there is `strict_encode`
<FromGitter> <j8r> I submit a patch for this, the base64 digest of SH512 was multilined
alex`` has joined #crystal-lang
mps has joined #crystal-lang
hightower2 has joined #crystal-lang
<mps> crystal 0.31.0 still fails build with llvm8 on aarch64 in alpine linux
<Stephie> what was the error?
<Stephie> aarch64 has always been a bit broken :/
<mps> like with 0.30.{0,1}, don't have log handy right now
<mps> I'm building it with llvm5 again
<Stephie> mmmh
<Stephie> if it's llvm version dependent i blame llvm :P
<Stephie> i'd need a log...
<Stephie> guess i should set up an aarch64 alpine quemu
<mps> you will need a lot of RAM for qemu to build it
<Stephie> why?
<mps> llvm requires it
<Stephie> oh, well i can grab llvm from the repos...
<mps> ime, 8GB
<Stephie> thats not that much
<mps> though swap can help also
<Stephie> the linking is what ruins the LLVM build
<mps> yes
<Stephie> you have to limit the parallelism of linking jobs
<Stephie> to, 1
<Stephie> there's a cmake arg for it
<Stephie> -DLLVM_PARALLEL_LINK_JOBS=1
<mps> well, for me it is not issue, I have a loooot of RAM
<FromGitter> <stronny> does anyone have an opinion on ponylang? https://www.ponylang.io/discover/
Human_G33k has quit [Remote host closed the connection]
<FromGitter> <j8r> mps: @asterite has reported a bug to LLVM, we have to check if the fix is on the version shipped on Alpine
Human_G33k has joined #crystal-lang
Human_G33k has quit [Remote host closed the connection]
Human_G33k has joined #crystal-lang
<Stephie> @j8r nah
<Stephie> that was worked around iirc
<Stephie> yeah, it was
<Stephie> the latest release will not hot that llvm bug
Human_G33k has quit [Remote host closed the connection]
Human_G33k has joined #crystal-lang
hypercore has quit [Ping timeout: 260 seconds]
Human_G33k has quit [Remote host closed the connection]
<mps> j8r: I remember this, but still no luck
<Stephie> i can't find you postying logs in the irc log
<Stephie> so, i'd need those again
<mps> Stephie: you ask j8r or me
<Stephie> you
<Stephie> for, what actually failed
<mps> you mean build log?
<Stephie> yes
<mps> ok, I will start again with llvm8 when finish with llvm5 build
<mps> and, then I post build log
<mps> I will*
<Stephie> ideally you should have kept those around >_<
<mps> I have one of previous
<Stephie> yeah that's good
<Stephie> yeah thats an LLVM bug
<Stephie> do you build LLVM with -DENABLE_ASSERTIONS=ON?
<Stephie> well, -DLLVM_ENABLE_ASSERTIONS=ON
<mps> here is Makefile.local http://tpaste.us/1nr0
<mps> and here is previous (0.30.1) APKBUILD and patches https://gitlab.alpinelinux.org/alpine/aports/tree/master/community/crystal
<FromGitter> <j8r> looks like the previous bug I had
<FromGitter> <j8r> I had ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d89fc65a7a5cc47334956dc]
<mps> but, llvm8 (8.0.1) builds correctly on aarch64
<mps> and I build some big programs with llvm8 on aarch64, all works fine afaik
<mps> rust works
sagax has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 245 seconds]
rohitpaulk has joined #crystal-lang
hypercore has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 265 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <kingsleyh> hello - any suggestion for an easy way to have a conditional JSON - so in some cases have all the fields and in another case have a subset of the fields
<FromGitter> <kingsleyh> guess you can't have two JSON.mappings
<FromGitter> <kingsleyh> guess I will just create a json builder
<FromGitter> <j8r> You could use a custom converter
<FromGitter> <kingsleyh> something I write or is that a thing?
<Stephie> mps, LLVM is a big program, different compilers emit very different IR
<Stephie> it's likely crystal is just hitting a bug that rust and clang will never hit
<FromGitter> <j8r> @kingsleyh yes it is a thing
<FromGitter> <bew> @kingsleyh @Blacksmoke16 is working on its CrSerializer shards which can easily do that!
<mps> Stephie: yes, and I started to dislike llvm some time ago. but have to deal with it from time to time :\
<Stephie> well, yeah it's not *great*
<Stephie> but it is all crystal has, really
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 245 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <kingsleyh> what is the way to get a String time from an integer time?
<FromGitter> <kingsleyh> in ruby its Time.at but don't have one in Crystal
<FromGitter> <Blacksmoke16> the shard itself is going thru a refactor atm tho, but that would be what you would want i think
<FromGitter> <kingsleyh> @Blacksmoke16 cool thanks :)
<FromGitter> <Blacksmoke16> also, got an example of what you mean by string time from integer time?
<FromGitter> <Blacksmoke16> like from a unix timestamp?
<FromGitter> <kingsleyh> ah it's `Time.unix`
<FromGitter> <kingsleyh> takes an int and gives a Time back
<FromGitter> <kingsleyh> hmm
<FromGitter> <kingsleyh> how do you get a Time back from: `Time.utc_now.to_unix_ms`
<FromGitter> <kingsleyh> that gives an Int64
<FromGitter> <kingsleyh> but Time.unix doesn't like that
<FromGitter> <kingsleyh> ah Time.unix_ms
<FromGitter> <Blacksmoke16> whats the point of doing that tho?
<FromGitter> <Blacksmoke16> i.e. why do you need to go from a time instance, to unix timestamp, back to time instance?
rohitpaulk has quit [Ping timeout: 245 seconds]
rohitpaulk has joined #crystal-lang
duane has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
hypercore has quit [Remote host closed the connection]
hypercore has joined #crystal-lang
<FromGitter> <bew> @Blacksmoke16 (de)serialization maybe?
<FromGitter> <Blacksmoke16> :shrug:
<FromGitter> <bew> like saving a time instance to disk or sth
pdkl has joined #crystal-lang
<pdkl> looking for material / blogs on luckyframework
rohitpaulk has quit [Ping timeout: 265 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <bew> pdkl: the main website of the framework has lengthy guides on it iirc
<FromGitter> <kinxer> Anyone else having issues compiling `Channel` on 0.31.0?
<FromGitter> <stronny> two thread on forum already
<FromGitter> <kinxer> Thanks. I'll look there.
<FromGitter> <kinxer> Actually, my compilation issue has nothing to do with `Channel#full?` or `Channel#empty?.
<FromGitter> <stronny> what's the issue?
rohitpaulk has quit [Ping timeout: 276 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <kinxer> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d8a357dc7ec2e2208e40542]
<FromGitter> <kinxer> I'm on OpenSUSE using the RPM distribution.
<FromGitter> <kinxer> It's in one of the (in-house) dependencies I'm using, so I'm trying to find what's causing it so that I can create a code sample.
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter> <bew> @kinxer there is an open issue about it https://github.com/crystal-lang/crystal/issues/8216
<FromGitter> <kinxer> Thanks, @bew.
ht_ has joined #crystal-lang
return0e_ has quit [Read error: Connection reset by peer]
return0e has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
pdkl has quit [Remote host closed the connection]
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
HumanG33k has joined #crystal-lang
HumanG33k has quit [Remote host closed the connection]
HumanG33k has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 268 seconds]
rohitpaulk has joined #crystal-lang
HumanG33k has quit [Ping timeout: 245 seconds]
HumanG33k has joined #crystal-lang
sorcus has joined #crystal-lang
hypercore has quit [Ping timeout: 260 seconds]
rohitpaulk has quit [Ping timeout: 265 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <c-cube> @j8r I have a better implem for semaphores, I think
<FromGitter> <c-cube> interestingly, a semaphore is just a more space-efficient version of a `Channel(Nil, n)`
hightower2 has quit [Ping timeout: 268 seconds]
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
dannyAAM has joined #crystal-lang
rohitpaulk has quit [Read error: Connection reset by peer]
<FromGitter> <Blacksmoke16> should crystal be using llvm 9 on mac?
<FromGitter> <Blacksmoke16> nvm, looks like the llvm formula was updated to 9 a little while ago as well
<FromGitter> <Blacksmoke16> just an FYI
hypercore has joined #crystal-lang
gangstacat has quit [Quit: Ĝis!]
<FromGitter> <c-cube> is it common to use pointers explicitly @kinxer ?
<oprypin> c-cube, wait what, are you about to finally teach me what a semaphore means, after all these years
ht_ has quit [Remote host closed the connection]
<FromGitter> <c-cube> it's really just a lock that `n` threads can acquire at the same time ^^
<FromGitter> <kinxer> @c-cube That debug message is from within the implementation of `Channel`, not my code. I'll admit I don't (get to) program in Crystal that much day-to-day, but I've not yet had a need to use `Pointer`.
<FromGitter> <c-cube> oh I see, indeed it's weird to see the internals leak into a user-facing error message
<FromGitter> <c-cube> I thought you were trying to send that tuple into the channel
<FromGitter> <kinxer> Nope. It's a channel of `Network::Message`.
<FromGitter> <skota> Hi all, from a directory i want to get a list of subdirs excluding hidden folders (., .., .foo etc). From the docs i found i can Dir.each to get a list of subdirs/files, not sure how to filter for hidden folder? I just started learning crystal and i really like it so far
<FromGitter> <bew> `Dir.each_child` iirc
<FromGitter> <bew> ah hidden folders as well
<hypercore> is lucky used by anyone in production?
<FromGitter> <skota> aah ok...thanks @bew, i will checkout the docs
<hypercore> its seems pretty nice
<FromGitter> <Blacksmoke16> @skota cant you just do like `Dir.glob("*", match_hidden: true)`
<FromGitter> <Blacksmoke16> something like that
<FromGitter> <Blacksmoke16> https://crystal-lang.org/api/master/Dir.html#glob(patterns:Enumerable(String),match_hidden=false):Array(String)-class-method
<FromGitter> <skota> @Blacksmoke16 thanks, i will take a look at dir.glob too. Still finding my way around the docs :-)
<FromGitter> <bew> Or `Dir.children.reject!(&.starts_with?('.'))` or something like that
<FromGitter> <skota> @bew, that worked. Thanks much.
<FromGitter> <Blacksmoke16> `Dir.glob("*")` does the same thing
<FromGitter> <Blacksmoke16> since `match_hidden` is false by default
<FromGitter> <skota> yep this works as well..thanks @Blacksmoke16 . BTW are there any links to resources that talk about idiomatic crystal if any?
<FromGitter> <Blacksmoke16> https://github.com/icyleaf/fast-crystal is only one i know of
<FromGitter> <skota> thanks
<FromGitter> <skota> bookmarked
<FromGitter> <Blacksmoke16> other than that the git book and api docs are the way to go
<FromGitter> <Blacksmoke16> asking here or the forums if you have any questions still
<FromGitter> <skota> will do. thx
<FromGitter> <j8r> we need help to add more benchmarks
<FromGitter> <j8r> but this isn't really about idiomatic code, but performance
<FromGitter> <kinxer> @j8r Why is https://github.com/language-benchmarks/reports empty?
<FromGitter> <j8r> @kinxer because I haven't got the time to do the automation stuff
<FromGitter> <kinxer> How do you intend for it to work once you get it up and running?
<FromGitter> <j8r> 1) More benchmarks ⏎ 2) Put json reports in this repo ⏎ 3) Generate .md with https://github.com/j8r/dockerfiles/blob/master/gh-pages-ci/upload-docs.sh
<FromGitter> <kinxer> It says something about other people publishing reports. How would that work and what would be the benefit?
<FromGitter> <j8r> the CI will generate it report, but other people can publish theirs too
<FromGitter> <j8r> We will have various results from various systems, OS
<FromGitter> <j8r> having JSON format will open the way for broader statistics, too
dostoyevsky has quit [Quit: leaving]
dostoyevsky has joined #crystal-lang
<FromGitter> <j8r> https://github.com/icyleaf/fast-crystal and https://github.com/konung/fast-crystal will be merged to https://github.com/language-benchmarks/fast-crystal. ⏎ Their authors are in thee organization.
<FromGitter> <j8r> Please be free to contribute :)
<FromGitter> <kinxer> Sounds cool. :)
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 245 seconds]
Raimondii is now known as Raimondi
Raimondi has quit [Quit: WeeChat 2.5: ¡Chau!]
<FromGitter> <c-cube> apparently, an experiment that will disappear
Raimondi has joined #crystal-lang
<FromGitter> <j8r> yo may be right, it is not documented at all
hypercore has quit [Ping timeout: 260 seconds]
<FromGitter> <c-cube> although I do think there should be more concurrency helpers
<FromGitter> <c-cube> typically, a kind of local pool from which you'd `spawn` tasks, and then be able to wait for all of them to complete
duane has quit [Ping timeout: 268 seconds]
hypercore has joined #crystal-lang
<FromGitter> <Blacksmoke16> benchmarked my deserialization method vs serializable, is 10x slower 😬
<FromGitter> <bew> but 10x cooler 😇
<FromGitter> <Blacksmoke16> <3
<FromGitter> <bew> how many more alloc?
<FromGitter> <Blacksmoke16> in reality prob is fast enough? 130k/sec
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d8aa620be709e39d188e832]
<FromGitter> <bew> both are fastest.... interesting 😂
<FromGitter> <bew> just kidding'
<FromGitter> <Blacksmoke16> 😉
<FromGitter> <bew> do you know what is slow? (x2 in memory use giving x10 in time looks odd, no?)
<FromGitter> <Blacksmoke16> not sure yet, been working on getting it working first
<FromGitter> <bew> or maybe it's just because there's more logic
<FromGitter> <Blacksmoke16> if i had to guess is a lot more type casting going on, because of the `JSON::Any`
<FromGitter> <Blacksmoke16> plus the loading of the full JSON doc into memory, since its not using pull parser directly
<FromGitter> <Blacksmoke16> oh wait wtf
<FromGitter> <Blacksmoke16> `CrSerializer 1.18M (846.98ns) (± 1.67%) 1.28kB/op fastest`
<FromGitter> <Blacksmoke16> oh interesting
<FromGitter> <bew> ?
<FromGitter> <Blacksmoke16> unions
<FromGitter> <Blacksmoke16> `String?` trying to deserialize unions is *much* slower
<FromGitter> <Blacksmoke16> so theres something that can be optimized
sorcus has quit [Ping timeout: 276 seconds]
<FromGitter> <Blacksmoke16> look like `is_a?` calls arent super performant
<FromGitter> <Blacksmoke16> and by exception `as?`
<FromGitter> <Blacksmoke16> extension*
<FromGitter> <bew> might be hard to fix...
<FromGitter> <Blacksmoke16> yea..
<FromGitter> <Blacksmoke16> oh well, worry about it later