ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.32.1 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
<sorcus> Hmmm... Where is `Array` allocated in Crystal's compiler/codegen? X-)
<FromGitter> <tenebrousedge> you mean https://github.com/crystal-lang/crystal/blob/master/src/array.cr or ArrayLiteral?
<sorcus> Mmm, initialized with `Pointer` and `malloc`. Then it be passed to LLVM? Or not. Oh, that fucking bug with large arrays X-)
<sorcus> tenebrousedge: I mean a code part, where array allocated on memory via LLVM.
<sorcus> tenebrousedge: i'm tried to understand how it works. X-)
<sorcus> :-D
<sorcus> Even in Rust nobody cares slow compilation with large arrays. :-D :-D :-D
HumanG33k has quit [Quit: Leaving]
return0e_ has joined #crystal-lang
return0e has quit [Ping timeout: 240 seconds]
<sorcus> Ok, it's very slow because there is a lots of calls like `%131071 = call i32 @"*Pointer(Int32)@Pointer(T)#[]=<Int32, Int32>:Int32"(i32* %131070, i32 65532, i32 9)` which equal to `alloca` - right?
baweaver has quit [Excess Flood]
masterdonx2 has quit [Read error: Connection reset by peer]
baweaver has joined #crystal-lang
MasterdonX has joined #crystal-lang
raz has quit [Ping timeout: 250 seconds]
raz has joined #crystal-lang
<sorcus> Ok, enough on today. Sweet dreams. :-)
Nicolab has quit [Quit: Leaving.]
<FromGitter> <watzon> Well @jwoertink I'm working on something. We'll see how it turns out.
<FromGitter> <stnluu_twitter> looking through the examples
<FromGitter> <stnluu_twitter> i still have no idea wtf pack is supposed to do
<FromGitter> <stnluu_twitter> didnt come from ruby land
<FromGitter> <tenebrousedge> it's sort of a way to encode bytes
<FromGitter> <tenebrousedge> you can pack e.g. four Int8 into a Int32
<FromGitter> <stnluu_twitter> ah i see
<FromGitter> <stnluu_twitter> looking at the directives
* FromGitter * tenebrousedge nods
<FromGitter> <stnluu_twitter> looks like the main use-case is to pack shit for easier transport?
<FromGitter> <stnluu_twitter> trying to think of a legit use case where there isn't a cleaner less esoteric solution
<FromGitter> <tenebrousedge> it also converts between endianness
<FromGitter> <tenebrousedge> you could think of it as an extremely concise "DSL" for byte translation
<FromGitter> <stnluu_twitter> yeah, "DSL" is the scary part
<FromGitter> <stnluu_twitter> on that front, i tend to agree with the golang philosophy of sticking with the primitives
<FromGitter> <stnluu_twitter> but anyway
<FromGitter> <tenebrousedge> golang makes me break out in a rash
<FromGitter> <stnluu_twitter> if people like it then people like it
<FromGitter> <stnluu_twitter> :D
<FromGitter> <stnluu_twitter> ^ referring to pack
* FromGitter * tenebrousedge shrugs
<FromGitter> <tenebrousedge> I think I've maybe used it in anger once
<FromGitter> <straight-shoota> You do realize that you can do the same things in Crystal with `IO`? It even results in more performant and better readable code.
<FromGitter> <stnluu_twitter> debugging at 2AM, `normalize_endianness(x)` is a easier to follow than `x.pack("DSL")`
<FromGitter> <straight-shoota> `io.write_bytes(x, :big)` => `io.read_bytes(x, :big)`
<FromGitter> <stnluu_twitter> 👍
martinium has joined #crystal-lang
<FromGitter> <stnluu_twitter> "but but... it's more verbose than `x.pack("s")` :P
<FromGitter> <stnluu_twitter> </sarcasm>
<FromGitter> <straight-shoota> Oh no 😿 And even more flexible. 😱
<FromGitter> <straight-shoota> SCNR. No offense to anyone who likes to use `pack`/`unpack` 😺
<FromGitter> <jwoertink> sweet. Good luck @watzon
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
alex`` has quit [Quit: WeeChat 2.7]
martinium has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <Daniel-Worrall> ooh, official alpine docker images looking like it can be tested
<FromGitter> <grkek> There is a weird bug in the crystal playground
<FromGitter> <grkek> STDOUT << "Hello, World!\n\0"
<FromGitter> <grkek> if you compile and run this it will just refresh the webpage
<FromGitter> <grkek> which is not what the local compiler does, it just compiles
<FromGitter> <grkek> as fast as you remove the \0 it compiles
<FromGitter> <grkek> and runs on the playground
<FromGitter> <grkek> https://play.crystal-lang.org
<FromGitter> <grkek> this is the playground I am referring to
<FromGitter> <watzon> So I've done my playing around with `String#unpack` in Crystal, and I can definitely understand why it's not a thing in most compiled languages. Now I'm trying to play around with a different syntax. Something more friendly and versatile than `IO::ByteFormat`, but while still keeping things typing friendly.
<FromGitter> <watzon> Apparently it doesn't handle a trailing null byte well
<FromGitter> <grkek> Interesting why does that happen, probably an issue with the server
<FromGitter> <grkek> does the server cast it to any type of encoding by itself
<FromGitter> <grkek> ascii / unicode
<FromGitter> <grkek> ?
<FromGitter> <watzon> Could be the server or the javascript. I'm not sure.
<FromGitter> <grkek> without asking it to do
<FromGitter> <grkek> > {"error":{"message":"internal server error"}}
<FromGitter> <grkek> that is what I got form the server
<FromGitter> <grkek> `{"run_request":{"language":"crystal","version":"0.32.1","code":"puts \"Hello, World!\\0\""}}`
<FromGitter> <grkek> and that is probably why
<FromGitter> <grkek> \\0\ is not correct in the context or gets just de-serialized improperly
<FromGitter> <watzon> It returns a 500 error with that input?
<FromGitter> <grkek> yeah
<FromGitter> <grkek> it is open source the web site right ?
<FromGitter> <grkek> where do I find the source of the webserver again
<FromGitter> <watzon> Yeah it must be getting deserialized improperly. I think @jwoertink made an issue in the carc.in repo, you may want to check there
<FromGitter> <grkek> ?
<FromGitter> <watzon> https://github.com/jhass/carc.in
<FromGitter> <grkek> found it thank you
<FromGitter> <watzon> Yeah I'd just contribute to the issue https://github.com/jhass/carc.in/issues/15
<FromGitter> <grkek> Looks like puts char::zero gets evaluated the same way
<FromGitter> <grkek> which means it is not a deserialization error
<FromGitter> <grkek> it has to do something with the sandboxes
<FromGitter> <grkek> probably
<FromGitter> <watzon> Well `Char::ZERO` is a null byte, so it's basically the same thing
<FromGitter> <grkek> Yeah but it is not the problem of the json
<FromGitter> <grkek> deserialization
<FromGitter> <grkek> look at that
<FromGitter> <grkek> it has a cute little stack trace inspector
<FromGitter> <grkek> let me run it locally and try the same thing
<FromGitter> <watzon> That's a nifty syntax
<FromGitter> <watzon> I love what you can do with Crystal, I really do
<FromGitter> <grkek> do you use ameba ?
<FromGitter> <grkek> it literally forces you to write like that
<FromGitter> <grkek> it is very useful
<FromGitter> <watzon> Yeah, I love it. I use it for some of my bigger projects.
<FromGitter> <watzon> Like Rubocop, it's wonderful
<FromGitter> <grkek> > author_ip VARCHAR(39) NOT NULL,
<FromGitter> <grkek> why does carc.in need an ip collection
<FromGitter> <watzon> That's a good question
<FromGitter> <grkek> these days all the people want is to rip someone off and collect tons of info
<FromGitter> <grkek> that is bullshit which is not needed for an online playground of a language
<FromGitter> <grkek> it is not used for single IP access because I know you can edit others posts
<FromGitter> <grkek> right ?
<FromGitter> <grkek> if it were used it would be justifiable but now it is not at all
<FromGitter> <Daniel-Worrall> Because sometimes you need to be able to track/block/report/coveryourass when someone posts something really... not what you want on a public repository
<FromGitter> <grkek> and the IP is a varchar of 39
<FromGitter> <watzon> Yeah I can't really see anywhere in the repo where it's actually being used
<FromGitter> <watzon> But also true
<FromGitter> <grkek> You dont need to track anyone you can just delete the repo
<FromGitter> <grkek> post*
<FromGitter> <grkek> 1) you have logging beforehand
<FromGitter> <grkek> instead of saving it in the db you have logs
<FromGitter> <grkek> like apache2 does
<FromGitter> <grkek> you filter through them and find the abuser
<FromGitter> <grkek> and bam block him
<FromGitter> <grkek> Don't save data which you dont need in a database
<FromGitter> <grkek> databases aren't for logging requests :D
<FromGitter> <watzon> Might be worth asking in an issue
<FromGitter> <grkek> I was into cyber security before I got into programming
<FromGitter> <grkek> I know a lot about tracking / blocking / abuse detection
<FromGitter> <grkek> etc
<FromGitter> <grkek> this seems like an useless data collection to me as long as it is not an unique identifier to a post which can only be edited by the author
<FromGitter> <grkek> if it is then I will be glad for that feature and give my ip to the author
<FromGitter> <grkek> 😸
DTZUZO_ has quit [Ping timeout: 265 seconds]
<FromGitter> <watzon> It's possible that that's planned, but I think something a little more unique than an IP would definitely be better
<FromGitter> <watzon> Who knows though
<FromGitter> <grkek> an UUID
<FromGitter> <grkek> is enough atm tbh
<FromGitter> <grkek> unique enough and can be stored without breaching someones privacy
<FromGitter> <grkek> as in IP
<FromGitter> <grkek> seems like I need to use btrfs to run sandbox on
<FromGitter> <grkek> Seems like the stdout is treated as string
<FromGitter> <grkek> as a string
<FromGitter> <grkek> will that cause problems ?
<FromGitter> <grkek> I am not pretty sure how the char::zero gets handled
<FromGitter> <grkek> after compilation
<FromGitter> <grkek> As far as I can see the only issue is the stdout string handling
<FromGitter> <grkek> puts "/u0000"
<FromGitter> <grkek> this fails as well
<FromGitter> <grkek> It just doesn't like the nul byte
ht_ has joined #crystal-lang
<FromGitter> <grkek> Can anyone help me out with this ?
<FromGitter> <grkek> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e19815aa859c14fa1c739e1]
<FromGitter> <grkek> I am able to accept but unable to respond but when I stop the request the server responds afterwards
<FromGitter> <grkek> haha I got it working
<FromGitter> <grkek> it took me 2 months to wrap my head around this in c#
<FromGitter> <grkek> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e19841bdbacf55b3de9497f]
<FromGitter> <grkek> if anyone needs a tcp proxy here you go
Nicolab has joined #crystal-lang
ht_ has quit [Quit: ht_]
<FromGitter> <grkek> its not reliable at all tho
<FromGitter> <Nicolab> Hi
<FromGitter> <grkek> Hello @Nicolab
DTZUZO_ has joined #crystal-lang
ur5us has joined #crystal-lang
<oprypin> aha many of these are because apparently the checkout replaces line endings with `\r\n`??
<oprypin> the completely random colorize failures are unexplainable :D especially when other colorize specs, that are almost the same, pass
gangstacat has quit [Quit: Ĝis!]
<oprypin> well at least it's not *literally* random. reproduces every time.
<oprypin> alright alright, the colorize is reproducible locally on linux: `TERM=dumb crystal spec/std/colorize_spec.cr`
<oprypin> it's just disabled by some completely unrelated spec
<oprypin> but even if it's disabled, most colorizations are still being applied, just except those two ᕕ( ᐛ )ᕗ
ur5us has quit [Ping timeout: 260 seconds]
alex`` has joined #crystal-lang
gangstacat has joined #crystal-lang
<sorcus> https://gist.github.com/MrSorcus/465ffd596249ca0d413c28f7561aa957 - mmm, array allocated once? But anyway compilation is slow. :-(
DTZUZO_ has quit [Ping timeout: 268 seconds]
<FromGitter> <straight-shoota> oprypin, nice to see it working!
DTZUZO_ has joined #crystal-lang
_whitelogger has joined #crystal-lang
Nicolab has quit [Ping timeout: 265 seconds]
alex`` has quit [Ping timeout: 260 seconds]
alex`` has joined #crystal-lang
HumanG33k has joined #crystal-lang
<FromGitter> <lbarasti> I'm puzzled... I'd expect this to return `3`. What is `:+` in this context? ⏎ ⏎ ```[1, 2].reduce(&.+) # returns 1``` [https://gitter.im/crystal-lang/crystal?at=5e19e76bb720fa5b3cf748ec]
<FromGitter> <Blacksmoke16> why not just use `.sum`
<FromGitter> <grkek> @Blacksmoke16 Hero strikes again
<FromGitter> <grkek> Literally crystal messiah
<Yxhuvud> lbarasti: because the &. syntax doesn't pass in arguments.
<FromGitter> <Blacksmoke16> also prob because reduce has the accumulator and current value block args which wouldnt be represented using that syntax
alex`` has quit [Quit: WeeChat 2.7]
<FromGitter> <lbarasti> a bit of a surprising behaviour, you'll concede?
<FromGitter> <Blacksmoke16> its essentially the same as `[1,2].reduce { |v| v.+ }` which im more surprised that it compiles
<FromGitter> <lbarasti> eheh, exactly
<FromGitter> <lbarasti> I cannot think of a use case where `#reduce(&.some_method)` makes sense
<FromGitter> <lbarasti> so maybe it shouldn't compile?
<FromGitter> <Blacksmoke16> https://crystal-lang.org/api/master/Number.html#+-instance-method
<FromGitter> <Blacksmoke16> its hitting that overload
<FromGitter> <Blacksmoke16> not sure what the use case for that would be?
<FromGitter> <lbarasti> ah! Thanks @Blacksmoke16, at least we know why it compiles :D
<FromGitter> <Blacksmoke16> yea, is essentially an alias to `.itself`
<FromGitter> <Blacksmoke16> might be worth a forum post/issue about if its really needed
<FromGitter> <Blacksmoke16> was added like 7 years ago
<FromGitter> <tenebrousedge> ```-5.+() #=> -5 ⏎ -5.-() #=> 5``` [https://gitter.im/crystal-lang/crystal?at=5e19ef576be93b6b36c46280]
* FromGitter * tenebrousedge shrugs
<FromGitter> <Blacksmoke16> :thinking:
<FromGitter> <tenebrousedge> it looks like it was added to support product
<FromGitter> <tenebrousedge> `[1,2,3].product(&.+)`
<FromGitter> <lbarasti> > might be worth a forum post/issue about if its really needed ⏎ ⏎ I'm posting on Forum > Crystal Contrib, will share the link
<FromGitter> <Blacksmoke16> `[1,2,3].product`?
<FromGitter> <Blacksmoke16> the first could also be written as `[1,2,3].product(&.itself)`
<FromGitter> <tenebrousedge> yeah but also `[1,2,3].product(&.-)`
<FromGitter> <tenebrousedge> there was a test for those, anyway
<FromGitter> <Blacksmoke16> still kidna strange imo, `-[1,2,3].product` might be better, although that even looks a bit strange
<FromGitter> <Blacksmoke16> -([1,2,3].product)` maybe
<FromGitter> <tenebrousedge> that doesn't work the same
<FromGitter> <Blacksmoke16> same output?
<FromGitter> <tenebrousedge> ```[1,2,3].product(&.-) #=> -6 ⏎ [1,2,3,4].product(&.-) #=> 24``` [https://gitter.im/crystal-lang/crystal?at=5e19f1bf43c3b62d79d8fcfd]
<FromGitter> <Blacksmoke16> :thinking:
<FromGitter> <Blacksmoke16> well then
<FromGitter> <tenebrousedge> `+` still feels appendicular
alex`` has joined #crystal-lang
alexherbo2 has joined #crystal-lang
<FromGitter> <Blacksmoke16> 👍
Nicolab has joined #crystal-lang
return0e has joined #crystal-lang
return0e_ has quit [Ping timeout: 258 seconds]
coderobe has quit [Ping timeout: 268 seconds]
coderobe has joined #crystal-lang
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
alexherbo2 has joined #crystal-lang
Nicolab has quit [Quit: Leaving.]
ur5us has joined #crystal-lang
daemonwrangler has quit [Ping timeout: 245 seconds]
Nekka_ has joined #crystal-lang
Flipez4 has joined #crystal-lang
Nekka has quit [Quit: zzz]
Flipez has quit [Quit: Ping timeout (120 seconds)]
woodruffw has quit [Ping timeout: 265 seconds]
Flipez4 is now known as Flipez
Nekka_ is now known as Nekka
<FromGitter> <zbaylin> Is there a way to enforce the order specs are executed in? For instance, if I have a database request that's dependent on another spec in a different file.
<FromGitter> <tenebrousedge> are you using spectator?
woodruffw has joined #crystal-lang
<FromGitter> <zbaylin> No just `crystal spec`
<FromGitter> <zbaylin> But I can use spectator
<FromGitter> <zbaylin> Does that lib give me this option?
<FromGitter> <tenebrousedge> it lets you do `before_each` and `before_all`
daemonwrangler has joined #crystal-lang
return0e has quit [Remote host closed the connection]
<FromGitter> <tenebrousedge> and it gives you `let`
return0e has joined #crystal-lang
<FromGitter> <tenebrousedge> specs should usually be order-independent. I think by default spectator will run in a defined order, but it has a wide toolset that should hopefully help you out with writing that either way
<FromGitter> <Blacksmoke16> `before_each` and others are in the stdlib now
<FromGitter> <tenebrousedge> `let` too?
<FromGitter> <Blacksmoke16> no
<FromGitter> <tenebrousedge> :/
<FromGitter> <Blacksmoke16> id be more advised to say refactor you specs so that one spec doesnt depend on another
<FromGitter> <Blacksmoke16> inclined*
zorp has joined #crystal-lang
daemonwrangler has quit [Ping timeout: 258 seconds]
daemonwrangler has joined #crystal-lang
twistedpixels has quit [Quit: ZNC - http://znc.in]
twistedpixels has joined #crystal-lang
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
alex`` has quit [Quit: WeeChat 2.7]
<FromGitter> <stnluu_twitter> is there anyway to do something similar to this? https://play.crystal-lang.org/#/r/8djr
<FromGitter> <stnluu_twitter> I was able to use this same `{{ yield }}` approach for classes, but not enum
daemonwrangler has quit [Ping timeout: 265 seconds]
daemonwrangler has joined #crystal-lang
<FromGitter> <Blacksmoke16> wonder where that `begin` is coming from
<sorcus> Blacksmoke16 :-)
<FromGitter> <Blacksmoke16> i need to rethink how param conversion should work :(
<sorcus> Blacksmoke16 :-( why?
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e1a3601b720fa5b3cf990bd]
alex has joined #crystal-lang
<FromGitter> <Blacksmoke16> because that wouldnt work, since it runs after the validation that would error saying "require path pram user is missing"
<FromGitter> <Blacksmoke16> and its dumb to have to have your path pram be called `user` when it's really just a number
alexherbo2 has joined #crystal-lang
<sorcus> Blacksmoke16 sad :-( But i'm sure you can do that :-)
<FromGitter> <Blacksmoke16> plan is to either 1, pass the raw request to the converter and leave it up to it to pull the right values from it, like ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e1a36923254b6754c90947e]
<FromGitter> <Blacksmoke16> or maybe extract that to a bit higher level and just pass in the value, or raising an exception if a value could not be parsed from the request?
<FromGitter> <Blacksmoke16> TBD :p
daemonwrangler has quit [Ping timeout: 268 seconds]
daemonwrangler has joined #crystal-lang
daemonwrangler has quit [Ping timeout: 265 seconds]
twistedpixels has quit [Ping timeout: 265 seconds]
<FromGitter> <stnluu_twitter> @Blacksmoke16 yeah... i wonder where that begin is from
ur5us has quit [Ping timeout: 260 seconds]
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e1a3afeb720fa5b3cf9b4ed]
<FromGitter> <Blacksmoke16> block gets wrapped in `begin/end` if using `yield`
daemonwrangler has joined #crystal-lang
<FromGitter> <stnluu_twitter> :(
<FromGitter> <stnluu_twitter> any workaround?
twistedpixels has joined #crystal-lang
<FromGitter> <Blacksmoke16> no, i dont think you can use a macro in an enum either
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/8dki
<FromGitter> <stnluu_twitter> welp that sux
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/8dks this works, but :shrug:
<FromGitter> <Blacksmoke16> kinda hack :p
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/8dkx
<FromGitter> <Blacksmoke16> showing expanded macro
<FromGitter> <stnluu_twitter> kind of
<FromGitter> <stnluu_twitter> https://play.crystal-lang.org/#/r/8dky
<FromGitter> <stnluu_twitter> that is essentially `{% yield %}` right?
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/8dkz
<FromGitter> <tenebrousedge> what's the goal here, anyway?
Creatornator has joined #crystal-lang
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/8dl1 use newlines instead
<FromGitter> <Blacksmoke16> generate an enum via a macro
<FromGitter> <stnluu_twitter> goal:
<FromGitter> <stnluu_twitter> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e1a3d223254b6754c90c190]
<FromGitter> <stnluu_twitter> codgen via macro
<FromGitter> <stnluu_twitter> absically
<FromGitter> <stnluu_twitter> basically
<FromGitter> <tenebrousedge> the code is meaningless to me, and codegen is what macros do normally
<FromGitter> <tenebrousedge> is there a ten-word description of what this is useful for?
<FromGitter> <stnluu_twitter> write RPC spec in crystal macro. works natively in crystal, and can generate code for other languages
<FromGitter> <stnluu_twitter> (via the crystal compiler transformer)
<FromGitter> <stnluu_twitter> tldr: rpc without your own lexer
<FromGitter> <stnluu_twitter> @Blacksmoke16 thanks! that works for now :P
<FromGitter> <stnluu_twitter> `/^begin\ |\ end$/`, so i can have begin and end in the enum options
Nicolab has joined #crystal-lang
<FromGitter> <Blacksmoke16> 👍
<FromGitter> <stnluu_twitter> fwiw, enum troubles aside, the thing works with HTTP base RPC server & client in Crystal, and RPC client in JavaScript
<FromGitter> <stnluu_twitter> :D
<FromGitter> <tenebrousedge> 👍
<FromGitter> <stnluu_twitter> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e1a410c6be93b6b36c68f13]
<FromGitter> <watzon> That's pretty cool, good job 😃
<FromGitter> <stnluu_twitter> the spec would look like good old Crystal
<FromGitter> <stnluu_twitter> and generates some horrendous JS
<FromGitter> <stnluu_twitter> ^_^
<FromGitter> <stnluu_twitter> works with native types. none of that stupid "GRPCList<T>" this
<FromGitter> <stnluu_twitter> i'll have a write up when idont feel like procrastinating :P
zorp has quit [Read error: Connection reset by peer]
<FromGitter> <Blacksmoke16> @sorcus decided to just pass in the raw request object
<FromGitter> <Blacksmoke16> can always iterate on it
zorp has joined #crystal-lang
<sorcus> Blacksmoke16 that's great. :-)
<sorcus> Who's good boy? Blacksmoke16 good boy. :-D
blueberrypie has quit [Quit: leaving]
_whitelogger has joined #crystal-lang
daemonwrangler has quit [Ping timeout: 268 seconds]
daemonwrangler has joined #crystal-lang
daemonwrangler has quit [Ping timeout: 265 seconds]
daemonwrangler has joined #crystal-lang
Creatornator has quit [Ping timeout: 268 seconds]
sorcus has quit [Quit: WeeChat 2.7]
zorp has quit [Ping timeout: 265 seconds]
sorcus has joined #crystal-lang
<FromGitter> <Blacksmoke16> now i need to think about error handling, keep it up to the user?
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e1a59ff65540a529afe8e49]
<FromGitter> <Blacksmoke16> like if you do `GET user/foo`
<FromGitter> <Blacksmoke16> probably will leave it up to the user to assert all that, would allow for returning better errors as well
<sorcus> Yeah, i think it would be better...
<sorcus> Blacksmoke16: Hmmm... If it's a convertation error, why user would handle this type of exception?
<FromGitter> <Blacksmoke16> i could auto handle it but the error message wouldn't be as good
<FromGitter> <Blacksmoke16> since i dont have the name or value that failed
<FromGitter> <Blacksmoke16> i could return some generic error but dunno how useful that would be
<sorcus> Blacksmoke16: Add exception callbacks? :-D
daemonwrangler has quit [Ping timeout: 258 seconds]
<FromGitter> <Blacksmoke16> sorry, to be clear when i say `user would have to handle it` i mean like
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e1a5e54b720fa5b3cfa90e7]
<sorcus> Blacksmoke16: I'm sorry too, because english not my mother tongue. And sometimes i don't understand fully some messages X-) And my grammar is soooo ugly. :-( :-( :-(
daemonwrangler has joined #crystal-lang
<FromGitter> <Blacksmoke16> all good
<FromGitter> <tenebrousedge> it's fine
<FromGitter> <tenebrousedge> English grammar is always ugly
<sorcus> :-D
<FromGitter> <Blacksmoke16> so like i could catch the `ArgumentError` when i call `.convert`, however the error would have to be generic since i would lack access to any of the context, like the name of the param, or its value etc
<FromGitter> <Blacksmoke16> but i suppose i should do that, at least would be better default behavior than a 500
<FromGitter> <stnluu_twitter> @Blacksmoke16
<FromGitter> <tenebrousedge> “The problem with defending the purity of the English language is that English is about as pure as a cribhouse whore. We don't just borrow words; on occasion, English has pursued other languages down alleyways to beat them unconscious and rifle their pockets for new vocabulary.”
<FromGitter> <stnluu_twitter> https://play.crystal-lang.org/#/r/8dln
<FromGitter> <stnluu_twitter> lol
<sorcus> tenebrousedge: Sooo.... Switch to russian? С приветом из России :-D :-D :-D
<FromGitter> <Blacksmoke16> ha, that works too :p
<FromGitter> <tenebrousedge> yo hablo espanol, et je parle francais. I'd probably be more interested in Arabic than Russian
<sorcus> tenebrousedge: Haha, ok, stay with English :-D :-D :-D
<sorcus> Blacksmoke16: Your example code looks fine for me.
<FromGitter> <Blacksmoke16> 👍
alexherbo22 has joined #crystal-lang
<sorcus> tenebrousedge: So... Are you from Spain?
<FromGitter> <Nicolab> or France? :)
<FromGitter> <tenebrousedge> Alaska
<sorcus> tenebrousedge: Really? That's cool.
<sorcus> Nicalab: Why France?
alex has quit [Ping timeout: 268 seconds]
alexherbo2 has quit [Ping timeout: 268 seconds]
alexherbo22 is now known as alexherbo2
<FromGitter> <Nicolab> @sorcus because `yo hablo espanol, et je parle francais.`
<FromGitter> <Nicolab> > je parle français
<FromGitter> <Nicolab> it's french
alex has joined #crystal-lang
<FromGitter> <Nicolab> @tenebrousedge I'm addict to Gold Rush (TV series) :D
<FromGitter> <Blacksmoke16> crazy that its been on for like 10 years now
<FromGitter> <Nicolab> in the evening with no time, a good gold rush
<FromGitter> <Nicolab> @Blacksmoke16 yes!