ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.21.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
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
greengriminal has quit [Quit: This computer has gone to sleep]
Split has joined #crystal-lang
bjz has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
zipR4ND has quit [Ping timeout: 260 seconds]
bjz has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondi has joined #crystal-lang
Philpax has quit [Ping timeout: 260 seconds]
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 252 seconds]
Raimondii is now known as Raimondi
sz0 has joined #crystal-lang
mark_66 has joined #crystal-lang
McSoFake has joined #crystal-lang
zipR4ND has joined #crystal-lang
Philpax has joined #crystal-lang
shelvacu has quit [Quit: Goodbye for now]
shelvacu has joined #crystal-lang
sz0 has quit [Quit: Connection closed for inactivity]
greengriminal has joined #crystal-lang
Philpax_ has joined #crystal-lang
Philpax has quit [Ping timeout: 268 seconds]
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 240 seconds]
greengriminal has quit [Quit: This computer has gone to sleep]
mark_66 has quit [Quit: Leaving.]
zipR4ND has quit [Ping timeout: 240 seconds]
greengriminal has joined #crystal-lang
greengriminal has quit [Client Quit]
McSoFake has quit [Quit: No reason]
zipR4ND has joined #crystal-lang
<RX14> `GC.collect` segfaults for me after using WeakRef.new on ArchLinux
<RX14> oh i know why
<RX14> WeakRef.new("foo") is illegal
<RX14> because "foo" is in ro memory
<jhass> wonder whether WeakRef should be transparent to that
<RX14> yeah
<RX14> I don't think it's really possible to tell
<RX14> well I wouldn't know
<RX14> but I think it'd be expensive to check
<jhass> mh, a process must have an easy way to know its memory regions, no?
<RX14> i'm sure it'd be a syscall
<jhass> with that it becomes checking what the address is in
<RX14> well it's "only" a segfault
<RX14> and one that is very unlikely to come up outside of example code
<jhass> idk it feels like it's hurting generality quite a bit
<RX14> It would be nice
<RX14> but i'm concerned about the performance hit
<jhass> say once we have a nice way to put large blobs into the ro section, like graphics
<RX14> particularly because wekref is likely to be used most where performance matters
<jhass> a graphics lib should be indifferent on whether it came from a file or there
poikon has quit []
poikon has joined #crystal-lang
<RX14> What is WeakRef.allocate for
<RX14> and why doesn't it call register_dissapearing_link
<RX14> oh i see it uses malloc_atomic which means the GC will assume the contents doesn't contain pointers
<RX14> it's a bit confusing
<RX14> maybe it should be :nodoc:
<jhass> I wonder whether checking https://github.com/ivmai/bdwgc/blob/master/include/gc.h#L515 would be enough
<RX14> yes
<RX14> I think so
<RX14> that's a great idea
<RX14> you should send a PR
<jhass> heh, you're the one with the problem :P
<RX14> i'
<RX14> d benchmark it though
<RX14> well it's your idea
<FromGitter> <sdogruyol> boehm surprises me every time with this tiny but important details
<jhass> target is shitty, it should be called get
<RX14> i agree
bjz_ has quit [Ping timeout: 255 seconds]
bjz has joined #crystal-lang
<jhass> mh, 1.5 times slower
<jhass> ~70ns vs ~110ns on my machine
<RX14> hmm
<RX14> i'd say thats acceptable
<jhass> the fun part, passing a non heap pointer actually gets faster
<jhass> (~95ns vs ~87ns)
<RX14> it raises?
<jhass> no, it just doesn't register with the GC
<RX14> oh
<jhass> since the value can't disappear right?
<RX14> yeah
<jhass> well I guess it could if it's stack memory
<jhass> but nothing the GC needs to be bothered with
<RX14> Pointer is unsafe so
<RX14> we can just say that if you make a pointer on the stack you're in for trouble anyway
<jhass> :D
<RX14> I honestly can't wait for asterite to implement escape analysis
LastWhisper____ has joined #crystal-lang
<RX14> I think it'll be a huge performance win overall
<RX14> especially if it's cross-function
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<crystal-gh> [crystal] jhass opened pull request #4293: Allow passing non heap objects to WeakRef (master...feature/non_heap_weak_ref) https://git.io/vSQZ3
<FromGitter> <asterite> @RX14 single-msqueue is a fork of thread-support that uses a single message queue with atomic operations. It's the current branch being worked on
<RX14> i'm not really up to date on the threading implementation
<RX14> what is the message queue used for?
Philpax_ has quit [Ping timeout: 255 seconds]
<FromGitter> <asterite> There's a queue of fibers and threads get fibers from there to execute. I honestly don't know much about it because I'm not the one working on that branch :-)
<FromGitter> <chuckremes> That sounds interesting. It means that fibers can migrate between threads. I’d be interested to hear about cache effects and cache locality issues. That single queue will also run pretty hot (for contention) on a system with 8+ cores.
adam12 has quit [Quit: ZNC - http://znc.in]
adam_ has joined #crystal-lang
adam_ is now known as adam12
<RX14> I thought we were doing work stealing...
<RX14> I guess single-msqueue abandons that...
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <eliasjpr> Hey, so I have this class that gets initialize and one of the instance var is of type Bear and on assignment I am passing a GrizzlyBear < Bear and the compiler is shouting at me that there is no overload matching GrizzlyBear I was wondering how I can define the instance variable of type Bear?
<FromGitter> <eliasjpr> ```@bear = Bear.new of Bear```
<RX14> @eliasjpr works for me: eliasjpr
<RX14> oops
<RX14> sorry
<RX14> meant to link this
<RX14> if you want to cast you use .as(Bear) but it should work without
<FromGitter> <eliasjpr> okay a small caveat is that Im doing this inside a macro
<FromGitter> <eliasjpr> can that be the reason?
p0p0pr37 has quit [Read error: Connection reset by peer]
sz0 has joined #crystal-lang
<RX14> it could be
<RX14> i'd need code to try out to say
p0p0pr37 has joined #crystal-lang
p0p0pr37 has joined #crystal-lang
<FromGitter> <eliasjpr> working on it
<FromGitter> <bew> @eliasjpr did you manage to get it work? (I don't understand what could go wrong in macros..)
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
j2k has joined #crystal-lang
bjz has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <kaniini> hi all, what is a good strategy to use to bootstrap crystal on a system that does not have crystal?
<jhass> get a precompiled crystal that's compatible
<jhass> if there's none you got to cross compile
<FromGitter> <kaniini> any docs on that process
<jhass> not really, basically you get a system that can compile the compiler, then run bin/crystal build --cross-compile target-triple src/compiler/crystal.cr
<jhass> then copy the .o over and link it with the given command
<jhass> then repeat the setup for the compiler on the target compiler and compile it again using the cross compiled compiler
<jhass> and then you're bootstrapped
<FromGitter> <kaniini> as an initial step i am just trying to go from x86_64-glibc to x86_64-musl
<jhass> shouldn't have julien a compiler for that somewhere?
<jhass> mh, no binaries I guess https://github.com/ysbaddaden/crystal-alpine
<jhass> that is besides apline packages
<FromGitter> <kaniini> yes, the goal is to get that into alpine proper
<FromGitter> <kaniini> however, to do that, builds need to be reproducible
<jhass> you mean as byte exact same binary after multiple compiles?
<jhass> crystal fails to do that generically
<FromGitter> <kaniini> not that strict, but it should be possible to rebuild the package for a new architecture
<FromGitter> <kaniini> a thought i had was to bootstrap from the third-party package
<jhass> could work
greengriminal has joined #crystal-lang
<FromGitter> <kaniini> the other option would be to fix the glibc emulator
<FromGitter> <eliasjpr> @bew hey so Im still getting the error, wrote a couple of tests around this case in order to debug
sz0 has quit [Quit: Connection closed for inactivity]
zipR4ND has quit [Ping timeout: 240 seconds]
<FromGitter> <eliasjpr> @bew thanks for helping I actually solve it. It was a proc that was passing a different type than the one I was expecting
j2k has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Split is now known as splitty_
<FromGitter> <bew> @eliasjpr didn't do much! I'm glad you solved it :)
j2k has joined #crystal-lang
j2k has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
<FromGitter> <KCreate> @jhass is carc.in down again?
<jhass> mh, I can reach it
<FromGitter> <bew> it's down for me too
<jhass> oh, ipv4 is down
<FromGitter> <bew> (france)
<crystal-gh> [crystal] Fryguy opened pull request #4297: Fix formatting of String Array literals containing right parens (master...fix_format_string_array_literal_with_paren) https://git.io/vS7tR
<FromGitter> <bew> what do you mean "ipv4 is down" ?
<jhass> there
<jhass> killed the port forward for v4 by accident, sorry
<FromGitter> <KCreate> works again for me
<FromGitter> <KCreate> thanks!
<FromGitter> <bew> oh.. works again here too, ty
<FromGitter> <KCreate> btw, what does anyone think about having a `Slice#bytes` method, which returns a slice of the underlying bytes no matter what the generic type of the slice is?
<FromGitter> <KCreate> https://carc.in/#/r/1v61
<FromGitter> <KCreate> did i miss any obvious corner cases?
<FromGitter> <bew> side-note: I would call it `Slice#to_bytes` because it clearly "create" sth ffrom sth else
jokke1 is now known as jokke
<FromGitter> <KCreate> Why the extra bound check?
<FromGitter> <KCreate> https://carc.in/#/r/1v6e
justinmcp has quit [Ping timeout: 264 seconds]
justinmcp has joined #crystal-lang
zipR4ND has joined #crystal-lang
justinmcp has quit [Ping timeout: 260 seconds]
justinmcp has joined #crystal-lang