jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.17.4 | 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
volcanix has joined #crystal-lang
<volcanix> in crystal how would I call c binding for mkfifo http://linux.die.net/man/3/mkfifo ... would I use http://crystal-lang.org/docs/syntax_and_semantics/c_bindings/fun.html?
<volcanix> looking at porting something like https://github.com/shurizzle/ruby-mkfifo/blob/master/ext/mkfifo.c
zodiak has quit []
<jhass> yes
<jhass> it's already mapped in fact
<jhass> >> LibC.mkfifo
<DeBot> jhass: wrong number of arguments for 'LibC#mkfifo' (given 0, expected 2) - https://carc.in/#/r/1018
<jhass> volcanix: ^
<volcanix> very cool thanks
trapped has quit [Ping timeout: 240 seconds]
mgarciaisaia has joined #crystal-lang
zodiak has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 276 seconds]
Philpax has joined #crystal-lang
willl has quit [Quit: Connection closed for inactivity]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 272 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
bjz has joined #crystal-lang
dhk has quit [Quit: Leaving]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 244 seconds]
mgarciaisaia has quit [Quit: Leaving.]
mgarciaisaia1 has joined #crystal-lang
matp has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
matp has joined #crystal-lang
ryanw-se has quit [Quit: Leaving...]
Raimondii has joined #crystal-lang
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 260 seconds]
Raimondi has quit [Ping timeout: 240 seconds]
Raimondii is now known as Raimondi
jmoriau has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
mgarciaisaia1 has quit [Quit: Leaving.]
bjz has joined #crystal-lang
bjz_ has quit [Ping timeout: 276 seconds]
pawnbox has joined #crystal-lang
crystal-lang400 has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
crystal-lang400 has quit [Ping timeout: 250 seconds]
jmoriau has joined #crystal-lang
jmoriau has quit [Client Quit]
jmoriau has joined #crystal-lang
jmoriau has quit [Client Quit]
Ven has joined #crystal-lang
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 260 seconds]
volcanix has quit [K-Lined]
bjz_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<crystal-gh> [crystal] ysbaddaden opened pull request #2667: Clean: gethostname belongs to unistd.h (master...clean-gethostname) https://git.io/vr9we
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 272 seconds]
TheLemonMan has joined #crystal-lang
bjz has joined #crystal-lang
pawnbox has joined #crystal-lang
matp has quit [Ping timeout: 258 seconds]
matp has joined #crystal-lang
<crystal-gh> [crystal] jhass pushed 1 new commit to master: https://git.io/vr9rv
<crystal-gh> crystal/master 0804a8f Jonne Haß: Merge branch 'release/0.17'
<travis-ci> crystal-lang/crystal#0804a8f (master - Merge branch 'release/0.17'): The build was broken. https://travis-ci.org/crystal-lang/crystal/builds/133562534
Ven has joined #crystal-lang
trapped has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<crystal-gh> [crystal] jhass opened pull request #2668: Various cleanups (master...renames) https://git.io/vr960
|meta has joined #crystal-lang
steenuil has quit [Read error: Connection reset by peer]
<|meta> [] of Value gives an error that it's not supported *yet*. is this something that will definitely happen, later?
<jhass> it's not 100% certain but likely
<jhass> https://github.com/crystal-lang/crystal/issues/2665 is the tracking issue around that class of issues
dhk has joined #crystal-lang
dhk has quit [Quit: Leaving]
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 252 seconds]
pawnbox has quit [Ping timeout: 258 seconds]
<leafybasil> I have been digging into the HTTP issue I mentioned the other night, mostly by dropping 'puts' throughout the code base to see what the path of execution is. I have noticed in some places a 'puts' appears not to get called but a 'raise' will indeed break as expected. Is there something about fibres that means it's possible they won't print to stdout?
<jhass> not immediately, yes
<jhass> LibC.write(2, "foo") if you need raw, blocking, possibly breaking access to stdout
<jhass> though actually I'm not sure the client does even spawn?
asie has quit [Ping timeout: 252 seconds]
<leafybasil> jhass: You may be right, I'm asking for general knowledge, I always assumed previously that 'puts' would ALWAYS write to stdout
asie has joined #crystal-lang
<jhass> well it does, just buffered
<leafybasil> jhass: also at this point I'm actually in OpenSSL::SSL::Socket :(
<jhass> oh
<jhass> maybe you hit IO#puts ?
<leafybasil> jhass: Okay so it's buffered but potentially you could encounter an error or issue before the output is made visible?
<jhass> use STDOUT.puts there
<leafybasil> Ah... I will give that a shot
<leafybasil> jhass: you were 100% correct of course
<leafybasil> STDOUT.puts does what's expected
<BlaXpirit> wow what an annoying error :( never liked implicit method calls
pawnbox has joined #crystal-lang
pawnbox has quit [Read error: Connection reset by peer]
pawnbox has joined #crystal-lang
<crystal-gh> [crystal] mirek opened pull request #2669: Update doc for `IO#read_bytes`. (master...io-read-bytes-doc) https://git.io/vr9Qk
<leafybasil> I think it's fair to say I'm out of my depth, knowing little about crystal and little about SSL socket implementation, I'll take the blame :D
grios has quit [Remote host closed the connection]
<jhass> leafybasil: btw still happy to help out if you can provide a way to reproduce
<leafybasil> jhass: I can def do that with a repo, I just really wanted to learn how to do a portion of it and I was worried about wasting your time with some fringe-issue
<jhass> ah no worries
<leafybasil> I will likely give up once I've spent an hour or two on it, and ask for your help
Philpax has quit [Ping timeout: 244 seconds]
A124 has quit [Quit: '']
A124 has joined #crystal-lang
|meta has quit [Quit: Connection closed for inactivity]
<crystal-gh> [crystal] ysbaddaden opened pull request #2671: TLS server improvements (master...tls-improvements) https://git.io/vr9b4
A124 has quit [Ping timeout: 244 seconds]
steenuil has joined #crystal-lang
Ven has joined #crystal-lang
dhk has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
Raimondii has joined #crystal-lang
pawnbox has joined #crystal-lang
Raimondi has quit [Ping timeout: 240 seconds]
<BlaXpirit> if I have a big case statement, is it possible to generate some of its branches with a macro?
Raimondii is now known as Raimondi
<jhass> their contents, a when Foo; bar is not a valid expression in itself
<jhass> so branch contents or the entire thing
<jhass> you probably could take the whole one and append some branches in a macro
<BlaXpirit> jhass, I just realized, I can wrap the case statement in {%begin%} {%end%}
<BlaXpirit> and do whatever I want inside it
<jhass> mh, right
<BlaXpirit> sigh, literals don't properly work in macros. %r(stuff) turns to __temp_138(stuff)
A124 has joined #crystal-lang
leogouveia has joined #crystal-lang
A124 has quit [Ping timeout: 244 seconds]
<jhass> escape it?
<BlaXpirit> yes, took me some time to realize \%r
<BlaXpirit> i don't think it's in the docs though
A124 has joined #crystal-lang
<jhass> maybe we need another char for macro vars
<BlaXpirit> i dunno, % is pretty good
<BlaXpirit> rarely used and memorable
<jhass> mmh, how do you do a § on a us keyboard?
pawnbox has quit [Read error: Connection reset by peer]
pawnbox_ has joined #crystal-lang
<BlaXpirit> jhass, Ctrl+C, then Ctrl+V :D
<jhass> heh
<jhass> explains why it's never used I guess
<BlaXpirit> jhass, it's non-ASCII
<jhass> oh
<jhass> curious how it's shift-3 on german keyboards
<jhass> :D
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vr9hf
<crystal-gh> crystal/master 68d587e Ary Borenszweig: Formatter: fixed wrong indent after comma followed by comment, in elements list. Fixes #2670
<travis-ci> crystal-lang/crystal#68d587e (master - Formatter: fixed wrong indent after comma followed by comment, in elements list. Fixes #2670): The build was fixed. https://travis-ci.org/crystal-lang/crystal/builds/133612960
leogouveia has quit [Remote host closed the connection]
mgarciaisaia has joined #crystal-lang
<BlaXpirit> sigh, the lack of closure generators is getting to me
<BlaXpirit> again I would like to generate a stream of items recursively
<BlaXpirit> but looks like it's gonna have to be a class and plain old function calls, like that io << idiom
pawnbox_ has quit [Ping timeout: 252 seconds]
mgarciaisaia has left #crystal-lang [#crystal-lang]
pawnbox has joined #crystal-lang
<leafybasil> jhass: I think I'm ready to give up, can take chat to DM if you want me to fill you in?
<jhass> so you can't share publicly?
<leafybasil> jhass: can do was just worried about introducing noise
<leafybasil> Sorry, I'm used to IRC channels where everyone is an asshat when they have the smallest excuse
<jhass> just don't post more than three lines into the channel at once and all is good ;)
<leafybasil> :)
<leafybasil> Is it worth putting into an issue then linking the issue?
<jhass> if it's minimal, yeah
<jhass> if not I'd like to reduce it to a minimal testcase first
<jhass> leafybasil: ^
<leafybasil> jhass: cool will drop it in now
|meta has joined #crystal-lang
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
<leafybasil> jhass: Just got around to it https://github.com/crystal-lang/crystal/issues/2674
<leafybasil> I'm interested in knowing/seeing the process you go through to work out whats up and fix it.
<jhass> seems to be indeed a openssl issue :/
<jhass> mmh
<jhass> well I fired up mitmproxy to eliminate the SSL stack and get a 403 from cloudflare :o
<jhass> oh, gotta rewrite host
<leafybasil> :)
<leafybasil> In the past I've had issues with "fast" SSL handshake between windows and cloudflare
<leafybasil> Got to dash but will be back later
<jhass> okay, with rewriting the host I get the regular response through mitmproxy, confirms it's most likely in the TLS stack
<jhass> mmh, capturing with wireshark, they ACK our Client Hello but then fail internally subsequently
Ven has quit [Read error: Connection reset by peer]
<jhass> first bug, we probably should raise some openssl specific error in that case
Ven has joined #crystal-lang
<jhass> uh, looks like we don't have SNI on
<jhass> bet that's it
<jhass> (figured by comparing our Client Hello to curl's)
<BlaXpirit> how can I define a constant inside a class and redefine it in a subclass and use the per-class definition? https://carc.in/#/r/104f
<BlaXpirit> macro def doesn't help. using a class variable instead works but this is meant to be a constant
<BlaXpirit> @type.FOO and @type::FOO are invalid
<jhass> BlaXpirit: https://carc.in/#/r/104k
<BlaXpirit> alrighty then... thanks
<BlaXpirit> but this is a common enough idiom that i'd expect something better
<jhass> gotta love openssl, of course there's ERR_get_error as well as SSL_get_error
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<adam12> Anybody write a lib interface to setuid/setgid?
<BlaXpirit> hmmmmm abstract `def CItem#render(context : Context, out : Output)` must be implemented by CItem
<adam12> Tried that first. No luck, unless I missed something?
<adam12> I'm assuming Lib C, some sort of func def, but the custom uid_t type is what I think I am stuck on.
<BlaXpirit> seems like it's just getters
<BlaXpirit> maan but how did I cause this problem, i really can't reproduce it on a smaller example
x0f_ has quit [Ping timeout: 250 seconds]
<BlaXpirit> adam12, what's the problem? make an alias to uid_t, it's just an unsigned int, as google says
x0f has joined #crystal-lang
<adam12> Thanks - I'm a bit further. Found LibC::UidT
<adam12> set it up in func and I think it worked.
<adam12> fun setuid(uid: LibC::UidT) : Int32
<adam12> is what I ended up with.
<BlaXpirit> adam12, better use ) : LibC::Int
<adam12> OK thanks :)
<BlaXpirit> makes no difference on all modern platforms but hey...
<crystal-gh> [crystal] jhass opened pull request #2676: SNI support for OpenSSL::SSL::Socket and HTTP::Client (master...ssl_sni) https://git.io/vrHTZ
<crystal-gh> [crystal] jhass pushed 1 new commit to master: https://git.io/vrHkn
<crystal-gh> crystal/master 004a6d0 Jonne Haß: Improve Logger docs...
<crystal-gh> [crystal] jhass closed pull request #2335: Add comment in logger.cr (master...logger-doc) https://git.io/va1ad
<travis-ci> crystal-lang/crystal#004a6d0 (master - Improve Logger docs): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/133635472
<BlaXpirit> so i'm looking at a very strange situation
<BlaXpirit> f(**mutating_macro_call) gives one result and z=mutating_macro_call; f(**z) gives a different result
A124 has quit [Ping timeout: 276 seconds]
A124 has joined #crystal-lang
<BlaXpirit> reproduced, minimized and reported it. this time it's not a dud
mgarciaisaia1 has joined #crystal-lang
mgarciaisaia1 has left #crystal-lang [#crystal-lang]
|meta has quit [Quit: Connection closed for inactivity]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 8 new commits to master: https://git.io/vrHOl
<crystal-gh> crystal/master a5b2f4e Jonne Haß: rename Process.getpgid to Process.pgid, add argumentless version
<crystal-gh> crystal/master f7e92a7 Jonne Haß: get_stack_top -> _fiber_get_stack_top
<crystal-gh> crystal/master d16a31d Jonne Haß: hide main from docs
Philpax has joined #crystal-lang
<travis-ci> crystal-lang/crystal#cdac075 (master - Merge pull request #2668 from jhass/renames): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/133653994
mgarciaisaia has joined #crystal-lang
mgarciaisaia has quit [Ping timeout: 244 seconds]
zodiak has quit [Ping timeout: 250 seconds]