ChanServ changed the topic of #crystal-lang to: The Crystal programming language | | Crystal 0.23.1 | Fund Crystal's development: | GH: | Docs: | API: | Gitter:
vivus has quit [Quit: Leaving]
hightower3 has joined #crystal-lang
hightower2 has quit [Ping timeout: 240 seconds]
hightower2 has joined #crystal-lang
hightower3 has quit [Ping timeout: 248 seconds]
alex`` has quit [Ping timeout: 276 seconds]
<FromGitter> <jwaldrip> how can I get the scheme on the HTTP request?
<FromGitter> <bararchy> @jwaldrip you mean http/https?
<FromGitter> <jwaldrip> ues
<FromGitter> <bararchy> Well, a request means you got a response, meaning you already know the scheme ? Am I missing something ?
<FromGitter> <bararchy> Oh, nvm I don't think I really got what you are trying to do, can you explain a little ?
<FromGitter> <johnjansen> @jwaldrip did you find the scheme in the request
<FromGitter> <jwaldrip> I did not. If I am load balancing I may not know the scheme in the request... I need a way to tell if it is HTTP or HTTPS so I can tell how to redirect
<FromGitter> <jwaldrip> there are some headers that clue me in if I am behind a lb, but if not how do I tell if the direct request was https?
<FromGitter> <johnjansen> oh that old peach … i’ll poke about too
<FromGitter> <johnjansen> any access to the raw request
<FromGitter> <johnjansen> im assuming that an https request intercepted by a reverse proxy server and handled as http at our end will be a problem unless the proxy decorates the request
<FromGitter> <johnjansen> i know ELB does this, but no idea about the *standard*
<FromGitter> <johnjansen> you also might not have the correct host header
<FromGitter> <johnjansen> not sure about that either
<FromGitter> <johnjansen> check these docs @jwaldrip, certainly seems to support the notion that standing behind a reverse proxy is going to present some challenges
<FromGitter> <johnjansen> seems like relative redirects are the only simple solution
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
astronavt has joined #crystal-lang
rohitpaulk has joined #crystal-lang
aroaminggeek has joined #crystal-lang
alex`` has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 276 seconds]
rohitpaulk has joined #crystal-lang
livcd has quit [Changing host]
livcd has joined #crystal-lang
aroaminggeek has quit [Quit: Textual IRC Client:]
claudiuinberlin has joined #crystal-lang
Papierkorb_ has joined #crystal-lang
claudiuinberlin has quit [Quit: Textual IRC Client:]
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Client Quit]
claudiuinberlin has joined #crystal-lang
baweaver is now known as baweaver_away
rohitpaulk has quit [Ping timeout: 248 seconds]
<FromGitter> <marin117> Hi everyone
<FromGitter> <marin117> Is it possible to reject connection in kemal filter
<FromGitter> <marin117> I wanna reject user if he is not admin
<FromGitter> <marin117> and is it good to do it in filter at all
<FromGitter> <marin117> (filter like, before_all)
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 260 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 268 seconds]
rohitpaulk has joined #crystal-lang
astronavt has quit [Remote host closed the connection]
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <codenoid> good night crystalller
<FromGitter> <codenoid> this is my second month working with crystal
watzon_ has quit [Quit: watzon_]
<FromGitter> <sdogruyol> @marin117 you can use a middleware or a filter
rohitpaulk has quit [Ping timeout: 268 seconds]
Creatornator has joined #crystal-lang
<RX14> currently in the middle of another windows port attempt
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Papierkorb_> ?
<RX14> i'm trying to get the empty file to compile on windows by using Crystal::System only
<RX14> i'm uhh not succeeding right now
<RX14> but it's progress
<RX14> Papierkorb_, i assume even with fcntl you'd want it to raise on windows
<RX14> instead of it being a compile error
<Papierkorb_> No I'd much prefer it to error on compilation
<Papierkorb_> Raising on runtime for something we know won't work is not an exceptional case, it's the expected code path
<RX14> yeah thats not everyone ese's opinion
<Papierkorb_> That's just ruby style code
<RX14> even if it's possible to raise a compile error they want it to be runtime for platform specifics
<Papierkorb_> why?
<Papierkorb_> it's a huge violation of "What compiles works"
<RX14> in case the function is never called
<RX14> and it's all happy
<RX14> i sorta agree
<Papierkorb_> If it's nowhere called, the compiler won't complain
<RX14> no
<RX14> as in the config settings the user chooses
<RX14> means that it never uses the platform specifics at runtime
<Papierkorb_> That's like closing your eyes and pretending an issue doesn't exist because you now don't see it
<RX14> I actually agree
<RX14> before I was going in the direction of runtime
<RX14> but really people shouldn't touch platform specifics
<RX14> and so it's best to just error
<Papierkorb_> luislavena basically says it
<RX14> at compile time
<RX14> yeah
<Papierkorb_> I'm all for stern warnings in docs. A `# @tag:Windows` thing would actually be kinda awesome for various things, which would make the generator emit a "badge"
<RX14> well you can always just do build --no-codegen --target ,foo>
<Papierkorb_> Or something like that, like doxygen allowing you to categorize functions.
<RX14> and that gives you an instant check if you build on target x
<RX14> for real
<RX14> but it should be in the docs too of course
<Papierkorb_> Sure but imagine you want to write a portable lib, look into the docs, and there's no clear mention of that. So you use something specific, and it blows up on windows. You may have chosen otherwise if the docs told you
<Papierkorb_> Clearly docs don't replace a CI of sorts
Papierkorb_ has quit [Quit: Konversation terminated!]
<RX14> darn
<RX14> test.o : fatal error LNK1107: invalid or corrupt file: cannot read at 0x10AE0
<RX14> which is fantastically helpful
<RX14> oh why is LLVM giving me an ELF for x86_64-windows-msvc
<RX14> huh
<RX14> it NEEDS to be x86_64-pc-windows-msvc
<RX14> til
<RX14> so i'm up to the linker stage, yay
Creatornator has joined #crystal-lang
baweaver_away is now known as baweaver
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RX14> wohoo, just the pcre_ sumbols left
<RX14> and all that takes is compiling pcre
<RX14> I can't wait to watch it segfault
<FromGitter> <achou11> Hi everyone! I’m new to Crystal and I’ve been going through the docs to understand the types. Can anyone explain why this gives a syntax error? ⏎ ⏎ ```code paste, see link``` []
<FromGitter> <bew> `'Chou'` is definitely not a char
<FromGitter> <achou11> @bew oh gosh haha that’s silly of me. not used to using a char type haha. Thanks!
claudiuinberlin has quit [Quit: Textual IRC Client:]
Creatornator has joined #crystal-lang
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RX14> yay
<RX14> it lives
<RX14> it prints hello world on windows
<RX14> granted followed by some garbage but IT WORKS and it's using IO::FileDescriptor and puts and a lot of stdlib to do it
<RX14> it's awesome
claudiuinberlin has joined #crystal-lang
Creatornator has joined #crystal-lang
<RX14> the diff from my FileDescriptor PR to make windows print hello world: +326 -73
<FromGitter> <faustinoaq> Interesting, crystal isn't using 100.00 % cpu on TFB
<FromGitter> <faustinoaq> neither kemal or amber
<FromGitter> <faustinoaq> > it prints hello world on windows ⏎ ⏎ Awesome 🎉
<FromGitter> <faustinoaq> RX14 👍
<FromGitter> <Rinkana> Awesome!
csk157 has joined #crystal-lang
<RX14> a very basic windows support in master seems very doable
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RX14> possibly by christmas
<Papierkorb> inb4 awful HO HO HO puns
<Papierkorb> please someone do them
<RX14> diff algorithms suck
<RX14> at sourcecode
<Papierkorb> oh boy, 0.24.0 breaks bindgen all around through API breakage. And I don't feel like "porting" it over before 0.24.1
<Papierkorb> Any idea when that's gonna be?
<RX14> no
<RX14> manas don't seem to have time to do anything but :tada: my messages in slack lol
<Papierkorb> 🎉
<RX14> yeah, it'd take me 5 minutes to type that on linux too
<FromGitter> <bararchy> 🎉
<Papierkorb> I just googled for the unicode char
<RX14> lol yes me too
<oprypin> @bmcginty, FYI Windows convo above
csk157 has quit [Ping timeout: 248 seconds]
<FromGitter> <Rinkana> Man i hope 0.24.1 come soon tho, i need some things that are in 0.24.0
<RX14> inb4 windows support in 0.24.1
<RX14> I should really get the ball rolling on 0.24.1
<FromGitter> <Rinkana> I'd rather have 0.24.1 now then wait for Windows support :p
<RX14> yeah I was joking about 0.24.1 taking sooo long we have windows support in master by then
<oprypin> funny...
<FromGitter> <Rinkana> And i don't know what's the holdup now. 0.24 seems tested enough as there are nog big bug reports being made. And 0.24 has been released quite some time ago
<FromGitter> <Rinkana> It will also fix the clusterfuck that is the current release (looking at you Arch)
<oprypin> whats with arch
<RX14> dont look at arch
<RX14> it's us that didn't communicate properly
<oprypin> make a release @@@ complain that people use a release
<FromGitter> <Rinkana> But still, it's quite a mess
<oprypin> is there any conversation to follow on 0.24.0 in arch linux?
<RX14> no
<RX14> congrats to windows for calling all of their crypto functions "bcrypt"
<RX14> bonus points for not implementing bcrypt in bcrypt
<Papierkorb> just-why-man.jpg
<RX14> well they had an api called crypt
<RX14> which is fair enough I guess
<RX14> then they introduced a new API
<RX14> and called it bcrypt
<FromGitter> <Rinkana> ccrypt next i guess?
<oprypin> BcryptEx
<Papierkorb> BCryptEx2W
<FromGitter> <Rinkana> BCryptReal
<RX14> BCryptThisTimeItsReallyReal
<FromGitter> <Rinkana> In true PHP fashion
<RX14> ...
<RX14> you know what lets just destroy this windows support branch it was all a mistake
<oprypin> cut them some slack, this is the only instance of Ex2 in the entire winapi
<Papierkorb> RX14: You know there's dup?
<Papierkorb> And it's bad
<Papierkorb> You know there's dup2?
<Papierkorb> Well thirds try the charm!
<Papierkorb> you know there's dup3?
<RX14> ahaha yes
<RX14> i know
<Papierkorb> And now I'm out
<RX14> i use it
<RX14> in my PR
<RX14> i couldn't help but sneak it in
<RX14> its probably the only actual method implementation change in it
<Papierkorb> yes I saw it when I read the whole thing earlier
<RX14> cool
<Papierkorb> > gpg: keyserver timed out
<Papierkorb> So not only does travis mark bindgen as failing cause the archlinux test fails due to 0.24, but the debians now whine about gpg
csk157 has joined #crystal-lang
csk157 has quit [Ping timeout: 240 seconds]
csk157 has joined #crystal-lang
<RX14> nah thats just normal
<RX14> gpg keyservers have less than 50% uptime
<RX14> i swear
csk157 has quit [Ping timeout: 255 seconds]
<RX14> i've never had a gpg keyserver work
<RX14> when i want it to
csk157 has joined #crystal-lang
<FromGitter> <watzon> Is there a flag to check the crystal version? I'm thinking some of these libraries that want to maintain some backwards compatibility with Crystal 0.23 may need to run a check at compile time to see which version is being used
<RX14> yes there is but don't try to maintin multiple version compat
<RX14> there's Crystal::VERSION
<Papierkorb> watzon, you can also check only specific functions if that's enough
<FromGitter> <watzon> I agree that trying to maintain backwards compatibility at this point is dumb
<Papierkorb> I only do it if a future crystal version contains a fix/improvement I care about
faustinoaq has quit [Ping timeout: 248 seconds]
Creatornator has joined #crystal-lang
<RX14> great, between my windows vm and firefox and goddamn emacs I don't have enough memory to compile crystal
<Papierkorb> download more ram
<FromGitter> <bew> 🎉
sz0 has joined #crystal-lang
<RX14> Papierkorb, my dimms are soldered :(
<Papierkorb> u wot
<RX14> laptop
<Papierkorb> dedicated graphics?
<Papierkorb> you can swap onto GDDR lul
<RX14> lol
<oprypin> watzon, see also
sagax has quit [Ping timeout: 240 seconds]
aroaminggeek has joined #crystal-lang
csk157 has quit [Ping timeout: 260 seconds]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
Ven is now known as Guest67933
astronavt has joined #crystal-lang
astronavt has quit [Remote host closed the connection]
astronavt has joined #crystal-lang
astronavt has quit [Remote host closed the connection]
claudiuinberlin has quit [Quit: Textual IRC Client:]
faustinoaq has joined #crystal-lang
Ven has joined #crystal-lang
Ven is now known as Guest70676
Guest67933 has quit [Read error: Connection reset by peer]
<FromGitter> <sdogruyol> @RX14 I feel your pain..
<RX14> well its not that painful
<RX14> 16gb is rarely not enough
Creatornator has joined #crystal-lang
<literal> howdy
<literal> how do I write this so that it a) compiles, and b) doesn't require me to write the type definition twice?
<oprypin> wait what
<oprypin> I don't see what you're trying to achieve here
<oprypin> (especially assigning a type to an instance variable)
<oprypin> literal, just needed a .new i guess?
<literal> oh yeah, that was indeed the issue
<literal> I keep making that mistake
<FromGitter> <johnjansen> so @literal … @bar can be anything ???
<FromGitter> <lhz> perhaps `getter bar : Hash(String, Set(Tuple(Int32, Int32)))?` is what you want?
<FromGitter> <lhz> don't really see the point of setting nil as default parameter value and then overriding though, why not just `def initialize(@bar = Hash(...).new)`
alex`` has quit [Ping timeout: 258 seconds]
<FromGitter> <lhz> and perhaps a type alias at the top of the class to shorten things.
<literal> that's another approach, but I find it a bit unwieldy to have the type hints within the parentheses there, especially if there's more than one
<literal> but yeah, an alias does make it shorter
<FromGitter> <johnjansen> the question is this, can your code handle any type?
<Papierkorb> having "nil" there isn't great if you actually meant "The empty thing is the default"
<literal> I want it to always be non-nil, but the caller can optionally supply an initial value
<Papierkorb> Then don't allow passing nil in
<FromGitter> <johnjansen> and right now that could be any type at all
<FromGitter> <johnjansen> ``` # and im ok```
<oprypin> pretty sure it cant
<FromGitter> <lhz> ah, so that's why it's called `bar` ;)
<oprypin> (though again mandatory crystal 0.15 run )
<FromGitter> <johnjansen> well thats different ;-) i stand corrected
<FromGitter> <johnjansen> now thats totally unclear from the code
<FromGitter> <johnjansen> #at least thats what i blame for my mistake ;-)
<FromGitter> <johnjansen> woa
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <watzon> Uh oh
<Papierkorb> works for me
<RX14> on windows the function to get an errno can set errno
Guest70676 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <bew> Me: whaat?
<FromGitter> <bew> Do you have any idea why he says that?