RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.20.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
dhk has joined #crystal-lang
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has quit [Remote host closed the connection]
BlaXpirit has quit [Quit: Bye]
FromGitter has joined #crystal-lang
dhk has quit [Quit: Leaving]
BlaXpirit has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei_ has joined #crystal-lang
snsei_ has quit [Remote host closed the connection]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
soveran has joined #crystal-lang
snsei has quit [Remote host closed the connection]
soveran has quit [Ping timeout: 258 seconds]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
bjz has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
ome has joined #crystal-lang
elia has quit [Quit: (IRC Client: textualapp.com)]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
bew78 has joined #crystal-lang
<bew78> Does anyone know how to make conditional compile-time inheritance ?
<bew78> I think I should use macro, but I don't know how..
<bew78> The goal is: From an Enum value in contructor, decide which class will be the super class
ponga has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 264 seconds]
leex_ has joined #crystal-lang
leex has quit [Write error: Broken pipe]
soveran has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
soveran has quit [Ping timeout: 252 seconds]
<bew78> nevermind, I managed to think correctly :)
bew78 has quit [Quit: WeeChat 1.6]
bjz has quit [Ping timeout: 246 seconds]
bjz_ has joined #crystal-lang
ome has quit [Quit: Connection closed for inactivity]
hako has quit [Ping timeout: 260 seconds]
hako has joined #crystal-lang
bjz_ has quit [Ping timeout: 252 seconds]
bjz has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 246 seconds]
mgarciaisaia has quit [Quit: Leaving.]
<FromGitter> <jots_twitter> does play.crystal-lang.org not allow outbound sockets?
<FromGitter> <jots_twitter> probably not which is good. first time trying to use spawn: https://gist.github.com/jots/422ced81c65d3c32ca9047751afadb73 doesn't work. code works without the spawn. I'm sure I'm missing something obvious
<FromGitter> <jots_twitter> also was thrown off that String doesn't have "<<" so `buf << line` didn't work. i was kind of fond of << :-)
bjz has quit [Ping timeout: 244 seconds]
bjz has joined #crystal-lang
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 265 seconds]
<FromGitter> <maiha_twitter> Yup, `String` is immutable. We can use `String::Builder#<<` instead!
bjz_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
p0p0pr37_ has joined #crystal-lang
p0p0pr37_ has joined #crystal-lang
p0p0pr37 has quit [Read error: Connection reset by peer]
p0p0pr37_ is now known as p0p0pr37
soveran has joined #crystal-lang
Philpax_ has joined #crystal-lang
soveran has quit [Ping timeout: 258 seconds]
Philpax has quit [Ping timeout: 260 seconds]
soveran has joined #crystal-lang
bjz has joined #crystal-lang
Philpax__ has joined #crystal-lang
Philpax_ has quit [Ping timeout: 244 seconds]
bmcginty has quit [*.net *.split]
bmcginty has joined #crystal-lang
bmcginty has quit [Ping timeout: 260 seconds]
bmcginty has joined #crystal-lang
<crystal-gh> [crystal] MakeNowJust opened pull request #3664: Clean up empty line of shard.yml on crystal init lib (master...fix/clean-shards-yml) https://git.io/v1r0o
akwiatkowski has joined #crystal-lang
<FromGitter> <sdogruyol> have a nice weekend everyone
rolha has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
matp has quit [Remote host closed the connection]
matp has joined #crystal-lang
<RX14> i'm going to have a crack at creating a jenkins setup for crystal on all the different architectures
<Papierkorb> jots_twitter, use `sleep` instead of `Fiber.yield`
<Papierkorb> jots_twitter, line 13, use #print instead of #write to get rid of the #to_slice
hako has quit [Remote host closed the connection]
Raimondi has quit [*.net *.split]
pduncan has quit [*.net *.split]
pabs has quit [*.net *.split]
pduncan has joined #crystal-lang
pabs has joined #crystal-lang
Raimondi has joined #crystal-lang
optikfluffel has joined #crystal-lang
bjz has quit [Ping timeout: 268 seconds]
bjz has joined #crystal-lang
bjz has quit [Ping timeout: 248 seconds]
bjz has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
mgarciaisaia has quit [Ping timeout: 268 seconds]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
soveran has quit [Remote host closed the connection]
optikfluffel has quit [Quit: Textual IRC Client: www.textualapp.com]
<FromGitter> <sdogruyol> @RX14 awesome
mgarciaisaia has quit [Ping timeout: 250 seconds]
vivus-ignis has joined #crystal-lang
<FromGitter> <firejox> I found LLVM provide some feature for writing GC, but i'm not sure whether it would work in Crystal.
mgarciaisaia has joined #crystal-lang
<FromGitter> <firejox> I'm trying to implement GC. :smile:
<FromGitter> <sdogruyol> @firejox i also tried that but stopped for now
<FromGitter> <sdogruyol> since parallelism is being sort out by @asterite and @waj
Philpax__ has quit [Ping timeout: 268 seconds]
soveran has joined #crystal-lang
vivus-ignis1 has joined #crystal-lang
vivus-ignis has quit [Ping timeout: 264 seconds]
vivus-ignis1 is now known as vivus-ignis
soveran has quit [Remote host closed the connection]
<FromGitter> <firejox> @sdogruyol Oh,but I think GC should be in independent part since GC cannot collect itself.
<FromGitter> <sdogruyol> you are right but it still needs to be integrated
mgarciaisaia has quit [Quit: Leaving.]
<RX14> why must gpg be such a pain
<FromGitter> <firejox> Signal can do good work like current boehm GC
<FromGitter> <sdogruyol> signal?
<FromGitter> <firejox> Yes, send signal to stop world and retrieve roots.
<FromGitter> <sdogruyol> isnt that mark and sweep?
<BlaXpirit> i often wonder why a reference counting solution isn't seen as a first-class one
<BlaXpirit> to me it seems easiest and most reliable
<FromGitter> <sdogruyol> i dont have much experience with ARC expect Obj-c
<FromGitter> <sdogruyol> except*
<RX14> ARC is even worse for a multi-core GC
<RX14> because you would have to either use slow atomic increments, or lock the reference count
<RX14> also all the typical problems with reference counting
<BlaXpirit> ahh that
<FromGitter> <firejox> That is a kind of mark and sweep. It's Concurrent GC.
<Yxhuvud> blax: it is good until you start doing lots of concurrent work and/or want predictable latencies of your system. Good enough to start with though..
<RX14> well, if crystal does implement a modern high-performance GC then that's likely the problem solved forever
<RX14> i don't think ARC is the solution
<FromGitter> <sdogruyol> i like how Go started with simplest and improved over
<BlaXpirit> no i forgot about concurrency, clearly reference counting is not it
<Yxhuvud> sdogruyol: yes. But that also tell us that a more fancy one is needed eventually.
<BlaXpirit> works well for python because there's no real concurrency anyway
<FromGitter> <sdogruyol> yeah but it's hard to do all that from the start
<Yxhuvud> also a lot of python use cases is not really heavy work.
<RX14> well we already have the minimum viable solution for GC: reuse one
<Yxhuvud> except for stuff like numpy that use C bindings anyhow
<Yxhuvud> I'd be surprised if at this point it isn't more productive to write tools that expose where a lot of object allocations happen and then use them to optimize away many of those places. We do have lots of tools to improve performance without having to write a new GC (now. Later may be a different question)
<RX14> well we don't need a new GC pronto
<RX14> and aparrently valgrind has some nice malloc profiling tools
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has quit [Ping timeout: 240 seconds]
<FromGitter> <sdogruyol> parallelism first
pduncan has quit [Ping timeout: 244 seconds]
akwiatkowski has quit [Ping timeout: 264 seconds]
leex_ is now known as leex
pduncan has joined #crystal-lang
pduncan has quit [Ping timeout: 258 seconds]
soveran has joined #crystal-lang
<RX14> having to reinstall 1000 debian packages at dpkg's slow rate really slows down dockerfile development...
soveran has quit [Ping timeout: 248 seconds]
<RX14> ok, i've gotten the basic first steps of crystal's CI on debian x86
<RX14> now I just need to set up kvm machines for all the arcitectures...
<RX14> hmm
<FromGitter> <sdogruyol> where do you host em
<RX14> my desktop right now
<RX14> after that? not sure
<RX14> depends on if @asterite wants the system and if so what resources manas could have available
<FromGitter> <sdogruyol> i see
<RX14> any dedicated server with a good price/performance ratio would do
<RX14> maybe get a old dedi from hetzner
<RX14> this looks like a good deal, though I couldn't pay for it personally: https://www.online.net/en/dedicated-server/dedibox-classic
<RX14> i havent looked around too far though
pduncan has joined #crystal-lang
<FromGitter> <sdogruyol> @Rx14 i have dedicated from kimsufi
<FromGitter> <sdogruyol> @RX14 got lots of spare power on that not sure how to share though
<RX14> hmm
<RX14> well i'll be thesting the thing on my local machine at least
<RX14> i'm going to read up about packer and see if it's good to create the VM images with
pduncan has quit [Ping timeout: 240 seconds]
pduncan has joined #crystal-lang
<RX14> I imagine making the thing is going to be more work than foinding machines to host it
<FromGitter> <jots_twitter> rx14: or maybe use lxc for virtualization? I've had good luck with it. found this vps service that supports lxc: https://launchvps.com/ (have not used them) you can run lxc containers inside of lxc containers.
<RX14> when I say every platform
<RX14> I mean wine
<RX14> sorry
<RX14> arm
<RX14> getting late
<RX14> so lxc won't be usable for that
<FromGitter> <jots_twitter> ah
<RX14> i need full virtualization to support different CPU architectures
<RX14> I was going to use docker for the x64 arches
<RX14> i.e.
<RX14> linux-x64-libc and linux-x64-musl
<RX14> but then I realised why not just use VMs for everything, it'll be easier to manage
pduncan has quit [Ping timeout: 258 seconds]
<FromGitter> <jots_twitter> still trying to figure out fibers. How can I tell crystal to run until all fibers have completed instead of sleeping for some amount of time that I think will be the max?
<FromGitter> <jots_twitter> https://play.crystal-lang.org/#/r/1fve
<tilpner> You put "sleep" instead of "sleep 2"
<RX14> yup
<RX14> sleep with no args will just run other fibers forever
<FromGitter> <jots_twitter> but then the program never exits. I want it to exit when all have completed.
<RX14> oh
<RX14> hmm
<RX14> you'll need to do that with channels
<adam12> @jots_twitter In the past people use channels, and then send X number of signals (integers, etc) back, and then exit.
<FromGitter> <jots_twitter> thanks, will look into channels. It would be nice if crystal automagically slept until fiber_count == 0, or at least had a function: sleep_until_no_fibers
<RX14> well thats actually pretty hard to implement
<RX14> hmm
soveran has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
z64 has joined #crystal-lang
<FromGitter> <sdogruyol> this has a nice approach for running http server in cluser mode
<FromGitter> <sdogruyol> cluster*
soveran has quit [Ping timeout: 252 seconds]
<Yxhuvud> yeah. that max latency for the first test using crystal looks bad. I hope he accounted for coordinated omission (ie, if he sends 2k requests per second serially and the server pause for a second, without accounting for it it would look like a single request being hit by the pause)
<FromGitter> <crisward> I have a problem, which in node I'd solve with a callback. Are there similar patterns in crystal?
<FromGitter> <sdogruyol> @crisward block / yield ?
<FromGitter> <crisward> @sdogruyol I'm doing that, but .... I'll set up a gist...
<FromGitter> <sdogruyol> sure
<Yxhuvud> sdogruyol: I find it strange that he gets so many multiples more than the amount of threads he uses though, for the threaded test.
<FromGitter> <crisward> The real code is for wrapping a database call in a json builder to stream the output to the browser
<FromGitter> <sdogruyol> that should be easy
<FromGitter> <sdogruyol> let me see
<FromGitter> <sdogruyol> @crisward i've added a comment to your gist
mgarciaisaia has quit [Quit: Leaving.]
<FromGitter> <crisward> @sdogruyol Thanks... that's what I'm doing at the moment. Missed out an important thing. Doer should be able to receive any method as a call back. At the moment I pass a class in with an all method, and the `Doer` class calls Class.new.all, but I need it to be able to call any method.
<FromGitter> <sdogruyol> i'm not sure if you can call any method, Crystal doesn't have call unlike Ruby or Node (which does all the stuff at runtime)
<FromGitter> <sdogruyol> why don't you have a common interface for all these classes?
<FromGitter> <crisward> I think that's my next step, or macros. I was just hoping for something simpler.
<FromGitter> <sdogruyol> well i'm just not sure
<FromGitter> <sdogruyol> macros would be your cure
<RX14> every time I think i've gotten all the libraries crystal needs, I need to install one more
<RX14> on the other hand it looks like it worksing great
<z64> hi rx o/
<RX14> hi
<z64> lune#2639 :p
<RX14> ok
vivus-ignis has quit [Ping timeout: 260 seconds]
soveran has joined #crystal-lang
<FromGitter> <fridgerator> Once you use `property`, can you not override the setter method?
<FromGitter> <fridgerator> in a Class
bjz has joined #crystal-lang
<RX14> you can
<FromGitter> <crisward> @sdogruyol Thanks for you help, I've solved it another way. Each of the methods I wanted to call yield a database resultset, so I've wrapped my `dothing` around my doer and pass the result set in along with a model class. It can then iterate over the result set and convert it to json using model.new(result) and create a json stream, so all good.
<FromGitter> <sdogruyol> @crisward cheers
matp has quit [Remote host closed the connection]
<FromGitter> <crisward> I always find when learning a new language its less about syntax and more about how that language allows you to construct functionality.
matp has joined #crystal-lang
<FromGitter> <crisward> Not having to deal with async everywhere is really nice, but not having the ability to pass functions around I'm finding a little frustrating.
<FromGitter> <fridgerator> that code doesn't output anything
<FromGitter> <crisward> whats the `=` for after def butts ?
<FromGitter> <fridgerator> setter method
<RX14> @fridgerator it's because you don't have the same type restriction
<RX14> the property macro defines def butts=(foo : String?)
<RX14> it's more specific so it wins out
<FromGitter> <fridgerator> ahh, gotcha
<FromGitter> <fridgerator> ty
<FromGitter> <fridgerator> @crisward its the same as ruby's getter and setter methods
<FromGitter> <crisward> I'm trying to learn crystal without knowing ruby... not easy. It's hard to work out when ruby applies and when it doesn't
<FromGitter> <fridgerator> I bet
<RX14> well, crystal always applies, and I'm pretty sure foo= is in the docs
<FromGitter> <fridgerator> in this instance though you can look up how rub getter and setter methods work, and its the same here
<FromGitter> <fridgerator> and instead of `attr_accessible` use `property`
soveran has quit [Remote host closed the connection]
<FromGitter> <jots_twitter> what am I doing wrong here: https://play.crystal-lang.org/#/r/1fvf ? `no overload matches 'Array(JSON::Any:Class)#<<' with type JSON::Any`
<FromGitter> <fridgerator> try `results = [] of JSON::Any`
<FromGitter> <fridgerator> or `results = Array(JSON::Any).new`
<FromGitter> <jots_twitter> ah yes, thank you @fridgerator
<FromGitter> <fridgerator> np
<RX14> nearly working: https://aww.moe/9fxb5a.png
<FromGitter> <fridgerator> :+1:
<RX14> and I can add new architectures simply by adding a string to an array in the Jenkinsfile
<RX14> so it would be easy to expand this to all the architectures
soveran has joined #crystal-lang