ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.22.0 | 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
<FromGitter> <justinledwards> if you launch a process is there an easy way you can track process id or anything like that?
<FromGitter> <justinledwards> https://github.com/crystal-lang/crystal/blob/cae9a20ddab68781a03e31e32fbe64d3eff4e20d/src/process.cr#L18 looks like so but I haven't launched a process that way before
thews has joined #crystal-lang
<crystal-gh> [crystal] Sija opened pull request #4534: Improve Crystal::Macros docs (master...improve-macros-docs) https://git.io/vHXAP
<Disrecollection> Does anyone know the patterns for StringScanner? I need to skip until " and then scan until " and I'm not quite sure how to do that.
<Disrecollection> and I can't find what "pattern" is supposed to be.
Kug3lis has joined #crystal-lang
<Disrecollection> Figured out pattern, but it looks like StringScanner is injecting /:0/ when it comes uppon // so uh? Anyone know why that is?
pduncan has joined #crystal-lang
<travis-ci> crystal-lang/crystal#54415ff (master - Fixed codegen for x86): The build was fixed. https://travis-ci.org/crystal-lang/crystal/builds/241013863
Disrecollection has quit [Quit: Leaving.]
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Disrecollection has joined #crystal-lang
snsei has joined #crystal-lang
rocky has joined #crystal-lang
<Disrecollection> I tried to "include FileUtils" in a program but the compiler says "undefined constant" ?
<FromGitter> <elorest> We should use https://ace.c9.io/ for crystal play and play.crystallang.org so that indenting will work better and we can use vim mode :)
pduncan has quit [Ping timeout: 255 seconds]
Disrecollection has quit [Ping timeout: 260 seconds]
snsei has quit [Remote host closed the connection]
Disrecollection has joined #crystal-lang
<Disrecollection> Huh.
<Disrecollection> Just had weird rc.
A124 has quit [Quit: '']
<Disrecollection> So I built a program using the release flag. How do I run that prog from the console(so I can give it the inputs it asks for) ?
A124 has joined #crystal-lang
<Disrecollection> running xubuntu
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter> <bararchy> ./program
<FromGitter> <bararchy> ./program arts
<FromGitter> <bararchy> ./program args1 args2
<FromGitter> <bararchy> Etc..
rohitpaulk has joined #crystal-lang
Disrecollection has quit [Quit: Leaving.]
bzb_hh has joined #crystal-lang
Disrecollection has joined #crystal-lang
bzb_hh has quit [Client Quit]
rohitpaulk has quit [Ping timeout: 246 seconds]
early has quit [Quit: Leaving]
early has joined #crystal-lang
hightower3 has joined #crystal-lang
lacour has quit [Quit: Leaving]
mark_66 has joined #crystal-lang
hightower2 has quit [Ping timeout: 246 seconds]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 255 seconds]
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
mark_66 has quit [Quit: Leaving.]
mark_66 has joined #crystal-lang
mark_66 has quit [Quit: Leaving.]
mark_66 has joined #crystal-lang
<hightower3> Disrecollection, "require" instead of "include"?
Kug3lis has joined #crystal-lang
rohitpaulk has joined #crystal-lang
vikaton has quit [Quit: Connection closed for inactivity]
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter> <sdogruyol> hey all
<hightower3> z0
<hightower3> y0*
rohitpaulk has joined #crystal-lang
hightower3 has quit [Ping timeout: 255 seconds]
hightower3 has joined #crystal-lang
hightower3 has quit [Ping timeout: 240 seconds]
<FromGitter> <akzhan> hi )
splitty__ has joined #crystal-lang
splitty___ has joined #crystal-lang
splitty_ has quit [Ping timeout: 260 seconds]
splitty__ has quit [Ping timeout: 240 seconds]
Kug3lis has joined #crystal-lang
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Kug3lis has joined #crystal-lang
Kug3lis has quit [Client Quit]
<FromGitter> <eliasjpr> 👋🏻
Raimondi has quit [Ping timeout: 260 seconds]
rohitpaulk has quit [Ping timeout: 246 seconds]
Kug3lis has joined #crystal-lang
jhass has quit [Remote host closed the connection]
asterite has quit [Remote host closed the connection]
asterite has joined #crystal-lang
jhass has joined #crystal-lang
hightower2 has joined #crystal-lang
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Kug3lis has joined #crystal-lang
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Raimondi has joined #crystal-lang
<thews> anyone know the syntax to launch a system command using Process ? specifically I want to run it then be able to store the pid afterwards, I'm just not finding examples
asterite has quit [Quit: Bye]
jhass has quit [Quit: Bye]
asterite has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
jhass has joined #crystal-lang
rohitpaulk has joined #crystal-lang
asterite has quit [Quit: Bye]
jhass has quit [Client Quit]
asterite has joined #crystal-lang
<thews> figured out how to run something and grab the output using IO::Memory, still don't 100% get how to get the pid
Kug3lis has joined #crystal-lang
jhass has joined #crystal-lang
<Papierkorb> what do you need the PID for?
<Papierkorb> There's Process#pid
rohitpaulk has quit [Ping timeout: 255 seconds]
<thews> Papierkorb: I'm trying to write a little starter program to go through my OTA recorder that records stuff in raw and sometimes ffmpeg stalls looping on a corrupt frame over and over
asterite has quit [Ping timeout: 260 seconds]
<thews> so I want to store the PID and look to see how long it's been running
<thews> and kill it
<thews> but also launch it from inside crystal
<Papierkorb> Use `Process`, no need to mess with pids directly
jhass has quit [Ping timeout: 268 seconds]
<thews> if I use process directly should I use spawn so that it's not in the main thread? I'm not sure how I would monitor it from process alone
<thews> I'm fresh to crystal, and since it's relatively new I've had a hard time finding similar projects to learn from or some real world examples
Raimondi has joined #crystal-lang
snsei has joined #crystal-lang
<thews> I'm just trying to sort of scaffold it up, but I'm hung up on that part right now
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <bew> here, `test` is a `Process` instance, on which you can call several methods, ar store it somewhere, monitor the running process, etc
Kug3lis has joined #crystal-lang
rohitpaulk has joined #crystal-lang
asterite has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 260 seconds]
jhass has joined #crystal-lang
LastWhisper____ has joined #crystal-lang
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<crystal-gh> [crystal] straight-shoota opened pull request #4535: Fix negative digit precision for `Number#round` (master...jm-number-round) https://git.io/vHMLF
pduncan has joined #crystal-lang
pduncan has quit [Read error: Connection reset by peer]
<FromGitter> <codenoid> what happend with crystal docs site
<FromGitter> <molovo> @codenoid Working fine for me
<FromGitter> <codenoid> the url directly linked to https://crystal-lang.org/*blabla*.html
<FromGitter> <codenoid> like https://crystal-lang.org/while.html
<FromGitter> <codenoid> weird
mark_66 has quit [Quit: Leaving.]
Kug3lis has joined #crystal-lang
Kug3lis has quit [Client Quit]
kubaxvx_ has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
kubaxvx_ has joined #crystal-lang
pduncan has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 3 new commits to master: https://git.io/vHMWr
<crystal-gh> crystal/master d3dfe16 Ary Borenszweig: Formatter: correctly format ProcNotation with parenthesized arguments. Fixes #4296
<crystal-gh> crystal/master 5a368de Ary Borenszweig: Fixed #4065: ICE when extending module that defines instance vars
<crystal-gh> crystal/master 66ecb35 Ary Borenszweig: Formatter: correctly format backslash at end of line in a few cases. Fixes #3383
Philpax__ has quit [Ping timeout: 240 seconds]
<RX14> jhass, you around?
pduncan has quit [Ping timeout: 246 seconds]
<RX14> nvm
<travis-ci> crystal-lang/crystal#d3dfe16 (master - Formatter: correctly format ProcNotation with parenthesized arguments. Fixes #4296): The build has errored. https://travis-ci.org/crystal-lang/crystal/builds/241262560
rohitpaulk has quit [Ping timeout: 240 seconds]
snsei has quit [Remote host closed the connection]
hightower6 has joined #crystal-lang
<hightower6> Hey, is there something like Netty available for Crystal? Or a beginning of such project?
<FromGitter> <sdogruyol> isnt netty an async server?
<FromGitter> <bew> Idk, and I'm not sure it's needed, as crystal is already full asynchronous, and the stdlib is quite good in network regards and stuff
<RX14> hightower6, what problem are you trying to solve using netty?
<hightower6> It abstracts all the low-level details of the socket access as well as provides uniform interface to multiple transports/protocols with minimal or no changes needed in the code based on it
<RX14> how can it provide a uniform interface to multiple protocols if they have different semantics?
<FromGitter> <fridgerator> like mqtt?
<hightower6> Beats me, but it does :)
<crystal-gh> [crystal] konovod opened pull request #4536: Adds PCG32 random generator, makes it default (master...rng) https://git.io/vHMg0
<RX14> sounds like too much abstraction to me
<RX14> any byte stream can be represented using an IO in crystal
<RX14> and that's in the stdlib
<RX14> working with IO is easy in crystal
<hightower6> cool
<RX14> we tend not to get too abstract like netty
<RX14> i'd suggest trying without any such library first
<hightower6> Will do
<FromGitter> <fridgerator> hightower, like from police academy?
<hightower6> No, unrelated to it :)
<FromGitter> <fridgerator> lol ok
<hightower6> Are there any particular helpers for using epoll, or I just use it using the C interface?
<RX14> all IO is async by default in crystal
<RX14> have you used go?
<hightower6> no, coming from a Ruby background
<hightower6> I know there's a concept of channels like Go has
<RX14> basically you write linear blocking code in crystal
<RX14> and it performs the async calls
<RX14> concurrency is provided using spawn{}
<RX14> ead this
<RX14> read*
<hightower6> Help me put that into perspective - I still do need to use epoll? Or you mean crystal uses epoll in the background on Linux?
<RX14> no need to even think about async IO
<FromGitter> <bew> it's async by default, no need to worry about it
<RX14> just treat your IO like it's blocking and spawn{} as Thread.new
<RX14> and you'll be fast
<RX14> HTTP::Server gets 100k requests per second by doing just that
<RX14> and it doesn't even parse HTTP efficiently lol
<hightower6> Although I should use fibers instead of threads, right?
<RX14> spawn{} is fibers
<RX14> but you can mostly treat them as threads
<RX14> basically you can write the dumbest, blocking, easiest to write IO code and it'll perform better than nodejs by a lot
<hightower6> Oh I understand your comment, you meant I can use "spawn{}" as a fast alternative to what would otherwise be "Thread.new{}"
<hightower6> Ok
<RX14> yeah we don't have Thread.new
<hightower6> Right, right
<RX14> it's segfaulted for about
<RX14> 2 years
<RX14> and it's not been removed...
<hightower6> Ok sounds pretty great
<RX14> but yeah
<RX14> ignore that :P
Kug3lis has joined #crystal-lang
<hightower6> And, using fibers how am I gonna share some variables between them? Do I see it right in the documentation that basically I am best off using channels for that?
<FromGitter> <bew> yes exactly
Kug3lis has quit [Ping timeout: 255 seconds]
Kug3lis has joined #crystal-lang
<hightower6> So, if I want to have controlled access to say, a Hash, I create a channel, and a fiber reading from that channel and receiving (key,value) pairs, which it then saves into the Hash?
<FromGitter> <bew> ah no sorry, channels are used to communicate between 2 fibers, not really to share a variable
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<hightower6> What would I do in the case of a variable shared between fibers, on which I need to have some sort of a lock/mutex?
<FromGitter> <sdogruyol> @hightower6 for now you dont have to do anything
<FromGitter> <sdogruyol> because Crystal is single threaded
<hightower6> Right, but assuming I want to do it right instead of having to change/update code later. I could put some placeholders in place now even if they'd be no-op
<hightower6> Seems I could just use Mutex (which would become thread-safe at some point, and my code would work as expected when it does?)
<FromGitter> <sdogruyol> not sure about that
<FromGitter> <sdogruyol> `spawn` and `Channel` are the way to do concurrent / parallel stuff
<FromGitter> <sdogruyol> and they'll become multi-threaded
<hightower6> Right, I mean for access to a shared variable
<hightower6> Which bew told me I shouldn't use Channels for
<FromGitter> <bew> I'm not sure about that though
<FromGitter> <sdogruyol> not sure
<hightower6> By the way, I just realized that in Crystal modules can be 'include'd into other modules, carrying over methods and instance vars as one would expect them
<hightower6> (Unlike the behavior/implementation in Ruby_
<hightower6> that is so cool!
<hightower6> I'm referring to this behavior, which works: https://gist.github.com/anonymous/e907694878be243386660901d73b59f0
<hightower6> (In Ruby, printing a.x and a.y in that example would produce nil,nil instead of 1,2)
greengriminal has joined #crystal-lang
<hightower6> Hello creen
<FromGitter> <jwoertink> Anyone know what `ICE` means in this context? https://github.com/crystal-lang/crystal/commit/5a368de8c7689072a168e73c1f67f5ac3c6c9863
rocky has quit [Remote host closed the connection]
<FromGitter> <jwoertink> or is this just slang the cool kids are using these days? like "This commit is ICE, yo!"
<FromGitter> <bew> I'd say Isomething Compile Error ?
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <bew> no idea for the I
<FromGitter> <jwoertink> hey, that's closer than what I was thinking
<FromGitter> <jwoertink> "Implement Compiler Error"?
<Papierkorb> internal compiler error
<FromGitter> <jwoertink> AH!
<travis-ci> crystal-lang/crystal#d3dfe16 (master - Formatter: correctly format ProcNotation with parenthesized arguments. Fixes #4296): The build has errored. https://travis-ci.org/crystal-lang/crystal/builds/241262560
<hightower6> I see I can't call 'include' inside a 'def', nor do something like 'obj.include Module'. Is there a way to 'include' a module in runtime?
<FromGitter> <bew> no, there is no way to change classes/module/struct hierarchy at runtime
<FromGitter> <bew> crystal is not an interpreted language, the flexibility is at compile time, not at runtime
<hightower6> muy bien
<FromGitter> <bew> what are you trying to do?
<hightower6> Just pondering about some other code I have in another language, which dynamically adds something to its inheritance chain
<hightower6> or ancestors chain, rather
<hightower6> it finds out which Module it needs to include (this happens in runtime), and then it includes it
<Papierkorb> Crystal is not ruby. besides that you can't modify the program during runtime, many paradigms aren't applicable either
Kug3lis has joined #crystal-lang
Kug3lis has quit [Client Quit]
<hightower6> sure, no worries, just figuring out to what extent the equivalents are supported
rocky has joined #crystal-lang
Disrecollection has quit [Quit: Leaving.]
<crystal-gh> [crystal] llamicron opened pull request #4537: Fixes a very minor comment typo in file_utils (master...file_utils_typo_fix) https://git.io/vHMMq
<FromGitter> <asterite> Mutex is for what you were discussing previously
greengriminal has quit [Quit: This computer has gone to sleep]
hightower5 has joined #crystal-lang
hightower6 has quit [Ping timeout: 260 seconds]
<hightower5> asterite: for access to a shared variable you mean?
<FromGitter> <bew> is there a short syntax for: ⏎ ⏎ ```str.gsub do |char| ⏎ apply_config(char) ⏎ end``` ⏎ ⏎ ? [https://gitter.im/crystal-lang/crystal?at=593af6c7f6a78eab48329f65]
<Papierkorb> apart from writing it on a { single line }? Nope
<FromGitter> <bew> okay, thanks
Disrecollection has joined #crystal-lang
greengriminal has joined #crystal-lang
<hightower5> Hey folks, help me a little bit please. I am trying to use the Benchmark module to test how many times per second I can .send and .receive a char on a channel
<hightower5> How would I go about the structure of that benchmark?
<hightower5> (from 2 fibers, one doing .receive;.send, the other doing .send;.receive)
<FromGitter> <drosehn> hightower: https://crystal-lang.org/api/Mutex.html -- perhaps this will help for your earlier question.
<hightower5> drosehn: Sure, saw it. Just wanted to confirm Mutex is the answer. Thanks!
greengriminal has quit [Quit: This computer has gone to sleep]
<FromGitter> <asterite> hightower5: yes
greengriminal has joined #crystal-lang
<RX14> hightower5, you want to create a fiber which just reads from a channel
<RX14> then benchmark sending in the benchmark block
<RX14> then the same but swapping send/recieve
duckqlz_ has joined #crystal-lang
<hightower5> Got it, on a 2.8 GHz machine I was able to do 5.5 mil fiber switches per second
<hightower5> Which is very cool
duckqlz_ has left #crystal-lang [#crystal-lang]
<hightower5> (on some old processor)
<RX14> yeah sounds about right
<RX14> fiber switches are just ~30 lines of assembly
<RX14> if anything it sounds a bit low
greengriminal has quit [Quit: This computer has gone to sleep]
<FromGitter> <sdogruyol> are you on linux or os x @hightower5?
<hightower5> Linux 3.2.0 on Intel Core2 Duo CPU E8300 @ 2.83GHz
<hightower5> (old system, like I mentioned :)
<RX14> can you send me the benchmark code please?
<RX14> i'd like to compare it on my machine
<hightower5> And then just manually divided 100mil by number of seconds it took
<RX14> wow that formatting is ugly
<hightower5> I might have also ran it without --release, getting much better numbers now, took only 9s
<RX14> oh yeah that would help haha
<hightower5> Getting 11.1 mil now per second
<RX14> why not do the calculations in crystal it'd be much more accurate
<hightower5> I just started using it the other day, not fully familiar with it yet. If you have an updated benchmark of the same, would be great
<RX14> I get 22.4M
<FromGitter> <sdogruyol> let me check also
<hightower5> ah right, right, sure, could have done the division in crystal
<hightower5> great,t hanks
<FromGitter> <bew> 20M for me on 2.1GHz cpu
<FromGitter> <sdogruyol> 1) 3M for me
<hightower5> Very cool. I get 12.3 mil with updated example from RX14, but that seems to be the limit for this aging processor
<RX14> @sdogruyol wow thats terrible
<hightower5> lol
<FromGitter> <sdogruyol> 1) 7 ghz i5 and os x
<RX14> thats slower than a core 2 duo
<FromGitter> <sdogruyol> context switching is slower here
<FromGitter> <sdogruyol> :(
<RX14> it shouldn't be
<RX14> fiber switches require no syscalls
<FromGitter> <sdogruyol> it's :(
<FromGitter> <sdogruyol> i experience this before too
<RX14> there are no OS context switches
<FromGitter> <sdogruyol> and concluded that fiber's are slower on os x
<FromGitter> <sdogruyol> dunno why
<hightower5> sdogruyol: maybe check that your cpu is in performance mode instead of powersave? (you can do this with command "cpupower")
<RX14> no idea at all why fiber context switches would be slower
<hightower5> oh OS X, ok
<RX14> hightower5, here's the benchmark how I would have written it: https://gist.github.com/477636d4b036e74d14c899e26a939f52
<RX14> comes out as 23.4M
<RX14> which is similar
<FromGitter> <johnjansen> ~17 for the 1st, ~16 for the second ;-)
<RX14> 1M higher makes sense because the CPU cache is primed and the clock is turboed
<RX14> @johnjansen using my gist? that's in million?
<hightower5> Awesome, how do you get a guarantee that it's not going to just fill the channel while the other end didn't read it? Does a non-buffered channel have a length of 1?
<FromGitter> <johnjansen> haha yes
<hightower5> (RX14)
<RX14> @johnjansen on osx?
<FromGitter> <johnjansen> otherwise id come back tomorrow to tell you the answer ;-)
<RX14> or linux
<FromGitter> <johnjansen> osx
<RX14> huh
<RX14> maybe @sdogruyol needs to return his laptop
<RX14> hightower5, channels are unbuffered by default
<RX14> Channel#new gets you an unbuffered channel
<RX14> Channel#new(Int32) gets you a buffered one
<hightower5> RX14, right, right, I mean does unbuffered imply a length of 1?
<RX14> yes
<hightower5> ok got it, cool
<RX14> it essentialy has a "value" variable
<RX14> the buffered one uses a deque
<hightower5> thanks for the example, changing locations and bb in an hour
hightower5 has quit [Remote host closed the connection]
<RX14> so according to kcov crystal's specs don't have 100% converage
<RX14> lol
<FromGitter> <sdogruyol> @RX14 it's just OS X dont worry :P
<RX14> how come @johnjansen got a much better result then
<RX14> also on osx
<FromGitter> <sdogruyol> he got 17M i got 16.3M
<FromGitter> <sdogruyol> how's that much better?
<RX14> i thought you said 3 million
<RX14> i don't get edits from gitter
<FromGitter> <johnjansen> im doing several things here so let me dump the results in case i read something wrong
<RX14> remember
<FromGitter> <sdogruyol> oh ok
<FromGitter> <sdogruyol> anyway
<FromGitter> <justinledwards> any special build flags or anything?
<FromGitter> <sdogruyol> @hightower5 as you can see Crystal is really fast :P
<RX14> crystal run --release does it for me
<FromGitter> <justinledwards> 1) 536967192
<FromGitter> <johnjansen> RX14’s code ``` ⏎ Johns-MacBook-Pro:Desktop johnjansen$ crystal channels.cr --release ⏎ ⏎ 1) 89M ( 62.93ns) (± 8.62%) fastest ⏎ ... [https://gitter.im/crystal-lang/crystal?at=593b047f7503e2b70629a310]
<FromGitter> <justinledwards> 1) 41224898
<RX14> thats a lot of variability
<RX14> i got 0.3%
<FromGitter> <justinledwards> first on osx but 1 year older cpu
Kug3lis has joined #crystal-lang
<FromGitter> <justinledwards> 2nd was ubuntu
<FromGitter> <johnjansen> @hightower5’s code ``` ⏎ Johns-MacBook-Pro:Desktop johnjansen$ crystal channels.cr --release ⏎ ⏎ 1) 221482694 ⏎ 2) 002260372 ... [https://gitter.im/crystal-lang/crystal?at=593b04c3cf9c13503c6e59ae]
<FromGitter> <sdogruyol> 1) 32M ( 61.27ns) (± 6.12%) fastest
<RX14> osx sure makes those results variable
<RX14> linux just dedicates a core to it it seems
<FromGitter> <johnjansen> ```MacBook Pro (Retina, 15-inch, Mid 2014) ⏎ 2.2 GHz Intel Core i7 ⏎ 16 GB 1600 MHz DDR3``` [https://gitter.im/crystal-lang/crystal?at=593b04f9f31c8ced0c1dca74]
<FromGitter> <sdogruyol> ugh
<FromGitter> <justinledwards> 1) 02M ( 35.69ns) (± 0.92%) fastest
<FromGitter> <sdogruyol> you got an i7
<FromGitter> <justinledwards> little bit faster on rx14's
Kug3lis has quit [Client Quit]
<RX14> @justinledwards was that an i7?
<FromGitter> <justinledwards> yeah
<RX14> which model?
<RX14> it's measuring singlethread perf
<RX14> so
<FromGitter> <justinledwards> Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
<FromGitter> <bew> crystal doesn't use multi-core so it shouldn't do any diff to have a i3, i5, i7 no?
<RX14> ah 4Ghz
<RX14> that'd do it
<RX14> @bew the clockspeed and uarch helps
<FromGitter> <sdogruyol> 4GHZ lol
<RX14> newer CPUs and ones with higher clocks will do better
<RX14> it's a small program so L1 cache shouldn't help much apart from latency
<FromGitter> <bew> yeah clockspeed will do for sure
<RX14> i go to 3.8Ghz
<RX14> clock speed would only account for 24.5M
<RX14> so thats how much intel's uarch increases over 1 generator
<RX14> i'm an i5-3570k
<FromGitter> <sdogruyol> i'm curious how'd multi-threaded Crystal will do
<RX14> clock-corrected you still go from 4.5M to 28M
<FromGitter> <justinledwards> my 3771 non k only does 19.74M
<FromGitter> <justinledwards> but os x
<FromGitter> <justinledwards> 1) 74M ( 50.65ns) (± 1.50%) fastest
<RX14> wow whats that
<FromGitter> <justinledwards> 1) 5ghz
<RX14> lol
<RX14> seems high regardless
<RX14> it's more than double
<RX14> wait what
greengriminal has joined #crystal-lang
<FromGitter> <justinledwards> it's slower
<FromGitter> <justinledwards> by a lot
<FromGitter> <justinledwards> :D
<RX14> damnit stop editing
<FromGitter> <bew> \o/
<RX14> you should all use irc and like it :C
<thews> I didn't know you guys were on IRC
<thews> until after opening the gitter
<RX14> it should put the IRC prominently in the readme next to gitter
<FromGitter> <johnjansen> thanks to bridge bot
<RX14> I would never join a gitter
<RX14> i'd look for an irc first
<thews> the weird mac i7 cpu is on an iMac (27-inch, Late 2013)
<FromGitter> <sdogruyol> i like the bridge bot
<FromGitter> <sdogruyol> but no irc please :P
<RX14> oh ok the gitter is the same level as IRC in the readme
<FromGitter> <bew> gitter is good to keep the history, and get notifications
<RX14> thats fine then
<RX14> well I have a bouncer so
<RX14> that problem's solved
<FromGitter> <sdogruyol> for what?
<RX14> an irc bouncer
<RX14> it's basically a souped up irc proxy
<RX14> which records and plays back what happened when you were offline
<RX14> and does a bunch of cool things
<RX14> IRC takes a lot of effort to get how you like but after that I much prefer it to anything web based
<RX14> there's too many web chat systems with too meany features
<FromGitter> <bew> so you have a personnal server with the bouncer or do you rely on an external service? or do you have a main computer with it?
<RX14> i have a whole i3 workspace dedicated to them...
<RX14> I run a bouncer for about 20 people
<RX14> including me
<RX14> mostly on espernet but other places too
* Papierkorb also uses a bouncer
<Papierkorb> Can't even remember for how long
<RX14> i should update my znc lol
<RX14> but it works so nah
<FromGitter> <sdogruyol> what's a bouncer?
<RX14> @sdogruyol i explained above starting with "it's basically a souped up irc proxy"
<FromGitter> <sdogruyol> oh ok
<FromGitter> <sdogruyol> you used kcov for this?
<RX14> yup
<RX14> preparing a PR
<FromGitter> <sdogruyol> that's awesome
<RX14> on osx it's hard
<RX14> so i won't do it
<FromGitter> <sdogruyol> :(
plujon has joined #crystal-lang
<RX14> if you check through thr files you'll see that the coverage info is pretty bad
<RX14> i'm 90% sure this is because of crystal not kcov
<RX14> i've been profiling many times and seen completely nonsensical line data
<RX14> such as line numbers off the end of the file
<Yxhuvud> could it be due to macros?
<RX14> might be
<FromGitter> <straight-shoota> yup, I have noticed completely false locations aswell.
<RX14> check out string.cr
<RX14> it has coverage all over the doc comments
<FromGitter> <bew> the comments are working well then :D
<FromGitter> <straight-shoota> hehe, good docs need to be covered! =)
<FromGitter> <straight-shoota> I'm having issues with kcov since a few days... seems to run in an infinite loop. the executable itself runs and it does not seem to depend on the code, kcov can't even finish a simple hello world :/ dunno what's wrong there
<RX14> weird
<Yxhuvud> rx14: that is sort of how it could look if the macros keep the line number in whatever file that defined the macro, but the macro line numbers then get registered in the file that use them.
<RX14> could be
greengriminal has quit [Quit: This computer has gone to sleep]
<FromGitter> <straight-shoota> in callstacks macros locations are correct...
<FromGitter> <straight-shoota> but procs have issues
<FromGitter> <straight-shoota> or combination of macro and proc, I'm not sure
greengriminal has joined #crystal-lang
greengriminal has quit [Remote host closed the connection]
<crystal-gh> [crystal] RX14 opened pull request #4538: Add codecov reporting to travis (master...feature/travis-coverage) https://git.io/vHMjm
<crystal-gh> [crystal] asterite closed pull request #4537: Fixes a very minor comment typo in file_utils (master...file_utils_typo_fix) https://git.io/vHMMq
<FromGitter> <bigtunacan> Probably a stupid question for all of the language implementation gurus; but when I look at the Crystal source code itself I feel overwhelmed and not sure where to start. While I have many years programming experience none of that has been writing a language; any pointers would be great.
<FromGitter> <bew> you mean the stdlib or the compiler?
duckqlz has quit [Changing host]
duckqlz has joined #crystal-lang
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <bew> You might want to look at https://github.com/crystal-lang/crystal/wiki/Compiler-internals
<FromGitter> <bigtunacan> @bew thanks; compiler
<FromGitter> <bigtunacan> stdlib makes sense
<FromGitter> <bew> that's what I thought, it's the "easy" part of crystal!
<Papierkorb> bigtunacan, each compiler pretty much consists out of these phases: Reading source file(s) -> tokenizer (or scanner) -> parser -> semantic analysis (some simple ones don't need this) -> code generation
<Papierkorb> bigtunacan, You can find all of these steps in the crystal compiler too. No idea if learning about compilers through the crystal compiler is a good idea, maybe for a simpler language.
<Papierkorb> bigtunacan, that being said, here's a week-end project for you: Build a simple but properly working calculator. The user gives you some expression like `2+3*(4-5/2)`, then you 1) tokenize 2) parse 3) "code gen" (in this case, calculate the result) and print what it evaluates to
greengriminal has joined #crystal-lang
<Papierkorb> bigtunacan, when all of that works, add variables. And after variables work, `if` and some kind of loop. Don't mess with LLVM, write it as a simple interpreter. With all that done, you not only created a turing-complete programming language, but also learnt how compilers work (expect for the code gen part). And then you should be perfectly fine understanding what's going on in the crystal compiler.
<FromGitter> <bigtunacan> @Papierkorb i've done a few weekend projects and work through understanding computation. Currently I'm reading SI CP. Most of the stuff that I'm done with Crystal is web development or libraries, but I figured this is as good a time as any to start learning about how a real compiler works
<Papierkorb> SICP?
greengriminal has quit [Quit: This computer has gone to sleep]
greengriminal has joined #crystal-lang
<travis-ci> crystal-lang/crystal#b4e209b (master - Changes an f to a d): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/241359970
<FromGitter> <bigtunacan> It's a book from MIT that goes through creating a lisp like language compiler use the lisp
<FromGitter> <bew> cool *added to loong-to-read-list*
<FromGitter> <bigtunacan> It's like I just can't get past theory and make the connection to a real practical compiler
greengriminal has quit [Quit: Leaving]
manveru has quit [Ping timeout: 365 seconds]
manveru_ has joined #crystal-lang
Raimondi has quit [Write error: Broken pipe]
Raimondi has joined #crystal-lang
<hightower2> RX14, ran your Fiber benchmark test on my main computer here which is Linux ubuntu 4.8.0 on Intel i7-4790K CPU @ 4.00GHz
<hightower2> got 29Mil /s
<hightower2> Is there a module, similar/related to benchmark, that can be used for saving benchmark results and then comparing them to previous runs later?
plujon has quit [Remote host closed the connection]