ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.19.4 | Fund Crystals 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
wlib has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Cyrus> asterite: I think you have the wrong person -- that should be for w400z.
<Cyrus> But he's no longer here.
<Cyrus> Though those are cool projects.
<FromGitter> <fkchang> @sdogruyol - not certain if this is a kemal websockets question or a crystal question. if I'm streaming log file over websockets in kemal, how do I kill the stream on close? I want to do something like this: ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=580175071cc4cda456506c9c]
Philpax has joined #crystal-lang
crystal-lang063 has joined #crystal-lang
crystal-lang063 has quit [Client Quit]
<wlib> there needs to be a BUILDING file and the README.md needs to have a reference to it so people can build without researching, it just helps new users
<wlib> nvm i forgot its self hosted
wlib has left #crystal-lang [#crystal-lang]
soveran has joined #crystal-lang
jhass has quit [Ping timeout: 252 seconds]
soveran has quit [Ping timeout: 248 seconds]
ruby_ has quit []
asterite has quit [Ping timeout: 250 seconds]
bjz has joined #crystal-lang
vikaton has joined #crystal-lang
pduncan has quit [Ping timeout: 250 seconds]
asterite has joined #crystal-lang
dhk_ has joined #crystal-lang
jhass has joined #crystal-lang
dhk has quit [Ping timeout: 250 seconds]
<Cyrus> fhkchang: If you find a way, please share the solution. I'm curious what it would be.
<Cyrus> s/fhkchang/fkchang/;
dhk_ has quit [Quit: Leaving]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
Philpax_ has joined #crystal-lang
Philpax has quit [Ping timeout: 260 seconds]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 250 seconds]
bjz has quit [Ping timeout: 258 seconds]
bjz has joined #crystal-lang
vikaton has quit [Quit: Connection closed for inactivity]
Ven_ has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 260 seconds]
eizua has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 250 seconds]
eizua has quit [Remote host closed the connection]
<FromGitter> <sdogruyol> @fkchang ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5801d3e0b68c1ca566b970ff]
<FromGitter> <sdogruyol> You need a holder for the pid which can be a static class variable
HakanD_ has joined #crystal-lang
pawnbox has joined #crystal-lang
eizua has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
scottj has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
HakanD_ has quit [Quit: Be back later ...]
HakanD__ has joined #crystal-lang
HakanD__ has quit [Quit: Be back later ...]
grindhold_ has joined #crystal-lang
scottj has quit [Quit: leaving]
daemonwrangler has quit [*.net *.split]
A124 has quit [*.net *.split]
havenwood has quit [*.net *.split]
mose has quit [*.net *.split]
jamie_ca has quit [*.net *.split]
oddmunds has quit [*.net *.split]
grindhold has quit [*.net *.split]
endou has quit [*.net *.split]
HakanD__ has joined #crystal-lang
Ven_ has quit [Ping timeout: 248 seconds]
oddmunds has joined #crystal-lang
Ven_ has joined #crystal-lang
endou has joined #crystal-lang
daemonwrangler has joined #crystal-lang
A124 has joined #crystal-lang
jamie_ca has joined #crystal-lang
havenwood has joined #crystal-lang
mose has joined #crystal-lang
Ven_ has quit [Ping timeout: 248 seconds]
Ven_ has joined #crystal-lang
onethirtyfive has joined #crystal-lang
endou_ has joined #crystal-lang
havenn has joined #crystal-lang
daemonwrangler_ has joined #crystal-lang
A124 has quit [Disconnected by services]
A124 has joined #crystal-lang
endou has quit [*.net *.split]
daemonwrangler has quit [*.net *.split]
havenwood has quit [*.net *.split]
mose has quit [*.net *.split]
jamie_ca has quit [*.net *.split]
havenn is now known as havenwood
jamie_ca has joined #crystal-lang
mose has joined #crystal-lang
pawnbox has joined #crystal-lang
Yxhuvud has joined #crystal-lang
Ven_ has quit [Ping timeout: 260 seconds]
Ven_ has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
ponga has joined #crystal-lang
Ven_ has quit [Ping timeout: 250 seconds]
Ven_ has joined #crystal-lang
pawnbox has joined #crystal-lang
HakanD__ has quit [Quit: Be back later ...]
HakanD__ has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
pawnbox has joined #crystal-lang
<RX14> BlaXpirit, I think generating a slice of random bytes is a pretty core random operation
<RX14> generating UUIDs should probably be UUID.new(random : Random = SecureRandom)
<RX14> but hex strings and base64 generation shouldn't hurt
<BlaXpirit> RX14, i don't like those methods in the first place, just look at how trivial they are https://github.com/crystal-lang/crystal/blob/master/src/secure_random.cr#L32
<BlaXpirit> just clutter
<BlaXpirit> random_bytes - yes, that's a core operation
<BlaXpirit> i'm not sure just how core to make it yet. might want it to be an alternative to next_u
<RX14> hmm
<RX14> BlaXpirit, well handling alternatives is a bit weird
<BlaXpirit> yes
<RX14> i would say choose one or the other
<RX14> and next_u is probably going to be faster
<BlaXpirit> but without random_bytes being core there's no good solution for a urandom-based RNG
<BlaXpirit> because if u make a call to urandom for each next_u call... yeah....
<RX14> well
<RX14> hmm
<BlaXpirit> and if you make a cache instead, that could be insecure, nobody knows lol
<RX14> thats a point
<RX14> yes
<RX14> go with random_bytes being the core then I would say
<RX14> fill a slice with random
<BlaXpirit> but then everything else is at a big disadvantage
<BlaXpirit> the more typical uses
<RX14> for complexity?
<BlaXpirit> just think of the numerous array allocations
<jokke> any reason why the spec dsl doesn't have let?
<RX14> because it's stupid
<RX14> BlaXpirit, array?
<jokke> :)
<RX14> it's like reading IO
<RX14> you reuse the slice
<BlaXpirit> RX14, well how do you implement random_bytes(n)
<jokke> RX14: are there alternatives?
<RX14> jokke, spec2.cr
<jokke> any good?
<RX14> i've used ti with success
<RX14> might be slow for larger suites though
<RX14> it uses macros
<jokke> ooh very nice
<RX14> didn't seem too slow for me though
<jokke> no namespace polluting
<jokke> cool
<jokke> i wonder why the native spec lib had to go down the exact same path rspec did years ago until they realized that namespace polluting with the should syntax isn't that gread
<jokke> *great
<RX14> well
<RX14> assert is the way I would go
<jokke> naah
<BlaXpirit> -_-
<RX14> it's so so so much clearer to write and read
<jokke> imho it's the opposite
<jokke> it's never clear to me which is the expected and which the actual
<RX14> so you dislike crystal syntax?
<RX14> there is no expected and actual, just an expression
<jokke> i dislike both should and assert
<RX14> you're validating an invariant
<jokke> ah yeah ok
<RX14> the exp3ected and actual would be opposite sides of an ==
<jokke> but it's hard to implement more complex matchers
<jokke> like structures match or so
<jokke> (deep hash comparison)
<RX14> well, personally I think that's not much of an issue, you can just add them to your codebase
<jokke> what?
<RX14> i find that often comparisons you have to make in specs come up in the codebase itself
<jokke> add test code to your codebase?
<BlaXpirit> if people actually embrace the idea, the problems are easy to overcome
<BlaXpirit> but for now all we have is excuses and uncernainty
<BlaXpirit> lost cause regardless
<jokke> also the formatting of specs with actual matcher objects can be much more precice and informative than with aserts
<RX14> i liked my idea of the simple macro with intelligent matchers BlaXpirit
<jokke> stuff like diff view of actual and expected
<jokke> and so forth
<BlaXpirit> false
<RX14> but really, I've seen the future in groovy and it was great
<jokke> of course it's much faster to use assertion based specs
<jokke> in execution
<RX14> heh
<RX14> heh
<jokke> but i dont think that's an issue
<RX14> hehehehehe
<RX14> nah
<RX14> BlaXpirit, we need to make an assertion shards that works and is great
<RX14> and use it in large spec suites
<RX14> then we have the leverage to make the point
<BlaXpirit> i made my thing, i'm good
<BlaXpirit> no use arguing with the BS imprinted by ruby
* jokke shrugs
<jokke> any mocking libs for crystal?
<Papierkorb> I'm still missing the data driven tests in C++/Qt. The concept is the same as in ^ though.
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vP6uC
<crystal-gh> crystal/master dc2e6d7 Oleh Prypin: Rework the Random module (#3402)...
<jokke> mh i see the complexity of this...
<Papierkorb> Though I also miss expect() over .should, and let(..) would be nice to have too.
<jokke> Papierkorb: look at spec2
<jokke> has just that
<Papierkorb> jokke: thanks
<jokke> i just found out about it too, thank RX14 :)
<crystal-gh> [crystal] asterite pushed 3 new commits to master: https://git.io/vP6uy
<crystal-gh> crystal/master 7ecd836 RX14: Add IO::MultiWriter
<crystal-gh> crystal/master b434fe8 RX14: Fix method notation in IO specs
<crystal-gh> crystal/master bad73b0 RX14: Mention IO::MultiWriter in Logger docs
<travis-ci> crystal-lang/crystal#dc2e6d7 (master - Rework the Random module (#3402)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/167887363
<DeBot> https://github.com/crystal-lang/crystal/pull/3402 (Rework the Random module)
<travis-ci> crystal-lang/crystal#bad73b0 (master - Mention IO::MultiWriter in Logger docs): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/167888782
soveran has quit [Remote host closed the connection]
rtl_ has joined #crystal-lang
rtl has quit [Ping timeout: 248 seconds]
jhass has quit [Ping timeout: 250 seconds]
jhass has joined #crystal-lang
kulelu88 has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <raydf> Hello
Philpax_ has quit [Ping timeout: 268 seconds]
<FromGitter> <raydf> I'm trying to overload a class with generics and i'm receiving a superclass mismatch (Issue: #3423 ). Any ideas on why is this happening?
<DeBot> https://github.com/crystal-lang/crystal/issues/3423 (superclass mismatch in overloading of a generic open class)
onionhammer1 has quit [Quit: WeeChat 1.0.1]
<BlaXpirit> raydf, yeah, sounds like an issue. well i guess every time you make a class it's a different T. you dont have to specify it the 2nd time tho. https://carc.in/#/r/1c8p
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has quit [Ping timeout: 252 seconds]
onionhammer has joined #crystal-lang
<FromGitter> <raydf> Thanks @BlaXpirit , that worked for my current need. But one should be able to overload the class with something like TestView(T) < View(Int32).
<FromGitter> <cjgajard> duplicate of #3298 :sweat_smile:
HakanD__ has quit [Quit: Be back later ...]
HakanD__ has joined #crystal-lang
eizua has quit [Quit: Leaving]
HakanD__ has quit [Ping timeout: 250 seconds]
HakanD__ has joined #crystal-lang
<FromGitter> <raydf> Thanks @cjgajard for the related issue.
matp has quit [Read error: Connection reset by peer]
matp_ has joined #crystal-lang
buggs1 has joined #crystal-lang
buggs1 is now known as buggs
dhk has joined #crystal-lang
<FromGitter> <sonic182> Hi, I found thread class and thread::mutex , how safe is to use them for parallelism? I tried to apply parallelism (as in C with pthread) but I've got some errors I think for some race condition on my code
<FromGitter> <sonic182> Actually the class says to don't use it, and use fibers instead, but fibers it's not parallelism </3
<FromGitter> <raydf> @sonic182 , There's no parallelism support yet for crystal
<FromGitter> <sonic182> Yes, there is, but it's not easy to use. It's C pthreads <3
<BlaXpirit> sonic182, fibers will support parallelism
<FromGitter> <raydf> you can try https://github.com/crystal-lang/crystal/tree/thread-support branch for learning where crystal is going for the next releases, related to multiple threading support.
<BlaXpirit> most parts of standard library will crash if u use threads
<FromGitter> <sonic182> Oh nice thanks @raydf
<FromGitter> <raydf> Fibers and channels would allow to do parallelism transparently in the future.
<FromGitter> <sonic182> @FromIRC that's what I found xD, well I've to Wait I think
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 260 seconds]
mose has quit [Changing host]
mose has joined #crystal-lang
<BlaXpirit> sonic182, not necessarily. what are you looking to do in parallel?
<BlaXpirit> i mean, as long as there are no allocations and I/O in the thread it's all fine :|
<BlaXpirit> it actually works ok for pure computations
<FromGitter> <sonic182> Well I'm not sure why it didn't worked, I'll try in other moment
<BlaXpirit> k
<FromGitter> <sonic182> It's limited the stack size on treads?
<RX14> @sonic182 what are you actually trying to achieve?
<FromGitter> <sonic182> Parallel evaluation of large chromosomes on a GA
<RX14> ok, so it's CPU bound
<RX14> my advice would be to not use crystal, or wait for thread parallelism to hit
mose has left #crystal-lang ["WeeChat 1.0.1"]
<RX14> using threads in crystal is a very bad idesa
<RX14> using threads in crystal is a very bad idea
<FromGitter> <sonic182> Yea it speeds up with parallelism. It's just testing crystal, not for real work
<BlaXpirit> it's not that bad of an idea
<FromGitter> <sonic182> Actually that GA it's far away to be perfect 🙄
<FromGitter> <sonic182> But the backtracking solution it's ok :)
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <raydf> hows the performance with an unique thread?
<jokke> are there any plans for somehow supporting the enforcement of a certain scope in a macro invocation?
<jokke> i'd really like to invoke my macro inside of a method call but the macro dynamically defines a class, which of course isn't possible from inside a def
<FromGitter> <sonic182> It's ok I guess, I've to do the same code on other language to compare
<FromGitter> <sonic182> Something like Java, go o elixir
<FromGitter> <sonic182> Or*
soveran has joined #crystal-lang
bjz has joined #crystal-lang
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 260 seconds]
HakanD__ has quit [Quit: Be back later ...]
HakanD__ has joined #crystal-lang
HakanD__ has quit [Ping timeout: 260 seconds]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vP69f
<crystal-gh> crystal/master 6aa58a3 Guillaume Hivert: Added unix-like commands to FileUtils (#3420)
dhk has quit [Quit: Leaving]
Ven_ has joined #crystal-lang
Ven_ has quit [Read error: Connection reset by peer]
Ven__ has joined #crystal-lang
bjz_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
Ven__ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vP65A
<crystal-gh> crystal/master 7025618 Ary Borenszweig: Fixed #3423: superclass mismatch in overloading of a generic open class
bjz has joined #crystal-lang
soveran has quit [Remote host closed the connection]
snsei has joined #crystal-lang
<travis-ci> crystal-lang/crystal#7025618 (master - Fixed #3423: superclass mismatch in overloading of a generic open class): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/167962289
<DeBot> https://github.com/crystal-lang/crystal/issues/3423 (superclass mismatch in overloading of a generic open class)
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
Raimondi has quit [Quit: WeeChat 1.6-dev]
Raimondi has joined #crystal-lang
<crystal-gh> [crystal] ysbaddaden opened pull request #3424: Add ARMv6 / ARMv7 support (hard float) (master...arm-support) https://git.io/vP6bT
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vP6bL
<crystal-gh> crystal/master 130ee24 Ary Borenszweig: Formatter: fixed wrong block formatting after newline. Fixes #3418
pduncan has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has quit [Ping timeout: 260 seconds]