RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.19.2 | 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
onethirtyfive has joined #crystal-lang
Philpax has joined #crystal-lang
snsei has quit [Remote host closed the connection]
wmoxam has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 272 seconds]
kulelu88 has quit [Quit: Leaving]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 264 seconds]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 255 seconds]
early has quit [Quit: Leaving]
early has joined #crystal-lang
onethirtyfive has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
soveran has joined #crystal-lang
Philpax has quit [Read error: Connection reset by peer]
soveran has quit [Ping timeout: 244 seconds]
pawnbox has quit [Remote host closed the connection]
jamie_ca has quit [Remote host closed the connection]
jamie_ca has joined #crystal-lang
Philpax has joined #crystal-lang
pawnbox has joined #crystal-lang
snsei has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
snsei has quit [Ping timeout: 272 seconds]
onethirtyfive has joined #crystal-lang
onethirtyfive has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
ponga has joined #crystal-lang
eizua has joined #crystal-lang
Raimondii has joined #crystal-lang
daemonwrangler_ has joined #crystal-lang
justinmcp_ has joined #crystal-lang
ryanf_ has joined #crystal-lang
dostoyev1ky has joined #crystal-lang
bazaar_ has joined #crystal-lang
dostoyev1ky has quit [Client Quit]
dostoyev1ky has joined #crystal-lang
aarongodin_ has joined #crystal-lang
mjblack- has joined #crystal-lang
jamie_ca- has joined #crystal-lang
[spoiler] has joined #crystal-lang
omninonsense has quit [*.net *.split]
gewo1 has quit [*.net *.split]
emmanueloga has quit [*.net *.split]
aarongodin has quit [*.net *.split]
jamie_ca_ has quit [*.net *.split]
daemonwrangler has quit [*.net *.split]
Majost has quit [*.net *.split]
ryanf has quit [*.net *.split]
nickc has quit [*.net *.split]
bazaar has quit [*.net *.split]
justinmcp has quit [*.net *.split]
dostoyevsky has quit [*.net *.split]
pduncan has quit [*.net *.split]
mjblack has quit [*.net *.split]
Raimondi has quit [*.net *.split]
mose has quit [*.net *.split]
fedruantine has quit [*.net *.split]
Raimondii is now known as Raimondi
mjblack- is now known as mjblack
fedruantine has joined #crystal-lang
Majost has joined #crystal-lang
aarongodin_ is now known as aarongodin
dostoyev1ky is now known as dostoyevsky
pawnbox has joined #crystal-lang
emmanueloga has joined #crystal-lang
daemonwrangler_ is now known as daemonwrangler
pduncan has joined #crystal-lang
gewo1 has joined #crystal-lang
mose has joined #crystal-lang
nickc has joined #crystal-lang
soveran has joined #crystal-lang
snsei has joined #crystal-lang
soveran has quit [Ping timeout: 272 seconds]
snsei has quit [Ping timeout: 255 seconds]
fp_preist has joined #crystal-lang
soveran has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 255 seconds]
mark_66 has joined #crystal-lang
sandelius has joined #crystal-lang
oddmunds1 is now known as oddmunds
Philpax has quit [Ping timeout: 265 seconds]
bjz_ has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 265 seconds]
Philpax has joined #crystal-lang
Philpax has quit [Read error: Connection reset by peer]
Philpax has joined #crystal-lang
pawnbox has joined #crystal-lang
bew78 has joined #crystal-lang
<bew78> Hello ! I've read somewhere that we should prefer struct over class, but I just read that class are passed by reference, and struct by value.. I thought reference is better, so why using struct ?
fp_preist has quit []
fp_preist has joined #crystal-lang
<BlaXpirit> bew78, so where exactly did you read that?
<BlaXpirit> bew78, you use struct to avoid memory allocation on the heap and the need for garbage collection. if used carefully, it improves performance
<bew78> but, when something is passed by value, it makes a copy, am I right ?
<BlaXpirit> bew78, yes
<BlaXpirit> bew78, i still don't see where it says "prefer" or anything like thta
<bew78> Doesn't it takes longer than aloocating once on the heap, then pass it by reference?
<BlaXpirit> bew78, just imagine this
<BlaXpirit> class Point; property x, y: Float64; end
<BlaXpirit> and you make 10000 of points every second
<BlaXpirit> each of these points appears in a random place in the memory
<BlaXpirit> and the garbage collector has to keep track of all of them and delete them
<BlaXpirit> do you get how this can be very inefficient? (also mind the "random place" part - it also negatively affects CPU cache)
<bew78> hum I see, but how is it better with stack alloc ?
<BlaXpirit> bew78, well for one, if you have an array of points, they're all located in memory exactly one after the other
<BlaXpirit> but with class it's an array of references and each point is in a random location far away in the heap
<bew78> Nice point
soveran has quit [Remote host closed the connection]
fp_preist has quit []
<bew78> Arrays are in heap and tuple in stack ?
<BlaXpirit> bew78, yes
<BlaXpirit> but anything can be in the heap, if there is at least one reference involved above it
<BlaXpirit> array of tuples will be in the heap, but the tuples will be located sequentially one after the other
<bew78> I'm not sure I understand your last msg.. the array is in the heap but the content of the array can be in the stack ?
<bew78> BlaXpirit:
<BlaXpirit> bew78, no, the content will not be in the stack
<bew78> sorry but then don't understand your exemple with array of tuples..
<bew78> +I
<bew78> BlaXpirit: sorry but then I don't understand your exemple with array of tuples..
eizua has quit [Quit: Leaving]
<BlaXpirit> bew78, very hard to follow the example, but here it is https://carc.in/#/r/1auf
<bew78> I have to leave for now, I'll look at this, then come back later
<bew78> BlaXpirit: thanks
<BlaXpirit> for whatever reason, the stack has a higher address than the heap
bew78 has quit [Ping timeout: 265 seconds]
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
snsei has joined #crystal-lang
daemonwrangler has quit []
snsei has quit [Ping timeout: 255 seconds]
bew78 has joined #crystal-lang
bazaar_ has quit [Quit: leaving]
bazaar has joined #crystal-lang
bew78 has quit [Ping timeout: 265 seconds]
bew78 has joined #crystal-lang
sandelius has quit [Quit: Textual IRC Client: www.textualapp.com]
rtl has quit [Ping timeout: 250 seconds]
rtl has joined #crystal-lang
trapped has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
snsei has joined #crystal-lang
pawnbox has quit [Ping timeout: 244 seconds]
snsei has quit [Ping timeout: 272 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 264 seconds]
pawnbox has joined #crystal-lang
<bew78> Hi, I'm trying to use the lib cli (https://github.com/mosop/cli) with the example for subcommands (https://github.com/mosop/cli#subcommands) But I get an error saying that it can't find the method 'caption' after a quick look at the code, 'caption' is a macro, but I don't know why crystal can't find it..
<bew78> Hi, I'm trying to use the lib cli (https://github.com/mosop/cli) with the example for subcommands (https://github.com/mosop/cli#subcommands) But I get an error saying that it can't find the method 'caption' after a quick look at the code, 'caption' is a macro, but I don't know why crystal can't find it..
<BlaXpirit> bew78, show code pls. maybe u forgot to subclass something
trapped has quit [Read error: Connection reset by peer]
<bew78> BlaXpirit: This is the sample given for subcommands at https://github.com/mosop/cli#subcommands
<bew78> I just added 'require "cli"' at the top
<BlaXpirit> bew78, i get the same error and have no idea what's going on with that lib
<bew78> ok, thanks. I'll open an issue and will try something else until it's resolved
<BlaXpirit> so i'm writing specs for my library and every test in a file needs a helper class. i think it would be a huge mess to dump those classes at the beginning or the end of the file because they make no sense alone. what are my alternatives?
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Read error: Connection reset by peer]
pawnbox has joined #crystal-lang
pawnbox has quit [Read error: No route to host]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 252 seconds]
_whitelogger has joined #crystal-lang
Philpax has quit [Ping timeout: 244 seconds]
mjblack has left #crystal-lang ["Closing Window"]
mjblack has joined #crystal-lang
_whitelogger_ has joined #crystal-lang
soveran has joined #crystal-lang
<bew78> Is there a way to use OptionParser on multiple level of options ? Exemple with git would be: an OptionParser on 'git' to handle 'clone'/'commit' etc.. and another OptionParser on 'commit' to handle commit options like '-m', '-a', etc.. ? how to get the leading Args to parse ?
<bew78> *pending args to parse
snsei has joined #crystal-lang
avdi has quit [Ping timeout: 265 seconds]
avdi has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/vipyC
<crystal-gh> crystal/master cef67da Ary Borenszweig: Compiler: fixed a few wrong parse cases
<crystal-gh> crystal/master 612ff0f Ary Borenszweig: Fixed #3351: correctly restrict virtual generic instance type against generic
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
<rkeene> Who wants to port the Wt bindings from Ruby to Crystal ? :-D
<RX14> it shouldn't be that hard...
<rkeene> I'm just hoping someone else does it since I don't want to :-D
<bew78> I didn't know that wt thing, it's pretty cool !!
<rkeene> Yeah, I was asking about it a while ago but nothing existed like it for Crystal and I just found out they have Ruby bindings
<rkeene> I wrote something similar to it for Tcl (a long time ago... 13 years ago)
pawnbox has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
<travis-ci> crystal-lang/crystal#cef67da (master - Compiler: fixed a few wrong parse cases): The build has errored. https://travis-ci.org/crystal-lang/crystal/builds/162826835
snsei has quit [Remote host closed the connection]
bew78 has quit [Ping timeout: 244 seconds]
mgarciaisaia has quit [Read error: Connection reset by peer]
<travis-ci> crystal-lang/crystal#cef67da (master - Compiler: fixed a few wrong parse cases): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/162826835
pawnbox has quit [Remote host closed the connection]
<crystal-gh> [crystal] Nephos opened pull request #3356: [WIP] Add StaticArray improvements (master...feature/better_static_array) https://git.io/vipxS
pawnbox has joined #crystal-lang
<BlaXpirit> how can I get the type of the class that a macro was written inside, not the current type?
<BlaXpirit> for https://carc.in/#/r/1avi I want the output A \\ A
<crystal-gh> [crystal] asterite pushed 3 new commits to master: https://git.io/vihTX
<crystal-gh> crystal/master a41a742 Julien Portalier: Fix: missing Errno::E2BIG constant
<crystal-gh> crystal/master bf6b743 Ary Borenszweig: Merge pull request #3306 from ysbaddaden/core-fix-iconv-error-handling...
<crystal-gh> crystal/master 0f5c684 Julien Portalier: Fix: check return value of icon_open...
ryanf_ is now known as ryanf
snsei has joined #crystal-lang
bew78 has joined #crystal-lang
onethirtyfive has joined #crystal-lang
kulelu88 has joined #crystal-lang
<travis-ci> crystal-lang/crystal#bf6b743 (master - Merge pull request #3306 from ysbaddaden/core-fix-iconv-error-handling): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/162862455
<DeBot> https://github.com/crystal-lang/crystal/pull/3306 (Fix iconv error handling)
onethirtyfive has quit [Remote host closed the connection]
snsei has quit [Remote host closed the connection]
ponga has quit [Quit: Connection closed for inactivity]
onethirtyfive has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 255 seconds]
onethirtyfive has quit [Ping timeout: 255 seconds]
matp has quit [Quit: Bye!]
matp has joined #crystal-lang
pawnbox_ has joined #crystal-lang
pawnbox has quit [Read error: Connection reset by peer]
pawnbox_ has quit [Remote host closed the connection]
bew78 has quit [Ping timeout: 260 seconds]
eizua has joined #crystal-lang
onethirtyfive has joined #crystal-lang
soveran has quit [Remote host closed the connection]
onethirtyfive has quit [Ping timeout: 265 seconds]
eizua has quit [Remote host closed the connection]
soveran has joined #crystal-lang
snsei has joined #crystal-lang
willl has joined #crystal-lang
snsei has quit [Ping timeout: 255 seconds]
soveran has quit [Remote host closed the connection]
bjz_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
bjz has quit [Client Quit]
bjz has joined #crystal-lang
onethirtyfive has joined #crystal-lang
bjz has quit [Client Quit]
onethirtyfive has quit [Ping timeout: 264 seconds]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 255 seconds]
Philpax has joined #crystal-lang