ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.21.1 | Fund Crystal's development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Raimondi has quit [Quit: WeeChat 1.6-dev]
<crystal-gh> [crystal] Sija opened pull request #4178: Implement generic Struct#clone (master...add-default-struct-clone) https://git.io/vSejo
<FromGitter> <bew> @RX14 why your example https://carc.in/#/r/1qq8 should give a compile error ?
<FromGitter> <faustinoaq> Is planed to support DL in Crystal? https://gitter.im/crystal-lang/crystal?at=58d25c15a84f611959cf74ee
Raimondi has joined #crystal-lang
<crystal-gh> [crystal] Sija opened pull request #4179: Fix broken repo detection in docs (by yours truly) (master...followup-to-pr-4132) https://git.io/vSvfH
fenicks has left #crystal-lang [#crystal-lang]
<FromGitter> <Zhomart> Hi, is it possible to check method signature using `responds_to?`, e.g. `MyClass.responds_to?(:read, Int32)`?
<FromGitter> <Sija> nope, u can do `obj.responds_to?(:read) && (v = obj.read).is_a?(Int32)` though
<FromGitter> <Zhomart> Omg finally fixed it. I was writing `def read(t : Int32.class | Nil.class) : Int32 | Nil`. ⏎ But correct version is `def read(t : Union(Int32 | Nil).class) : Int32 | Nil` :shipit:
<FromGitter> <Sija> or `Int32?.class` :)
<FromGitter> <Zhomart> Oh, I've several times seen people writing `::Union(Int32 | Nil)` instead of `Int32?`. I was thinking may be that is standard way of doing it..
<FromGitter> <Sija> nope, it’s just longer
shadowshell has quit [Quit: Connection closed for inactivity]
<FromGitter> <sevk> A fork/exec replacement for FFI-capable implementations https://github.com/evilrich/spoon
literal_ has joined #crystal-lang
asterite_ has joined #crystal-lang
shelvac2 has joined #crystal-lang
leafybas- has joined #crystal-lang
vifino- has joined #crystal-lang
fedruantine has joined #crystal-lang
leafybasi has quit [Ping timeout: 240 seconds]
asterite has quit [Ping timeout: 240 seconds]
shelvacu has quit [Ping timeout: 240 seconds]
fedruantine_ has quit [Ping timeout: 240 seconds]
vifino has quit [Ping timeout: 240 seconds]
literal has quit [Ping timeout: 240 seconds]
asterite_ is now known as asterite
shelvac2 has quit [Client Quit]
shelvacu has joined #crystal-lang
akwiatkowski has joined #crystal-lang
bjz has joined #crystal-lang
akwiatkowski has quit [Ping timeout: 260 seconds]
<FromGitter> <KCreate> Hey @faustinoaq! Great work! I'm really interested in loading dynamic libraries via crystal as well so I really appreciate your effort on that
akwiatkowski has joined #crystal-lang
Qchmqs has joined #crystal-lang
mark_66 has joined #crystal-lang
<FromGitter> <bew> @sevk this is ruby code, you don't need a library to do ffi in Crystal, it's already in the language:
<FromGitter> <faustinoaq> @KCreate Thanks! :smile:
<FromGitter> <sevk> @bew thanks :)
<FromGitter> <huacnlee> Cross Compile is hard way - for macOS
<FromGitter> <huacnlee> dyld: Library not loaded: /usr/local/opt/bdw-gc/lib/libgc.1.dylib
snapcase has joined #crystal-lang
<txdv> https://andrewzah.com/posts/moving-from-ruby-&-rails-to-crystal-&-kemalyst
<FromGitter> <ysbaddaden> the OSX Sierra build on Travis is broken. it fails to download a built llvm, tries to compile by hand... which timeouts.
<FromGitter> <crisward> <txdv> This seems to work https://andrewzah.com/posts/-moving-from-ruby-&-rails-to-crystal-&-kemalyst- your link missed a dash off the end
<crystal-gh> [crystal] ysbaddaden pushed 1 new commit to master: https://git.io/vSvo9
<crystal-gh> crystal/master 874eb8b Julien Portalier: Fix: select generic ARM/AArch64 LibC (#4167)...
<crystal-gh> [crystal] ysbaddaden closed pull request #4167: Fix: select generic ARM C bindings when target triple is armv6, armv7l, ... (master...fix-arm-target-triple) https://git.io/vyFBY
<txdv> damn it
<txdv> i already wrote hi an email on why shit is not working
<txdv> i just clicked on the link tha appeared in google
<txdv> turns out google is missing a dash!
<FromGitter> <crisward> <txdv> Shove a redirect in there and problem solved.
<FromGitter> <crisward> Nice article BTW, not looked at kemalyst, like to roll my own stuff too much. Interesting to see how they've solved similar problems though.
<txdv> are you blazin your own rolled stuff?
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 240 seconds]
<FromGitter> <sdogruyol> @crisward thanks for the article just seen it
<FromGitter> <sdogruyol> where did you see the article
<travis-ci> crystal-lang/crystal#874eb8b (master - Fix: select generic ARM/AArch64 LibC (#4167)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/214179230
<DeBot> https://github.com/crystal-lang/crystal/pull/4167 (Fix: select generic ARM C bindings when target triple is armv6, armv7l, ...)
<txdv> 1is there a way to access posted variables in kemal?
bjz_ has quit [Ping timeout: 264 seconds]
bjz has joined #crystal-lang
Qchmqs has quit [Read error: Connection reset by peer]
<FromGitter> <crisward> @sdogruyol <txdv> posted it here, I just corrected the link...
literal_ is now known as literal
<FromGitter> <sdogruyol> ah cool
<FromGitter> <sdogruyol> curious about the source of the link though
<FromGitter> <sdogruyol> havent seen it anywhere around
p0p0pr37 has quit [Quit: Going offline, see ya! (www.adiirc.com)]
p0p0pr37 has joined #crystal-lang
Qchmqs has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
<RX14> done loads more work on the progress tracker, I think it's pretty much done!
<RX14> it works really nice with --stats
Qchmqs has quit [Remote host closed the connection]
Qchmqs has joined #crystal-lang
<FromGitter> <sdogruyol> @RX14 congrats
<RX14> @sdogruyol please check it out: https://github.com/RX14/crystal/tree/feature/progress
<FromGitter> <RX14> I need to make specs not show the progress though, spec output on that branch is broken.
<FromGitter> <codingphasedotcom> Hey @sdogruyol
<FromGitter> <sdogruyol> hey there
Qchmqs has quit [Remote host closed the connection]
blufor has quit [Ping timeout: 260 seconds]
blufor has joined #crystal-lang
Qchmqs has joined #crystal-lang
akwiatkowski has quit [Ping timeout: 240 seconds]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vSfqo
<crystal-gh> crystal/master 83f9aec Ary Borenszweig: Fixed #4155: parser bug with `/` after call with parentheses
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<travis-ci> crystal-lang/crystal#83f9aec (master - Fixed #4155: parser bug with `/` after call with parentheses): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/214275784
Qchmqs has quit [Remote host closed the connection]
mark_66 has quit [Remote host closed the connection]
<FromGitter> <exts> Looking for some feedback, wrote a cli to update my phpstorm for linux https://github.com/exts/Upstorm
<FromGitter> <dreyks> @exts why do you write such expanded if/else statements?
<FromGitter> <dreyks> i mean in Downloader#quit
<FromGitter> <dreyks> and accept
<FromGitter> <dreyks> why not `str == "q" || str == "quit"`
<FromGitter> <exts> let me check
<FromGitter> <exts> no clue, just woke up when i rewrote it
<FromGitter> <exts> brain has a mind of its own sometimes i guess
<FromGitter> <dreyks> :) that happens sometimes
<RX14> Finally!
<Papierkorb> exts, uppercase file names are uncommon
<FromGitter> <sdogruyol> @RX14 sup
<RX14> This guy finally worked out why 100k fibers doesn't work on linux: http://stackoverflow.com/a/42977927/2035962
<RX14> `sudo sysctl -w vm.max_map_count=1000000`
<RX14> and now i get: https://aww.moe/j50ne7.png
<FromGitter> <sdogruyol> ah yeah
<Papierkorb> exts, your #system() calls don't do error checking
<RX14> nice
<RX14> 7.6TiB of virtual memory allocated
<RX14> 1 million fibers
<Papierkorb> That sysctl call including reasoning/description on why should be in the docs
<FromGitter> <sdogruyol> @RX14 any blog post soon
<RX14> hmm?
<FromGitter> <sdogruyol> i meant you're testing the limits, right
<FromGitter> <sdogruyol> it'd be good to have a blog post for that :P
<RX14> 2 million fibers softlocked my computer for a minute
<RX14> wow
<FromGitter> <sdogruyol> haha
<FromGitter> <sdogruyol> that's cool
<RX14> i need more ram...
<FromGitter> <exts> @FromIRC thanks, ill sort that
<RX14> holy moly, 4gb of page tables
akwiatkowski has joined #crystal-lang
<FromGitter> <exts> derp
<FromGitter> <sdogruyol> hugeee
<FromGitter> <sdogruyol> is it even responsive?
<RX14> it seems that with just spawn { sleep } as much memory is used by the kernel as in the process
<RX14> i.e. 4kb of kmem and 4kb of process reserved per fiber
<RX14> which kind of makes sense
<RX14> it's responsive until you run out of ram @sdogruyol
<RX14> thats what the softlock was
<FromGitter> <sdogruyol> yeah
<FromGitter> <sdogruyol> i'm curious how Go handles these kinda stuff
<FromGitter> <sdogruyol> do they dynamically reserve e.g
<RX14> i assume that they don't issue one mmap syscall per goroutine
<RX14> it seems the overhead per fiber is currently 8KiB
<FromGitter> <sdogruyol> i'm also curious about their scheduler too
<FromGitter> <sdogruyol> they've written everything from scratch
<FromGitter> <sdogruyol> :/
<crystal-gh> [crystal] bcardiff closed pull request #4179: Fix broken repo detection in docs (by yours truly) (master...followup-to-pr-4132) https://git.io/vSvfH
<Yxhuvud> well that makes a lot of sense. syscalls are often quite expensive.
carson has joined #crystal-lang
<Yxhuvud> By the way, didn't llvm 4.0 introduce some primitives for fibers?
<Yxhuvud> maybe those could be used.
<FromGitter> <sdogruyol> @yxhuvud they're still experimental-ish
<crystal-gh> [crystal] bcardiff closed pull request #4178: Implement generic Struct#clone (master...add-default-struct-clone) https://git.io/vSejo
<RX14> my PC locked permenantly this time...
<RX14> well it seems possible at least
<RX14> it contains description of go's goroutine memory model
<RX14> and other interesting stuff too
<FromGitter> <sdogruyol> thanks
<FromGitter> <jwoertink> Has anyone had any issues with speed using `HTTP::Client.post`?
<FromGitter> <jwoertink> I need to do some more benchmarking, but I have this ruby api that's running way faster than my crystal one (in release mode), but I'm not sure why just yet
<crystal-gh> [crystal] bcardiff pushed 1 new commit to master: https://git.io/vSJUb
<crystal-gh> crystal/master 3f183a6 Brian J. Cardiff: Fix crystal_repo matching...
<FromGitter> <sdogruyol> uhm
<FromGitter> <sdogruyol> @jwoertink are you using a single `HTTP::Client`
<RX14> it looks like large-n fibers works, it's just 4x less memory efficient compared to go
<FromGitter> <sdogruyol> ugh
<FromGitter> <sdogruyol> back in the days when i was developing https://github.com/sdogruyol/cryload i had a similar problem
<FromGitter> <sdogruyol> @jwoertink solved that by using a singleton
<travis-ci> crystal-lang/crystal#5e6490e (master - Fix wrong assumption about line end (#4179)): The build has errored. https://travis-ci.org/crystal-lang/crystal/builds/214377622
<DeBot> https://github.com/crystal-lang/crystal/pull/4179 (Fix broken repo detection in docs (by yours truly))
carson has quit [Remote host closed the connection]
<FromGitter> <jwoertink> I call `HTTP::Client.post` on every request
<FromGitter> <jwoertink> My crystal version takes about 500ms per request, and the ruby one is about 100ms per request
<FromGitter> <sdogruyol> i'm not sure but is there change that you spawn a `HTTP::Client` for each request by doing so
<FromGitter> <jwoertink> however, the crystal one does go through kemal, and the ruby one goes through rails.
<FromGitter> <jwoertink> I don't instantiate any new HTTP::Client. I'm not doing the `HTTP::Client.new().post`style.
<FromGitter> <jwoertink> unless it does it internally (which is might)
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vSJIY
<crystal-gh> crystal/master 2744067 Ary Borenszweig: Fixed #4145: Formatter: Crash when double splats has restrictions in some cases
<FromGitter> <jwoertink> I'll see if I can make a mini sample app for benchmarking. Hopefully it's something weird I'm doing and can be easily fixed
<FromGitter> <mverzilli> did you try using an IP address instead of a URL? If I recall correctly, we've got some serious issues with DNS
<FromGitter> <mverzilli> (not to say we shouldn't mind that, just to help narrow it down)
<FromGitter> <jwoertink> actually, no I haven't tried that
<FromGitter> <jwoertink> You mean the internal Crystal DNS resolving might have an issue?
<FromGitter> <jwoertink> or does crystal just use the system DNS like how ruby does?
<crystal-gh> [crystal] bcardiff closed pull request #4174: Implement Time#clone (master...add-time-clone) https://git.io/vyj8B
<FromGitter> <mverzilli> I'm not into the details, but here's a PR by Julien, who was attempting to enhance it: https://github.com/crystal-lang/crystal/pull/2829
<FromGitter> <mverzilli> and if you search the issue tracker, you'll notice a lot of issues on the topic
akwiatkowski has quit [Ping timeout: 260 seconds]
<FromGitter> <jwoertink> oh wow. Thanks @mverzilli! That makes sense then. I'm building out a little sample test right now to see if it really is crystal being weird, or if it's just me. (hoping it's me).
<FromGitter> <jwoertink> I'll try using an IP too with this
<RX14> I feel like trying out fibers with 64gb of ram...
bjz has joined #crystal-lang
<FromGitter> <jwoertink> Well, my initial test shows that the call averages 450ms in Kemal, but only 200ms in Sinatra. I can't try using an IP because of the SSL cert.
<RX14> wow, scaleway is cheap, 64gb ram vps for 1/5th the price of digitalocean...
<FromGitter> <jwoertink> wow. I had never heard of them, but that is pretty decent
<travis-ci> crystal-lang/crystal#3f183a6 (master - Fix crystal_repo matching): The build has errored. https://travis-ci.org/crystal-lang/crystal/builds/214387466
<RX14> scaleway are super awesome
<RX14> owned by online.net which have a long history so they aren't vapourware either :)
<RX14> (essentially owned by one of the largest ISPs in france)
<RX14> I have 7 million fibers spawned on a 64gb ram VPS
<travis-ci> crystal-lang/crystal#2744067 (master - Fixed #4145: Formatter: Crash when double splats has restrictions in some cases): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/214391702
<DeBot> https://github.com/crystal-lang/crystal/issues/4145 (Formatter: Crash when double splats has restrictions in some cases)
<FromGitter> <fridgerator> lol
<FromGitter> <fridgerator> FOR SCIENCE!
<RX14> this thing has 10 cores... I feel like benchmarking crystal at scale
sustained has joined #crystal-lang
<RX14> interesting...
<RX14> i get ~100k requests per second with a single crystal process
<RX14> but with 2 i get 230k
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<RX14> was maxing out a gigabit card too
<crystal-gh> [crystal] bcardiff closed pull request #3972: Fix self restriction with including generic module (master...fix/crystal/self-restriction) https://git.io/vDOop
<crystal-gh> [crystal] bcardiff pushed 3 new commits to master: https://git.io/vSJBy
<crystal-gh> crystal/master 917971d Brian J. Cardiff: Merge pull request #3972 from MakeNowJust/fix/crystal/self-restriction...
<crystal-gh> crystal/master 8ace6d4 TSUYUSATO Kitsune: Add TODO for fixing self restriction...
<crystal-gh> crystal/master 6645b8f TSUYUSATO Kitsune: Fix self restriction with including generic module...
<FromGitter> <ltran> What is that code doing? ;D
<RX14> which?
<FromGitter> <ltran> sorry, the one that's doing 500k req/sec =D
<RX14> HTTP requests
<RX14> just responding with hello world
<FromGitter> <ltran> Ahhh okay =) damn so many
<travis-ci> crystal-lang/crystal#3f183a6 (master - Fix crystal_repo matching): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/214387466
<kodo[m]> when people write hello world do you think they mean earth or the universe in general?
alibby has quit [Quit: Leaving.]
alibby has joined #crystal-lang
alibby has quit [Quit: Leaving.]