jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.28.0 | 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
<FromGitter> <dscottboggs_gitlab> > why would a developer not want an overflow error? ⏎ ⏎ There is a cost associated with checking for an overflow. I'd say that *usually* it's better to use a type that does so automatically, because it's a mistake that can be avoided, but there are circumstances where it's not worth it.
<FromGitter> <dscottboggs_gitlab> @girng ^^
wymillerlinux has quit [Remote host closed the connection]
wymillerlinux has joined #crystal-lang
<FromGitter> <girng> Must be in the realm outside of my expertise. Like heavy mathematic formulas and whatnot?
<FromGitter> <dscottboggs_gitlab> mainly stuff that has to happen within a strict latency. So called "real-time" code. Over my head too.
<FromGitter> <girng> interesting
<FromGitter> <girng> i view basically all code through the lens of game development, so my perceptions are a bit skewed
<FromGitter> <girng> when i see code i've never seen before (or certain crystal syntax): my brain thinks: "how can i use this to my advantage in game development". that's it lol
<FromGitter> <girng> i need to broader my horizons
<FromGitter> <dscottboggs_gitlab> eh, I need to be more focused :p
<FromGitter> <girng> that's why i have such issues with programming i think. it's like tunnel vision for me
<FromGitter> <dscottboggs_gitlab> making games?
<FromGitter> <Blacksmoke16> step 1, write tests
<FromGitter> <girng> not making games, but like knowledge about programming in general. i only think of code that's applicable / useful for me. not in general. for example, i'd never probably use `&**`
<FromGitter> <girng> so now that syntax is dead to me
<FromGitter> <dscottboggs_gitlab> yeah I do that, kinda....
<FromGitter> <girng> really?
<FromGitter> <dscottboggs_gitlab> what's `&**`
<FromGitter> <girng> https://crystal-lang.org/api/0.28.0/Int.html#%26%2A%2A%28exponent%3AInt%29%3Aself-instance-method
<FromGitter> <dscottboggs_gitlab> Yeah I think you have to -- no one can learn everything. You've gotta focus on what's useful to you, or at the very least what you find interesting
<FromGitter> <dscottboggs_gitlab> wait.... how is that different from `**`?
<FromGitter> <girng> doesn't trigger the overflow
<FromGitter> <dscottboggs_gitlab> Oh I see
<FromGitter> <girng> LOL i asked the same thing
<FromGitter> <dscottboggs_gitlab> yes, that's probably a good thing to just forget about. It's better to know where to look for that than to have it all in your head
<FromGitter> <girng> i just was browsing crystal's github and saw a post by asterite with that syntax
<FromGitter> <girng> i was like wtf does this do, and looked it up lol
<FromGitter> <dscottboggs_gitlab> in my day-to-day I'll write 3 or 4 different languages, I can't memorize all those stdlibs and nuances -- just gotta know where the docs are
<FromGitter> <girng> damn, which languages?
<FromGitter> <girng> i guess i'm kinda the same. i cycle between SQL, gdscript, crystal and php. i usually go to the docs for them as well
<FromGitter> <dscottboggs_gitlab> Python and BASH at work, JS and Crystal at home. movie time sorry ✌️
<FromGitter> <girng> ✋ hf, ttyl
<FromGitter> <Blacksmoke16> forgot how much stuff is involved with an angular project
<FromGitter> <Blacksmoke16> could spent hours just playing with config options
<FromGitter> <girng> what you making?
<FromGitter> <Blacksmoke16> plan is to make an online store for a game i play
<FromGitter> <Blacksmoke16> but we'll see how it goes
<FromGitter> <girng> that one ship game?
<FromGitter> <girng> are u gonna use crystal for the backend
<FromGitter> <Blacksmoke16> yes, and thats the idea
<FromGitter> <Blacksmoke16> partially for the game, partially to act as a real world test of my stuff
<FromGitter> <Blacksmoke16> game has a nice API so can do some neat stuff
<FromGitter> <Blacksmoke16> like send in game mails programmatically, read assets/contracts/wallets, etc
<FromGitter> <girng> pretty cool
<FromGitter> <Blacksmoke16> indeed
<FromGitter> <girng> i remember you mentioning something like this last year and it's how you got into programming
<FromGitter> <Blacksmoke16> it played a part thats for sure
<FromGitter> <Blacksmoke16> plan is to use athena for api, mosquito for async stuff, and charon as the orm
<FromGitter> <Blacksmoke16> with angular8 as client
<FromGitter> <girng> as a vanilla js kinda guy, i don't think i'd touch angular or any js frameworks outside of game frameworks with a ten foot pole lol
<FromGitter> <Blacksmoke16> they have some nice features you cant ignore tho
<FromGitter> <Blacksmoke16> why reinvent the wheel
<FromGitter> <girng> iuno, just seems so convoluted
<FromGitter> <Blacksmoke16> going from angularjs to angular2+ is a big jump
<FromGitter> <Blacksmoke16> requires a lot of extra stuff vs just adding a script tag
<FromGitter> <dscottboggs_gitlab> @j8r sent me https://svelte.dev/ the other day -- it looks really cool.
<FromGitter> <dscottboggs_gitlab> ( waiting on my bf to make some food :D )
<FromGitter> <Blacksmoke16> now i just gotta remember how all this works heh
<FromGitter> <Blacksmoke16> prob make the api first...
<FromGitter> <girng> eh
<FromGitter> <girng> that does look pretty cool not gonna lie
<FromGitter> <Blacksmoke16> What? That svelte?
<FromGitter> <girng> yah
return0e has quit [Remote host closed the connection]
<alex``> how to reopen a tempfile once closed?
<alex``> I use File.read(tempfile.path)
<FromGitter> <watzon> I don't believe you can. They are temporary for a reason. I'm pretty sure they're deleted once closed.
<FromGitter> <dscottboggs_gitlab> They are not
<FromGitter> <dscottboggs_gitlab> You can `File.read tempfile.path` after it is closed. Or `File.open` either way\
<FromGitter> <Blacksmoke16> But you should delete them
<FromGitter> <dscottboggs_gitlab> yes
<FromGitter> <watzon> Then his `File.read` should be working
<FromGitter> <dscottboggs_gitlab> yup
<FromGitter> <Blacksmoke16> He didn't say it wasn't :p
<FromGitter> <watzon> Well I assume since he's asking lol
<FromGitter> <Blacksmoke16> Are you getting a specific error
<FromGitter> <Blacksmoke16> ?*
<alex``> I was asking if it was the way to read temp files
<alex``> is there a command to shellescape like Ruby?
<FromGitter> <dscottboggs_gitlab> Backtics work in crystal
<FromGitter> <dscottboggs_gitlab> you can use `Process` for more control`
<alex``> I need to escape them to write something to a file
<alex``> I have a list of <input> <output> arguments
<alex``> and need to write to a file to be executed as a shell script
<FromGitter> <Blacksmoke16> Could probably use ecr to generate the shell file
<alex``> ecr?
<FromGitter> <Blacksmoke16> But that would be at compile time
<FromGitter> <Blacksmoke16> Similar to erb from rails
<FromGitter> <watzon> ecr = embedded crystal
<alex``> my use case is to rewrite https://asciinema.org/a/91392 in Crystal
<alex``> how does ecr could help?
DTZUZO has joined #crystal-lang
<FromGitter> <dscottboggs_gitlab> ECR is just a shortcut for `String::Builder`
<FromGitter> <Blacksmoke16> Hmm, I don't really know what I'm looking at
<FromGitter> <Blacksmoke16> i.e. you could generate the shell file at compile time with the args you give it, but it would be at compile time
<FromGitter> <Blacksmoke16> so if your args are at runtime, it wouldnt help
<alex``> :(
<FromGitter> <dscottboggs_gitlab> I mean, you could have a proc which allows a subset of the ECR to be built at runtime
<alex``> does option parser support -option or it enforces gnu styles --option-name?
chemist69 has quit [Ping timeout: 250 seconds]
return0e has joined #crystal-lang
chemist69 has joined #crystal-lang
_whitelogger has joined #crystal-lang
<FromGitter> <girng> last post on twitter end of may, so i take that as a yes :D
alex`` has quit [Ping timeout: 252 seconds]
alex`` has joined #crystal-lang
_whitelogger has joined #crystal-lang
<FromGitter> <watzon> I haven't talked to him in a bit. If you're around @sdogruyol, hi!
<alex``> may be a dumb question but why not hsve followed the jsnnonotation for proc?
<alex``> (a : Int32) -> a + a
blassin9 is now known as blassin
blassin0 has joined #crystal-lang
blassin has quit [Ping timeout: 272 seconds]
blassin0 is now known as blassin
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
wymillerlinux_ has joined #crystal-lang
wymillerlinux has quit [Ping timeout: 258 seconds]
wymillerlinux_ is now known as wymillerlinux
_whitelogger has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
laaron has quit [Client Quit]
laaron has joined #crystal-lang
laaron has quit [Client Quit]
laaron has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
<FromGitter> <watzon> What?
<FromGitter> <girng> lol
<FromGitter> <girng> alex, you mean json notation?
<FromGitter> <tenebrousedge> I think he was asking why Crystal procs aren't written like (typed) arrow functions in javascript
<FromGitter> <watzon> Ahh
<FromGitter> <r00ster91> why does CEST not work? https://carc.in/#/r/70qy
<FromGitter> <watzon> @r00ster91 because it's not an IANA timezone
<FromGitter> <watzon> These should all be valid https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
<FromGitter> <r00ster91> ooh
<FromGitter> <r00ster91> time can be so confusing sometimes
<FromGitter> <tenebrousedge> probably because it's wibbly-wobbly
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
ashirase has quit [Ping timeout: 258 seconds]
<FromGitter> <girng> i wonder why CEST is not in the tz database
ashirase has joined #crystal-lang
<FromGitter> <watzon> Because it doesn't specify a specific location I'd assume
<FromGitter> <girng> sdo is on!
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
_whitelogger has joined #crystal-lang
alex`` has quit [Ping timeout: 248 seconds]
alex`` has joined #crystal-lang
<FromGitter> <bararchy> So, an idea why URI#to_s won't escape (encode) param values? seems obvious no?
<FromGitter> <bararchy> or maybe we need URI#encode! or something
<oprypin> bararchy, the query should have already been specified as escaped
<oprypin> also there is no strict requirement for what "values" is in a query string. it;s just a completely arbitrary string
<FromGitter> <bararchy> WDYM ?
<FromGitter> <bararchy> `specified as escaped` where ?
<oprypin> uri.query should already contain the escaped value
<FromGitter> <bararchy> I see
<oprypin> that is also what happens when using URI.parse - the original string contains the escaped query string as part of it, and that gets directly assigned to `query`
<FromGitter> <bararchy> So, I I want to make sure it's encoded propery from a user supplied value. ⏎ I would need to encode it beforehand with HTTP::Param ?
<oprypin> for sure
<oprypin> i mean, this code is already kinda invalid
<oprypin> the character `' '` is not allowed in an HTTP URI
<FromGitter> <bararchy> hmmm not ideal -> https://play.crystal-lang.org/#/r/70sf
<FromGitter> <bararchy> you mean space? it should be encoded to %26 or something like that
<FromGitter> <bararchy> was it %20?
<FromGitter> <bararchy> buy HTTP::Params uses the `+` (form urlencoded rules)
<oprypin> bararchy, well yes, it should be encoded indeed,, why didnt u do that?
<oprypin> bararchy, i should point your attention to https://tools.ietf.org/html/rfc1738 https://tools.ietf.org/html/rfc3986
<oprypin> they never define the characters '&' or '=' for any purpose; an URI is not concerned with them
<FromGitter> <bararchy> Let me try and explain my usecase better
<oprypin> > buy HTTP::Params uses the `+` (form urlencoded rules)
<oprypin> yep, that is indeed correct
<FromGitter> <bararchy> So, in my usecase I add arbitery data to either HTTP::Pramas (body) or URI, I want a "sure" way to handle encoding. ⏎ for example, for URI `https://test.com/?bla=1` I might add a token like `<script>alert(1)</script>` which will result in `https://test.com/?bla=1<script>alert(1)</script>`, now, this is all nice and well, but, I want to make sure it's been rightly encoded when it's being sent to the target.
<FromGitter> ... ⏎ Currently I do some tests (target is body? parse with HTTP::Params, `to_s` encodes it , all good and well.) now, I do the same for URI, but, I need to manually change each `+` to the relevant `%20`
<FromGitter> <bararchy> now, I currently use this logic: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5cf27dbb38736d7e0ddb5408]
<FromGitter> <bararchy> but it seems sub-optimal
<FromGitter> <bararchy> I thought if we have something better
<oprypin> bararchy, you may just be interested in https://crystal-lang.org/api/0.28.0/URI.html#escape%28string%3AString%2Cspace_to_plus%3Dfalse%29%3AString-class-method
<FromGitter> <bararchy> oprypin I know about this method, but, to use it I need to parse the string, go over each parameter value, esace it (+ or %20) and rebuild the whole string back ⏎ This is something I hoped URI can do for me, or at least a way to control which of the escapes `HTTP::Pramas` uses
<oprypin> are you sure you need to go over each parameter value?
<FromGitter> <bararchy> yes, otherwise URI.escape kills `=` and `&`
<FromGitter> <bararchy> also, param names should never be escaped
<oprypin> wha
<FromGitter> <bararchy> `URI.escape("bar=1&foo=2")` => `bar%3D1%26foo%3D2`
<oprypin> or a much more convoluted but generalized way to get the same result
<oprypin> bararchy, this is a great example for you, explains clearly the separation of concerns between URL and Params: https://carc.in/#/r/70sm
<FromGitter> <bararchy> The example is great, but it will fail, as it still uses `+` instead of `%20` for spaces :)
<oprypin> the example is perfect
<oprypin> `+` is the correct way
<FromGitter> <bararchy> Not for URI, only for form-urlencoded
<oprypin> yes it is
<FromGitter> <bararchy> in URI it should be `%20`
<oprypin> it not only works but also is produced if you type spaces into the search field yourself
<FromGitter> <bararchy> :)
<oprypin> and what's your point?
<FromGitter> <bararchy> Now in the query part, spaces may be encoded to either "+" (for backwards compatibility: do not try to search for it in the URI standard) or "%20" while the "+" character (as a result of this ambiguity) has to be escaped to "%2B".
<FromGitter> <bararchy> (from the above StackOverFlow)
<oprypin> it's not part of the URI standard because forms are not part of URI standard at all
<oprypin> and that SO answer is frankly wrong then
<FromGitter> <bararchy> So, it boils down to "use whichever you prefer" ?
<oprypin> either works, yes
<FromGitter> <bararchy> I see
<FromGitter> <bararchy> if this is indeed the "RFC" if we can even call it that, then I'm good
<oprypin> but if you go to the most used page of the most used website on the most used browser and type a space in the field, you end up getting a + in the URL
<FromGitter> <bararchy> You seems to be right
<FromGitter> <bararchy> I'll go that why then, it makes my life much easier
<oprypin> ha, am i understanding this correctly that this is not in any standard?
<oprypin> https://tools.ietf.org/html/rfc3875#section-4.1.7 : `For example, form submission from an HTML document uses application/x-www-form-urlencoded encoding, in which the characters "+", "&" and "=" are reserved`
<oprypin> but the fact that it stats with 'x-' means it's not standardized
<oprypin> then there's an expired draft attempting to standardize it https://tools.ietf.org/html/draft-hoehrmann-urlencoded-01#section-5
<oprypin> basically +, & and = are pure convention and indeed not defined in a standard :>
<FromGitter> <bararchy> the world of HTTP :(
<oprypin> but as I was saying, an URI doesn't care about the contents of the query string whatsoever, but it does, indeed, define that it can contain percent-encoded characters and CANNOT contain some reserved characters
<FromGitter> <bararchy> wait to see that Microsoft in IIS uses `\n` to split lines (headers, body, etc..) , while linux uses `\r\n` everywhere
<oprypin> then the value (containing `%20` or `+`) is passed to a parser of `application/x-www-form-urlencoded`, which, if it sees `%20`, it knows already that it's a space by standard; but if it sees `+`, that is defined in the `www-form-urlencoded` standard (or just convention apparently, lol) to mean a space
<oprypin> `HTTP::Params` plays the role of "parser of `application/x-www-form-urlencoded`" btw
<FromGitter> <bararchy> btw, this means that `%20` == space always, while `+` == space only is `Content-Type` header is set to `x-www-form-urlencoded`
<oprypin> this is not related to the header
<oprypin> all current HTTP servers and clients assume the query string **purely by convention** to be `application/x-www-form-urlencoded`
<FromGitter> <bararchy> I see, so this is the missing pieace of info I was missing
<FromGitter> <oprypin> oof, ⏎ userscript gone wrong
<FromGitter> <bararchy> XD
<FromGitter> <oprypin> one is completely free to opt out of the convention though! ⏎ https://carc.in/#/r/70su
Yxhuvud has quit [Ping timeout: 252 seconds]
alex`` has quit [Ping timeout: 258 seconds]
alex`` has joined #crystal-lang
Yxhuvud has joined #crystal-lang
<FromGitter> <nsuchy> Did a fun little writeup on rapid parsing of JSON and SQLite Insertions 😄 ⏎ https://lunorian.is/2019/06/01/how-i-parsed-huge-json-files-into-an-sqlite-database-in-under-a-second-using-the-power-of-crystal-language/
_whitelogger has joined #crystal-lang
<FromGitter> <tenebrousedge> 👍
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
wymillerlinux has quit [Read error: Connection reset by peer]
alex`` has quit [Ping timeout: 258 seconds]
alex`` has joined #crystal-lang
<FromGitter> <bew> hum.. this looks wrong: https://carc.in/#/r/70t4 why *inside* Bar I can say `def Bar.foo` and it works... I would expect it to throw an error on the line `def Bar.foo` saying that there is no type `Bar` in `Foo::Bar`, no?
<FromGitter> <bew> adding a type `Bar` in `Foo::Bar` does the expected behavior though
<FromGitter> <tenebrousedge> you could use `self` there just as easily
<FromGitter> <bew> I know
<FromGitter> <tenebrousedge> I'm not sure what you see as a problem there
<FromGitter> <bew> basically, when you have a type like `module Foo; end` then you can do `def Foo.method; end` to add a module method to `Foo` (similar to reopening module like so: `module Foo; def self.method; end; end`)
<FromGitter> <bew> the issue I'm trying to show is that from inside the module (`module Foo; ..HERE..; end`), if I reference the module I'm in (`Foo`), I can add methods to it.. I would expect that `def Foo.method; end` would lookup a type in the current scope (and there is no type `Foo::Foo`), not add the method to the existing `Foo`... (It's pretty hard to explain ^^)
<FromGitter> <Blacksmoke16> well since you name your module `Foo::Bar`, it would be the same as like `module Foo; module Bar; def Bar.foo...; end; end`
<FromGitter> <Blacksmoke16> which as you said would be same as `self.foo`
<FromGitter> <bew> forget the method, check that https://carc.in/#/r/70t6
<FromGitter> <Blacksmoke16> i still dont see what thats an issue?
<FromGitter> <bew> actually, it's logical... since it can't find a type `Bar` in `Foo::Bar`, then it goes up to `Foo` and searches a `Bar` type, and finds it...
<FromGitter> <bew> naa, all good :D
<FromGitter> <Blacksmoke16> but it did find a type `Bar`
<FromGitter> <Blacksmoke16> https://carc.in/#/r/70t9
<FromGitter> <Blacksmoke16> its self
<FromGitter> <Blacksmoke16> since thats the current module its in
<FromGitter> <bew> yes but no, it does not match like self immediately, I'm pretty sure it does what I said just before!
<FromGitter> <Blacksmoke16> dunno
<FromGitter> <bew> and if you add a `Bar` type in `Foo::Bar`
<FromGitter> <Blacksmoke16> either way :p
<FromGitter> <bew> https://carc.in/#/r/70ta
<FromGitter> <bew> then it finds it immediately, no need to search a `Bar` in `Foo`, there is one right here..
<FromGitter> <bew> either way, no prob' crystal is still awesome :P
DTZUZO has quit [Ping timeout: 252 seconds]
<FromGitter> <r00ster91> am I blind or is there really no method that is like `includes?` but returns the value if it has that or `nil`?
<FromGitter> <Blacksmoke16> find?
<FromGitter> <Blacksmoke16> https://crystal-lang.org/api/0.28.0/Enumerable.html#find(if_none=nil,&block)-instance-method
<FromGitter> <Blacksmoke16> `arr.find(&.==(17))`
<FromGitter> <r00ster91> yeah I looked at that but IMO `[1, 2, 3].find(3)` would be nicer than `[1, 2, 3].find { |v| v == 3 }`
<FromGitter> <Blacksmoke16> `(&.==(3))`but yea, oh well
<FromGitter> <r00ster91> but I guess I will use `find` then
<FromGitter> <Blacksmoke16> other option would be to do like `(idx = arr.index(3)) ? arr[idx] : nil`
<FromGitter> <Blacksmoke16> but find is best option here imo
<FromGitter> <r00ster91> yea find is good enough
DTZUZO has joined #crystal-lang
<alex``> How to get the path of the current file?
<alex``> I need to get the path of bin/<crystal-application>
<FromGitter> <bararchy> *FILE*
<FromGitter> <bararchy> `__FILE__
<FromGitter> <bararchy> `__FILE__`
<FromGitter> <bararchy> lol
<FromGitter> <bararchy> the last one, sorry
<FromGitter> <bararchy> and you can get the current dir via `__DIR__`
<FromGitter> <bararchy> Note that this will ofc change with regard to which file it was in compilation time
<FromGitter> <bararchy> you can use a more dyncmic approch via `Dir.current + "/" + PROGRAM_NAME`
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
<alex``> bararchy Thanks
<alex``> bararchy __FILE__ gives me the path to src/app.cr nn?
<alex``> Dir.current will not help because it’s the current working directory, not the path to the executable
<alex``> ?
<FromGitter> <Blacksmoke16> `__FILE__ references the full path to the currently executing crystal file.`
<FromGitter> <Blacksmoke16> https://github.com/Blacksmoke16/crylog/ version `0.1.0` is now officially released
<FromGitter> <tenebrousedge> congrats!
<FromGitter> <j8r> 🚀
<FromGitter> <Blacksmoke16> blog post incoming
<FromGitter> <tenebrousedge> hmmm, yeah, I should work on one or two of those later
<FromGitter> <tenebrousedge> Heroku, y u no love me?
<FromGitter> <Blacksmoke16> https://github.com/Blacksmoke16/athena DI stuff along with some nice refactors to configuration among others is now merged as well for those who like to be on the cutting edge
<FromGitter> <Blacksmoke16> https://dev.to/blacksmoke16/productive-logging-with-athena-crylog-3pbe and blog post to go with it 🚀
<mps> Blacksmoke16: nice, thanks
<FromGitter> <Blacksmoke16> np :)
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
teardown has quit [Ping timeout: 244 seconds]
<FromGitter> <j8r> mps: any news of jirutka, he is busy?
<mps> j8r: it would be better to ask him. There were some kind of conflict but I don't know what exactly
<FromGitter> <j8r> Is he usually in Alpine IRC?
<mps> j8r: yes, but he doesn't 'speak' there, he is even channel OP. there were conflict with some developer and he stopped 'speak' there or on Alpine ML's although he still maintain a lot of packages
<mps> he is still Alpine developer and respectable one
<mps> but he doesn't 'speak' there. Maybe you can reach him on Adelie Linux IRC or ML, but I'm not sure about that because I never used Adelie comm's channels
<FromGitter> <j8r> I guess I can open a new PR for https://github.com/crystal-lang/crystal/pull/5862 , and give all the credits to jirutka of course
<mps> ah, interesting. inform me when you prepare it, please
<FromGitter> <j8r> np... why?
<mps> to try to build it
<mps> or I misread PR
<FromGitter> <j8r> ok. I use qemu-arm on my side
<mps> I have real armv7 with 4GB RAM and 4/8 CPU's
<FromGitter> <j8r> wow, noice. what is it?
<mps> old samsung exynos chromebook, peach 5800
<alex``> how to pretty print json?
<alex``> something like jq output
<FromGitter> <Blacksmoke16> `.to_pretty_json`?
<alex``> more or less, but it does not colorize the output of fields
<alex``> I can use .colorize(color) but it will colorize the whole
<FromGitter> <Blacksmoke16> then you'll have to build out your objects manually and color what you want
<FromGitter> <Blacksmoke16> what do you want to color specifically??
<FromGitter> <Blacksmoke16> im assuming you mean so numbers/bools/strings are diff colors?
<FromGitter> <Blacksmoke16> if so could do something like https://play.crystal-lang.org/#/r/70tt
<FromGitter> <Blacksmoke16> where you override the methods on the json builder to color each type
<FromGitter> <Blacksmoke16> but would have to be ok with this affecting ALL your `to_json`
moei has quit [Quit: Leaving...]
<alex``> I was reading from STDIN a list of arguments
<FromGitter> <Blacksmoke16> ehh cant say im familiar with that error
<alex``> btw a ncurse program does not work with Process.run("vi"), but works with system("vi"), why?
<FromGitter> <Blacksmoke16> https://github.com/crystal-lang/crystal/blob/639e4765f3f4137f90c5b7da24d8ccb5b0bfec35/src/process.cr#L545 `system()` just calls `Process.run`, so prob some other arg getting passed to `Process.run`?
<alex``> Blacksmoke16: I think it is because I was redirecting stdin to a program, and using STDIN.raw
<FromGitter> <Blacksmoke16> :shrug:
<alex``> printf 'foo\nbar\n' | bin/batch
<alex``> what is the equivalent of STDIN.reopen '/dev/tty' unless STDIN.tty? in crystal?
<alex``> I think it will fix
<FromGitter> <Blacksmoke16> i have no idea
<alex``> tty = File.new("/dev/tty")
<alex``> STDIN.reopen tty
<alex``> worked
<FromGitter> <Blacksmoke16> nice one
<FromGitter> <Blacksmoke16> got a compile error that lead me to https://github.com/crystal-lang/crystal/wiki/Compiler-error-messages#cant-infer-block-return-type, shouldnt it work if you define a return type of `name`? https://play.crystal-lang.org/#/r/70ui
<FromGitter> <Blacksmoke16> i would think it would know that it'll return a string now?
<FromGitter> <Blacksmoke16> ah, works when you add a ` @name : String`
<FromGitter> <Blacksmoke16> works for me
<FromGitter> <girng> 👍