jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.17.0 | 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
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
|2701 has joined #crystal-lang
|2701 has quit [Changing host]
|2701 has joined #crystal-lang
Philpax has quit [Ping timeout: 276 seconds]
Philpax has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
Rocky_ has quit [Read error: Connection reset by peer]
Philpax has quit [Ping timeout: 260 seconds]
pawnbox has joined #crystal-lang
DeBot has quit [Quit: Crystal IRC]
DeBot has joined #crystal-lang
ryanw-se has joined #crystal-lang
<ryanw-se> jhass: Sorry to bother, do you still have that code snippet you posted earlier? i accidentally misplaced it
<ryanw-se> it was related to my tcp socket question
<ryanw-se> and evented io stuff
<jhass> ?logs
<DeBot> You can find a log of this channel at http://irclog.whitequark.org/crystal-lang/
<jhass> :P
<ryanw-se> sweet
pawnbox has quit [Ping timeout: 260 seconds]
<jhass> ryanw-se: meanwhile I found we actually got delay https://carc.in/#/r/ypm
<ryanw-se> i wasn't very familiar with what evented i/o looks like in a ruby like language, but I notice the thread tends to be Object::<Watcher>, is the :: apart of the whole thing or am I reading into things too much
<ryanw-se> not thread, theme*
<ryanw-se> nvm im being stupid again
<jhass> note this is very different from evented IO ruby libs like EventMachine or Celluloid::IO
<jhass> API wise at least
<ryanw-se> yeah im realizing that now
<ryanw-se> is there any thing I should read / watch so I don't feel completely out of my element with this
<jhass> not sure there's anything yet, it's also all not finalized yet
<jhass> I can picture parallelism might change the existing APIs quite drastically
<jhass> there's also some ideas to language integration to the syntax/keyword level
<ryanw-se> you said something about how TCPSocket has evented i/o built in, how can I take advantage / use it?
<jhass> http://crystal-lang.org/docs/guides/concurrency.html is the best we have so far, but you already found that
<jhass> just use it & spawn
<ryanw-se> this is what i've currently got, its based off the example in the crystal repo
<jhass> right, so if a client blocks on reading or writing there and another one comes, it will be handled meanwhile
<jhass> due to each having their own fiber
<jhass> or in this case even when your stdout is too busy
<ryanw-se> right, that makes sense
<ryanw-se> but what I don't understand, is how I can move away from client.read_line, and actually work with the inputs/outputs (like i would in java)
<ryanw-se> I don't want to automatically treat everything as a string, i'm basically trying to figure out how to do something like if you were to write to tcp and then flush, but here I just want to run a block everytime new data comes in and handle it accordingly
<ryanw-se> in its "raw" form
<crystal-gh> [crystal] jhass opened pull request #2608: Add NamedTupleLiteral#map and HashLiteral#map (master...named_tuple_map) https://git.io/vrlKY
<jhass> ryanw-se: IO provides a couple of methods to read raw data, but you must know how many bytes you want to read
<jhass> but the theme isn't "call a block on new data" but "reschedule the fiber when new data is available, run other fibers meanwhile"
<ryanw-se> jhass: In this case I don't know how many bytes I want to read, because the information being sent to me is being sent in several different types (varint, string, unsigned short, etc)
<ryanw-se> the string bit works absolutely fine with read_line, its just the stuff like varint and unsigned short that come in all malformed
<jhass> well there gotta be a type tag or something?
<jhass> probably a single byte?
<jhass> yeah that doesn't specify what the field types actually are
<ryanw-se> it tells me to expect a varint, then a string, then unsigned short, then another varint
<ryanw-se> but thats pretty much all it tells me
<jhass> they don't define "varint" ?
<jhass> and string could mean with length header or 0 terminated
<jhass> unsigned short is the only somewhat clear thing, as short happens to be defined fairly platform dependent (iirc ANSI C doesn't guarantee that though)
fryguy9 has quit [Quit: Leaving.]
<jhass> there we go
<ryanw-se> still doesn't provide an exact amount though or am I missing something?
<jhass> probably broken by the amount of activity
pawnbox has joined #crystal-lang
<ryanw-se> that looks like exactly what I need
<ryanw-se> I could probably figure out what changed and submit a PR o:
<jhass> yeah it's probably all protobuf compatible
<ryanw-se> thanks a ton, that is really helpful
Philpax has joined #crystal-lang
<jhass> mh, that lib doesn't look IO oriented enough for my taste though
pawnbox has quit [Ping timeout: 240 seconds]
<jhass> yeah it inputs/outputs String's, that's bad
<jhass> it should read from and write to IOs
icezimm has joined #crystal-lang
<jhass> we even have API by now that would then allow you to Handshake.from_io(socket)
<ryanw-se> oh cool
<jhass> if it integrated that properly
<ryanw-se> this should help me get started though, then once I learn more I can help submit a PR with this stuff :)
<jhass> stdlib ships that for the primitives, UInt16.from_io(socket)
<ryanw-se> reading now
fryguy9 has joined #crystal-lang
fryguy9 has quit [Client Quit]
mgarciaisaia has joined #crystal-lang
mgarciaisaia has quit [Ping timeout: 260 seconds]
Philpax has quit [Ping timeout: 246 seconds]
mgarciaisaia has joined #crystal-lang
Philpax has joined #crystal-lang
willl has quit [Quit: Connection closed for inactivity]
|2701 has quit [Quit: Connection closed for inactivity]
pawnbox has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
pawnbox has quit [Ping timeout: 240 seconds]
fryguy9 has joined #crystal-lang
Oliphaunte has joined #crystal-lang
fryguy9 has quit [Quit: Leaving.]
Philpax has quit [Ping timeout: 246 seconds]
nwmcsween_ has quit [Ping timeout: 260 seconds]
Philpax has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
mgarciaisaia has quit [Quit: Leaving.]
pawnbox has joined #crystal-lang
Philpax has quit [Ping timeout: 246 seconds]
pawnbox has quit [Remote host closed the connection]
nwmcsween has joined #crystal-lang
nwmcsween is now known as Guest98408
Oliphaunte has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
zodiak_ has joined #crystal-lang
ryanw-se has quit [Quit: Leaving...]
trajing- has joined #crystal-lang
onionhammer has quit [Ping timeout: 246 seconds]
zodiak has quit [Ping timeout: 246 seconds]
trajing has quit [Ping timeout: 246 seconds]
onionhammer has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 246 seconds]
nwmcsween has joined #crystal-lang
nwmcsween is now known as Guest8959
Guest98408 has quit [Ping timeout: 260 seconds]
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
soveran has quit [Read error: Connection reset by peer]
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
trapped has joined #crystal-lang
<txdv> new release!
<txdv> new release!
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 260 seconds]
willl has joined #crystal-lang
<txdv> 100.times { Thread.new { sleep 1000; puts "Hello World!" } }
<txdv> is there a reason why something like this crashes?
SShrike has joined #crystal-lang
trapped has quit [Read error: Connection reset by peer]
<Bish> txdv: i think i remember people saying Threading has problems with IO, you're not supposed to use Thread with io ( yet, or ever )
<Bish> they're planning on having pools of fibers to handle parallel stuff
<Bish> 100.times { spawn { sleep 100;puts "Hello World" } };sleep 101
<txdv> i do indeed use stdout
<Bish> well but i was wrong, i testet it without the "puts"
<Bish> and it still crashed
<Bish> crystal users are not supposed to use thread, without knowledge what they're doing
<txdv> spawn creates fibers?
<Bish> yep
<Bish> indeed it's just a shortcut for spawning a fiber
<txdv> i can live with that for now
<txdv> how do fibers interact with sockets?
<Bish> well im guessing just like the main thread
<txdv> if a socket blocks, are other fibers being executed?
<Bish> i guess so, otherwise they would be pretty useless, wouldn't they
mark_66 has joined #crystal-lang
ql6wlld has joined #crystal-lang
elia has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Philpax has joined #crystal-lang
<jhass> txdv: yes, that's the main idea, fiber blocks on anything -> other fibers get scheduled meanwhile
joshcarter_ has joined #crystal-lang
jeromegn_ has joined #crystal-lang
aemadrid_ has joined #crystal-lang
aemadrid has quit [Ping timeout: 250 seconds]
jokke has quit [Ping timeout: 250 seconds]
joshcarter has quit [Ping timeout: 250 seconds]
jeromegn has quit [Ping timeout: 250 seconds]
ssvb has quit [Ping timeout: 250 seconds]
jeromegn_ is now known as jeromegn
joshcarter_ is now known as joshcarter
ssvb has joined #crystal-lang
aemadrid_ is now known as aemadrid
jokke has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
daemonwrangler has quit [Ping timeout: 276 seconds]
daemonwrangler has joined #crystal-lang
soveran has quit [Remote host closed the connection]
matp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
soveran has joined #crystal-lang
SShrike has quit [Quit: SShrike]
matp has joined #crystal-lang
soveran has quit [Remote host closed the connection]
<jhass> asterite: https://carc.in/#/r/yss bug right?
<BlaXpirit> neat bug
<crystal-gh> [crystal] jhass closed pull request #2018: Add Tuple#sample and Tuple#shuffle (master...tuple_sample) https://git.io/vr84F
poulet_a has joined #crystal-lang
kulelu88 has joined #crystal-lang
vegai has joined #crystal-lang
trapped has joined #crystal-lang
trapped has quit [Read error: Connection reset by peer]
|2701 has joined #crystal-lang
trapped has joined #crystal-lang
<txdv> is there a way to wait for all fibers to finish?
<jhass> I guess you could try reopening Scheduler and wait till @@runnables is empty
<jhass> not sure that'll even work though
<jhass> explicitly you could share a channel among all, keep track of how many you have running, do a send before exiting a fiber and n receive's in the main fiber
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Oliphaunte has joined #crystal-lang
grindhold has quit [Quit: No Ping reply in 180 seconds.]
grindhold has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 252 seconds]
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 [Remote host closed the connection]
pawnbox_ has joined #crystal-lang
nwmcsween has joined #crystal-lang
nwmcsween is now known as Guest78032
Guest8959 has quit [Ping timeout: 246 seconds]
<txdv> is it possible to define a struct of a certain size?
<jhass> well crystal should pick the minimal size
<jhass> what do you need it for?
<txdv> i know that the size of the libuvs uv_loop_t is 804 on my system, i just want to create a struct which is that big
<jhass> so you need to allocate it from Crystal?
<jhass> we usually do struct LoopT; _data : UInt8[804]; end then
<jhass> if you don't actually need to allocate it yourself, just alias LoopT = Void
nwmcsween_ has joined #crystal-lang
<txdv> o it goes inside
<txdv> well, libuv has a function which returns the sizes of the types
<txdv> so you don't have to hard code it
<jhass> mh
<txdv> but i need to use then malloc
<jhass> yeah
<jhass> or you would bind just that function and use a run macro to generate the lib code...
<|2701> I mentioned this the other day and got no response but (1..100).combinations(3).select{|a,b,c|(a*a)+(b*b)==(c*c)} doesnt bind a,b,c to the elements of the arrays, is there a way to simulate that with any of the new 0.17 features?
Guest78032 has quit [Ping timeout: 260 seconds]
<jhass> txdv: btw not sure how well mixing libevent and libuv in the same process will go
<jhass> |2701: no, see #2603
<txdv> crystal is using libevent by default?
<jhass> txdv: yes
<txdv> i saw it was linking against it
<|2701> dang, asterite must've seen it when I mentioned it then
<|2701> what a rad guy
Oliphaunte has joined #crystal-lang
nwmcsween__ has joined #crystal-lang
nwmcsween_ has quit [Ping timeout: 260 seconds]
<|2701> perhaps we could use #{...} or something, which would indicate unpacking when used outside of a string
<jhass> nah, Ruby's syntax should be fine
nwmcsween_ has joined #crystal-lang
<txdv> i guess there is no real need for libuv if there is already libevent2
<jhass> :)
<jhass> in fact Crystal started out with libuv but had to move to libevent2 due to some issues
Oliphaunte has quit [Ping timeout: 276 seconds]
nwmcsween__ has quit [Ping timeout: 260 seconds]
<txdv> what issues?
<txdv> so crystal is single threaded, uses libevent to get rid of all blocking calls
<txdv> and fibers for concurrency
<jhass> uh I don't quite remember
<jhass> there's plans to run fibers on a thread pool btw, so moving away from being single threaded
<|2701> is that definitely a goal?
<txdv> green threads on steroids
<icezimm> |2701: I read somewhere that it's a goal
<jhass> yes, it definitely is
<icezimm> let me try to find
<|2701> rad
<jhass> https://github.com/crystal-lang/crystal/commit/224650e493f3bccf439f2cf7b5b6b836330c4ff4 btw, I guess libevent just proved easier to use or more stable
<icezimm> |2701: https://salt.bountysource.com/teams/crystal-lang this is the first item
<|2701> I'm broke as a joke, but yeah, I'm glad that it's probably going to happen
<txdv> broke as a joke?
<|2701> yup
<|2701> poor life choices
Bish has quit [Remote host closed the connection]
<icezimm> hahaha I had to go on "urban dictionary" for this expression too hahah
<txdv> yo, ma man, that ain't no joke
<|2701> u know it
<txdv> jhass: nice, all the bindings are there
<txdv> but are anyway useless if everything is working with libevent just fine
Oliphaunte has joined #crystal-lang
poulet_a has left #crystal-lang [#crystal-lang]
Oliphaunte has quit [Ping timeout: 244 seconds]
<txdv> jhass: it doesn't have reflection yet though, right?
<txdv> like, get names and types of arguments of functions
<jhass> no runtime reflection, but compile time reflection which you can use to to generate code, in the most simple case store the stuff to make it accessible to the runtime
<jhass> http://crystal-lang.org/api/Crystal/Macros/Def.html here's what you can get about a method definition
kulelu88 has quit [Quit: Leaving]
<|2701> Dart's Mirrors would probably be good reading about reflection. I understand it was a rather novel invention. Sort of over my head
<txdv> is there a pastebin with execution support for crystal?
<txdv> jhass: i mean something like this: http://paste.debian.net/687079
Oliphaunte has joined #crystal-lang
<jhass> >> "yes"
<DeBot> jhass: # => "yes" - https://carc.in/#/r/ytl
<txdv> o that is runtime reflection
<jhass> macro's are run at compile time and generate code that's then fed back into the compiler
<txdv> can i get the ast of a class then?
<jhass> sure, that's a TypeNode
<jhass> inside a class context available as @type inside the macro language
<txdv> so i could write a macro, which iterates through a classes methods, its arguments and stores it in a global variable?
<jhass> sure
<txdv> there is some active record in crystal lang, it probably uses this as well?
<txdv> probably to the extend when the macro is in the constructor
<txdv> that the*
<txdv> ill dig in
<jhass> active_record.cr implements the active record pattern, it does not copy the activerecord gems interface or behavior
<txdv> i haven't looked too much into it
<txdv> but if you define a class and specify the fields
<txdv> it somehow needs to be aware of the fields
<txdv> ruby has dynamic reflection to do that
<txdv> hm, it uses "field"
<jhass> yeah, we can't add instance variables or methods based on the result of a database query or something like that
<txdv> probably a macro
<jhass> probably
Philpax has quit [Ping timeout: 252 seconds]
<txdv> hm, but dynamic invocation is not possible either
<jhass> yup
<jhass> you have to generate dispatching code
<jhass> artanis is a good example I think
<txdv> artanis?
<txdv> this will be a lot of meta programming
ozra has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vr4fd
<crystal-gh> crystal/master ac1ee1c Ary Borenszweig: Merge branch 'release/0.17'
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/vr4JO
<crystal-gh> crystal/master 1666d45 Jonne Haß: Add NamedTupleLiteral#map and HashLiteral#map...
<crystal-gh> crystal/master 0965124 Ary Borenszweig: Merge pull request #2608 from jhass/named_tuple_map...
<icezimm> what's the best way to create an C binding for crystal? use https://github.com/crystal-lang/crystal_lib and put directly on the project? or create a separated shard?
<jhass> I don't think crystal_lib is production ready yet
<jhass> at these times, I'd start out with putting it into the project directly and consider extracting to a shard when it proves generally useful/complete enough
<jhass> asterite: btw https://gist.github.com/jhass/48c6ec1aa732d7287432 is what we use to merge PRs to another branch than the target one, might give some workflow inspiration ;)
<jhass> *we use over at diaspora I mean
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vr4k0
<crystal-gh> crystal/master 6255714 Ary Borenszweig: Merge branch 'release/0.17'
<|2701> is diaspora going to move over to crystal?
<jhass> haha, no
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
<travis-ci> crystal-lang/crystal#0965124 (master - Merge pull request #2608 from jhass/named_tuple_map): The build was broken. https://travis-ci.org/crystal-lang/crystal/builds/131162131
<jhass> wut
|2701 has joined #crystal-lang
|2701 has quit [Changing host]
|2701 has joined #crystal-lang
<travis-ci> crystal-lang/crystal#6255714 (master - Merge branch 'release/0.17'): The build is still failing. https://travis-ci.org/crystal-lang/crystal/builds/131166306
<icezimm> jhass: thank you for the explanation, I'm gonna put inside the project atm heheh
LastWhisper____ has joined #crystal-lang
LastWhisper____ has quit [Read error: Connection reset by peer]
LastWhisper____ has joined #crystal-lang
elia has quit [Quit: Computer has gone to sleep.]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vr4Z6
<crystal-gh> crystal/master 6c8be57 Ary Borenszweig: Merge branch 'release/0.17'
<asterite> jhass: seems like the formatter check failed, but everything should be working fine. Since I already tagged 0.17.1 I'll make a release and then fix this
<asterite> Oh, didn't see it
<travis-ci> crystal-lang/crystal#6c8be57 (master - Merge branch 'release/0.17'): The build is still failing. https://travis-ci.org/crystal-lang/crystal/builds/131182386
mark_66 has quit [Remote host closed the connection]
Oliphaunte has quit [Remote host closed the connection]
mgarciaisaia has joined #crystal-lang
fryguy9 has joined #crystal-lang
fryguy91 has joined #crystal-lang
fryguy9 has quit [Ping timeout: 260 seconds]
ql6wlld has quit [Ping timeout: 276 seconds]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
mgarciaisaia has quit [Quit: Leaving.]
mgarciaisaia has joined #crystal-lang
mgarciaisaia has quit [Client Quit]
tomchapin has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
mgarciaisaia has quit [Client Quit]
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
<BlaXpirit> so I'm having this idea that you should be able to do everything with a namedtuple that you can do with a tuple
<BlaXpirit> that's what helped with their adoption in Python, anyway
<BlaXpirit> and a namedtuple with a particular sequence of types should be a subclass of tuple with a particular sequence of types
<BlaXpirit> I mean with the same sequence of types
<BlaXpirit> >> {a: 1, b: 2}.min # why not?
<DeBot> BlaXpirit: undefined method 'min' for {a: Int32, b: Int32} - https://carc.in/#/r/yu7
<BlaXpirit> like, it prevents you from giving names to tuple items just for clarity, and force you to use a normal tuple sometimes
<BlaXpirit> >> {a: 1, b: 2}[0] # why not?
<DeBot> BlaXpirit: no overload matches '{a: Int32, b: Int32}#[]' with type Int32 - https://carc.in/#/r/yu8
<jhass> I guess the decision is to keep Tuple and NamedTuple close or to keep NamedTuple and Hash as close as Tuple and Array
<jhass> and given named tuples have Ruby's new style hash syntax, the latter is compelling, too
<BlaXpirit> similarity between Tuple and Array is pointless, they're intentionally different, even semantically
<BlaXpirit> in Python I can say "use tuple as if it was a namedtuple without names"
<BlaXpirit> and not just because it's faster than an array
<jhass> >> {a: 1, b: 2}.values.min
<DeBot> jhass: # => 1 - https://carc.in/#/r/yu9
<BlaXpirit> oh, so that's the stuff
<jhass> it's all a values call away, no runtime overhead for calling .values either
<jhass> so I'd prefer interface consistency personally
<BlaXpirit> it's acceptable then
<BlaXpirit> >> {"a": 6}
<DeBot> BlaXpirit: # => {"a" => 6} - https://carc.in/#/r/yua
<BlaXpirit> >> {5: 6}
<DeBot> BlaXpirit: Syntax error in eval:21: expecting token '=>', not ':' - https://carc.in/#/r/yub
<BlaXpirit> curious
<BlaXpirit> good, but i still hate those fat arrows
mgarciaisaia has joined #crystal-lang
mgarciaisaia has left #crystal-lang [#crystal-lang]
mgarciaisaia has joined #crystal-lang
mgarciaisaia has quit [Quit: Leaving.]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
ryanw-se has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vr4h7
<crystal-gh> crystal/master d8895a4 Ary Borenszweig: Merge branch 'release/0.17'
pawnbox_ has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
mgarciaisaia has quit [Client Quit]
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 265 seconds]
pawnbox has joined #crystal-lang
Raimondii is now known as Raimondi
_whitelogger has joined #crystal-lang
soveran has quit [Remote host closed the connection]
fryguy91 has quit [Quit: Leaving.]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
trapped has quit [Read error: Connection reset by peer]
<crystal-gh> [crystal] splattael opened pull request #2615: Docker: Install git so shards works out of the box (master...patch-1) https://git.io/vrBON
fryguy9 has joined #crystal-lang
<txdv> jhass: is the irc bot written with crystal?
<jhass> yup
<jhass> stuck on 0.15 though atm
<txdv> inspired by cinch?
<jhass> a bit
<jhass> mainly because my previous bot was written in Cinch so porting the plugins was easier
Raimondii has joined #crystal-lang
fryguy9 has quit [Quit: Leaving.]
Raimondi has quit [Ping timeout: 265 seconds]
<txdv> is match a macro?
Oliphaunte has quit [Remote host closed the connection]
<jhass> hah I don't even remember, I think not
Raimondii is now known as Raimondi
<jhass> not sure it still needs to be though
<txdv> why?
<jhass> class method defined by included should work as well
<txdv> I don't understand that
<jhass> you see how it calls matchers?
<jhass> that's already a class method
<txdv> it just calls execute in the method
<jhass> yes
<jhass> no magic there, just give it the matchdata
<txdv> I was wondering if it is possible to do something like cinch does
<txdv> with match regex, method: :name
<jhass> probably
mjblack- has joined #crystal-lang
<txdv> lol the rep is called DeBot
<txdv> but readme says CeBot
<jhass> yeah, old bot was DeBot and I decided to push it into the same repo :P
<txdv> so that repo literally mutated to crystal?
<jhass> yup
<jhass> renamed master to ruby, pushed new master
<jhass> git checkout --orphan ftw
<txdv> this language, really exciting
<txdv> i need to sleep though
<txdv> good night
<jhass> night
<tilpner> Is there a tracking issue for rolling your own GC? I couldn't find one.
<jhass> not aware of any
<jhass> but the needed interface is simple enough https://github.com/crystal-lang/crystal/tree/master/src/gc
<jhass> override those methods and you're good
<jhass> null.cr is basically an example/template
<tilpner> This doesn't look sufficient for a precise GC though. Is there tracing type information that I'm missing here?
<jhass> no that's all, that's simply not available afaik
<jhass> the interface was built with integrating boehm GC for now in mind after all
<tilpner> Yes, seems reasonable. Macros might help generate the tracing code though.
<jhass> what tracing information would you want? reference counting?
Philpax has joined #crystal-lang
<tilpner> Most simple scenario, a naive mark&sweep. I have a struct, and I can mark it. I also need to mark all GC-ed fields of that struct, to indicate they are still reachable/alive. The tracing code would probably recursively visit all GC-ed fields.
<jhass> (maybe watch terminology here, crystal structs are stack allocated unless you do Pointer vodoo to heap allocate one)
LastWhisper____ has quit [Ping timeout: 260 seconds]
<tilpner> How does that affect this? :/
<jhass> it means they're pass by value and gone the moment the stackframe is gone (the function returns), the GC never sees a Crystal struct instance, opposed to a class instance
<tilpner> If I have a struct that contains a string, I still need to mark the string, so I can't not trace the struct too, even if the struct itself won't be gc-ed.
<jhass> mh, right
<tilpner> But yes, I might confuse terminology a little. :)
mjblack has quit [Quit: ZNC - http://znc.in]
mjblack- is now known as mjblack
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
mjblack- has joined #crystal-lang
mjblack- has quit [Client Quit]
mjblack- has joined #crystal-lang
mjblack- has quit [Client Quit]
mjblack- has joined #crystal-lang
mjblack- has quit [Quit: ZNC - http://znc.in]
mjblack- has joined #crystal-lang
mjblack- is now known as mjblack
mjblack has quit [Quit: ZNC - http://znc.in]