ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.20.5 | 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
<splitty_> Hey RX14, our Discord is kind of dead, the core development team is on Slack now.
<splitty_> If that's okay for you, just pm me your e-mail and I'll add you when I'm home (probably Saturday)
<jokke> splitty_: you're the guy writing an os in crystal?
Dreamer3 has joined #crystal-lang
<splitty_> jokke, yeah
<jokke> cool :)
<splitty_> Don't expect too much though, I'm in the process of rewriting it and it isn't really usable right now
<splitty_> The master branch should be relatively stable though :D
<jokke> splitty_: do you know if there's a way to assign variables/constants/functions to specific linker sections?
<splitty_> I'm sorry, I really have to go now. 1AM here and I need to get up early :D
<splitty_> Hmm I don't think that's possible
<jokke> o sorry
<splitty_> As far as I know, everything goes to .text
<jokke> yeah 1AM here too :)
<splitty_> Maybe some constants go to .data or .rodata
<splitty_> jokke, Germany? :D
<jokke> mmh :/
<jokke> yeah
<splitty_> Ah nice, me too
<jokke> ah :)
<jokke> i'd need this for trying to bring crystal to bare metal
<jokke> i know rust can do this
<splitty_> Well if you need help with anything OSdev related, or are interested in the project, PM me your email and I'll add you to the slack :D
<splitty_> Oh, really? I wrote a small OS in Rust and never did that. I honestly don't see how it'd be useful though
<jokke> sure, cool thanks :)
<jokke> for interrupt vectors
<jokke> they have to be at a specific section
<splitty_> Ah well. I implemented most of the IDT in assembly :D
<jokke> yeah it'd be neat to be able to do that in crystal tho :)
<jokke> with ->interrupt_handler
<jokke> :)
<splitty_> Maybe you can enforce it with inline assembly :P
<jokke> i can do inline assembly in crystal??
<splitty_> Yep, LLVM inline assembly, AS-style.
<splitty_> Just asm("whatever")
<splitty_> Here's a helpful list of constraints
<splitty_> Really need to go now, see you :D
<jokke> oh wow
<jokke> thanks!
<jokke> yeah see you!
<splitty_> any time :)
Dreamer3 has quit [Ping timeout: 248 seconds]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 240 seconds]
Dreamer3 has joined #crystal-lang
unshadow has quit [Ping timeout: 258 seconds]
unshadow has joined #crystal-lang
<bmcginty> Anyone know if there's a way to see what output travis is giving for build errors? My last PR failed, but I'm compiling and it just fine from here...running [
<jokke> sure
<jokke> click on the link
<bmcginty> jokke: I tried that and I don't get anything other than that the build failed. I'm using some text-to-speech software, so I might be running into a snag with the travis sites accessibility...
<jokke> ah i see
<jokke> bmcginty: No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.
<bmcginty> jokke: I've got the elapsed time and total time, then it lists other jobs that have been run on the crystal repo. Is there something there I should be seeing?
<jokke> the macos build
<bmcginty> jokke: ah. okay. thanks.
<jokke> any time :)
sz0 has joined #crystal-lang
<bmcginty> Hmm. Wonder if I could get a mac environment vm to try building on. off to google.
<jokke> :)
akwiatkowski has quit [Ping timeout: 240 seconds]
<crystal-gh> [crystal] Sija opened pull request #3942: More docs cleanup (master...cleanup-docs) https://git.io/vDvJa
mgarciaisaia has joined #crystal-lang
marciogm has joined #crystal-lang
soveran has joined #crystal-lang
dhk has joined #crystal-lang
soveran has quit [Ping timeout: 240 seconds]
dhk has quit [Quit: Leaving]
marciogm has quit [Ping timeout: 248 seconds]
mgarciaisaia has quit [Ping timeout: 248 seconds]
mgarciaisaia has joined #crystal-lang
mgarciaisaia has quit [Ping timeout: 248 seconds]
mgarciaisaia has joined #crystal-lang
shelvacu has quit [Quit: Goodbye for now]
sz0 has quit [Quit: Connection closed for inactivity]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 245 seconds]
bjz has joined #crystal-lang
bjz has quit [Read error: Connection reset by peer]
bjz has joined #crystal-lang
bjz has quit [Client Quit]
mgarciaisaia has quit [Ping timeout: 240 seconds]
soveran has joined #crystal-lang
mrus has joined #crystal-lang
soveran has quit [Ping timeout: 240 seconds]
shelvacu has joined #crystal-lang
mrus has quit [Quit: leaving]
bjz has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
akwiatkowski has joined #crystal-lang
mark_66 has joined #crystal-lang
<jokke> hi
<jokke> is there a flag to ignore optimization for a constant so that even if it's never referenced it will be in the resulting binary?
matp has quit [Remote host closed the connection]
Ven has joined #crystal-lang
matp has joined #crystal-lang
gloscombe has joined #crystal-lang
Raimondi has quit [Read error: Connection reset by peer]
Raimondi has joined #crystal-lang
bjz has quit [Ping timeout: 240 seconds]
bjz_ has joined #crystal-lang
akwiatkowski has quit [Quit: Konversation terminated!]
triangles has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
M-mva1985 has quit [Remote host closed the connection]
kodotest[m] has quit [Remote host closed the connection]
braidn[m] has quit [Read error: Connection reset by peer]
acheron[m] has quit [Read error: Connection reset by peer]
TheGillies has quit [Write error: Connection reset by peer]
Vallkury[m] has quit [Write error: Connection reset by peer]
braidn[m] has joined #crystal-lang
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
acheron[m] has joined #crystal-lang
kodotest[m] has joined #crystal-lang
M-mva1985 has joined #crystal-lang
TheGillies has joined #crystal-lang
Vallkury[m] has joined #crystal-lang
Ven has joined #crystal-lang
unshadow_ has joined #crystal-lang
unshadow has quit [Ping timeout: 252 seconds]
triangles has quit [Quit: Leaving]
bjz_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mrus has joined #crystal-lang
splitty_ has quit [Ping timeout: 256 seconds]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
<unshadow_> Can someone try the `make static` at https://github.com/bararchy/sslscanner/ and tell me if it works for you ? (Not working for me on Arch Linux C-0.20.5)
unshadow_ is now known as unshadow
<jokke> unshadow: i would but i'm also on arch
<unshadow> jokke: thanks :) on Arch they removed all static libs so it's a huge pain to static compile it (libC is giving massive errors)
<jokke> yeah
Renich has quit [Quit: leaving]
<jeromegn> unshadow: I can try on macos
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<unshadow> jeromegn: Cool ! Thanks dude
<jeromegn> do I need special libs? looks like the linker failed on my first attempt
<jeromegn> library not found lcrt0... mmm
Ven has joined #crystal-lang
<wmoxam> Anyone have experience with Crystal + travis-ci? I'm getting timeouts with no output ... could that be related to using too much memory or some other resource problem?
<unshadow> Hm.... I didnt get that error, for me it fully compiled, but then the bin throws big issues
<unshadow> jeromegn: does regular make works ?
<jeromegn> it did work with regular make
<unshadow> Hm.....
<jeromegn> yea, appears to be a macos thing that gives that lcrt0 lib not found
<jeromegn> anybody know how I can cleanly reuse a TCPSocket?
<jeromegn> I'm trying to use a generic TCP connection pool (from the pool shard from ysbaddaden) but I can't check the connections back into the pool after use because they don't seem to clean up well. Definitely my bad... I think I probably need to close the IO and then reopen it somehow before checking the connection back in?
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<michael_campbell> newbie question: IN ruby I often do things like (foo, bar) = some_string.split(/,/) This array destructuring seems not allowed in crystal. Is there an idiomatic replacement?
<RX14> michael_campbell, this works in crystal https://carc.in/#/r/1l5m
<RX14> (although I tend to avoid it any place I need proper error handing)
marciogm has joined #crystal-lang
gloscombe has quit [Quit: Lost terminal]
mgarciaisaia has joined #crystal-lang
<michael_campbell> RX14 Thanks! Didn't even think to try that.
<RX14> michael_campbell, works the same in ruby: https://carc.in/#/r/1l5p
<michael_campbell> I guess I'm used to the lispy variant. Been doing it that way for a long time.
dhk has joined #crystal-lang
mark_66 has quit [Quit: Leaving.]
<nlf> just curious, anyone tried writing a native extension for node.js in crystal?
Yxhuvud has quit [Remote host closed the connection]
Yxhuvud has joined #crystal-lang
dhk has quit [Quit: Leaving]
<nlf> not quite the direction i was thinking, more like https://github.com/neon-bindings/neon but for crystal
soveran has quit [Remote host closed the connection]
<jokke> now that there's some more traffic here:
<jokke> is there a flag to ignore optimization for a constant so that even if it's never referenced it will be in the resulting binary?
<crystal-gh> [crystal] jreinert opened pull request #3947: add sort_by macro method (master...sort_by_macro_method) https://git.io/vDfw5
<DeBot> https://github.com/crystal-lang/crystal/pull/3947 (add sort_by macro method)
<RX14> jokke, probably not
<jokke> aw
<Papierkorb> assembler to the rescue
<jokke> RX14: i already added a @[Section(...)] attribute
<jokke> :)
<RX14> how?
<jokke> need to write tests for it though and i'm not sure how
<RX14> oh, modified the compiler?
<jokke> yeah
FromGitter has joined #crystal-lang
<jokke> quite the dive into the rabbit hole :D
unshadow_ has joined #crystal-lang
unshadow has quit [Ping timeout: 240 seconds]
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 240 seconds]
Raimondi has quit [Ping timeout: 260 seconds]
unshadow_ has quit [Ping timeout: 240 seconds]
unshadow has joined #crystal-lang
<jeromegn> is it normal that my crystal program is consuming all CPU cores on my machine? I thought crystal only used on thread, one cpu.
<tilpner> jeromegn - Are you using any non-Crystal libs that could cause that?
<BlaXpirit> jeromegn, and are you sure it's not just during compilation?
<BlaXpirit> but yeah, what libs do you use?
<jeromegn> tilpner: well, I'm using a sockets a lot (those are LibC) and OpenSSL
<BlaXpirit> openssl could easily be multithreaded itself
<jeromegn> could be!
<jeromegn> basically, it's all IO
<jeromegn> TCP tunnel
<tilpner> jeromegn - How do you measure the CPU usage?
<jeromegn> I used the macos instruments app
<jeromegn> and also looking at `top` while running it
<jeromegn> from a `build --release` build
<jeromegn> I'll try without SSL
<tilpner> And what does top say for your process?
<jeromegn> actually, I'm using htop. shows my 2 cores + 2 logical are almost at 100% when running `wrk` on it. my program is using most of the CPU. a bit hard to benchmark because it's a TCP tunnel. so there are 2 programs (one server, one client), wrk, and the thing being tunnelled (golang fasthttp server). So those 4 things are heavily being used while I run wrk.
<tilpner> How much CPU does wrk take? It'd be easier to show a screenshot of htop
<jeromegn> yea, getting there :d
unshadow has quit [Ping timeout: 240 seconds]
<jeromegn> tilpner: ^
<jeromegn> oh
<jeromegn> mm
<jeromegn> last entry there is not important. third one is the golang fasthttp server
<tilpner> 100% CPU doesn't mean "100% of all CPUs"
<jeromegn> right
<jeromegn> with 4 logical cores, that would be 400% eh?
<Papierkorb> Huh 530G VIRT? Thought it was capped to something 256GiB?
<tilpner> It refers to just one logical core, and given that this is all below 100, there's nothing weird going on
<tilpner> Yes, 400%
<jeromegn> alright
<jeromegn> tilpner: I tried with 4 "workers", based on https://gist.github.com/benoist/349ebfa97aa5d69554253bc28eadb9e0, but didn't see much of an improvement.
<tilpner> ghc outputs reserved 1TB a while ago, that was fun
<tilpner> jeromegn - What kind of improvement are you hoping for?
unshadow has joined #crystal-lang
<jeromegn> we wrote a golang TCP reverse tunnel program and realized it was heavily CPU bound. For fun, I was trying to write it with Crystal instead. It gave us better throughput! 16K RPS vs 13K RPS. When we originally profiled the golang program, it showed most of the time was spent in syscalls for reading and writing to an IO.
<jeromegn> golang uses all cores AFAIK, but Crystal doesn't.
<tilpner> Where does "fork" come from?
<jeromegn> Process.fork
<jeromegn> maybe the implementation changed since that gist was posted
<Yxhuvud> if you don't notice improvement, have you verified that you are hitting all your ports?
<jeromegn> I'm running 4 x wrk on 4 different ports and all programs seems to be getting requests. but running 4x wrk and 4x server + 4x clients might also be using all my CPU time and making it hard to see improvements
Ven has joined #crystal-lang
unshadow_ has joined #crystal-lang
unshadow has quit [Ping timeout: 245 seconds]
Ven has quit [Ping timeout: 248 seconds]
unshadow_ has quit [Ping timeout: 264 seconds]
Ven has joined #crystal-lang
<tilpner> I don't have Crystal installed right now (and there's no package), so I can only look at it. I didn't see anything obviously broken, but that's not very helpful...
dbohdan has quit [Read error: Connection reset by peer]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
unshadow has joined #crystal-lang
mgarciaisaia has quit [Quit: Leaving.]
bazaar has quit [Quit: leaving]
bazaar has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]