<FromGitter>
<mateuszwieloch> Hey I'm trying to build a terminal UI that will have ability to choose between multiple options like in the image. I'd appreciate advice where to start - what crystal library provides needed functionality, whether to go low level like NCurses bindings or is there something providing it out of the box?
<FromGitter>
<vlazar> ❤️ Wow, that's so cool! So I can use any Rust libs compiled to WASM from Crystal now?
<FromGitter>
<naqvis> thanks and yeah
<FromGitter>
<naqvis> 🙏
<FromGitter>
<vlazar> > A complete and mature WebAssembly runtime
<FromGitter>
<vlazar> Is "mature" part there about it being tested in prod?
<FromGitter>
<naqvis> that applies to `wasmer`
<FromGitter>
<vlazar> gotcha, thank you!
<FromGitter>
<naqvis> 🙏
taupiqueur has joined #crystal-lang
taupiqueur has quit [Ping timeout: 265 seconds]
taupiqueur has joined #crystal-lang
taupiqueur has quit [Quit: taupiqueur]
taupiqueur has joined #crystal-lang
ua_ has quit [Ping timeout: 260 seconds]
<FromGitter>
<Dan-Do> A silly question as I don't know wasm. Does it mean that we can run Crystal code in browser?
ua_ has joined #crystal-lang
<FromGitter>
<naqvis> no, you can't compile crystal code to wasm. But via this shard now you can run other wasm modules from Crystal
<FromGitter>
<naqvis> this shard embeds wasm runtime inside crystal
<FromGitter>
<Dan-Do> 👍
hightower3 has quit [Remote host closed the connection]
hightower3 has joined #crystal-lang
hightower3 has quit [Client Quit]
hightower3 has joined #crystal-lang
hightower3 is now known as hightower2
hightower2 has quit [Remote host closed the connection]
hightower2 has joined #crystal-lang
hightower2 has quit [Ping timeout: 245 seconds]
<FromGitter>
<vlazar> which means if you miss something in Crystal shards you can check https://crates.io/categories/wasm or anything else that works when compiled to WASM
<FromGitter>
<Dan-Do> That's really valuable for the community ❤️
<SamantazFox>
Hmm, I have a weird bug. I'm investigation atm, but the general idea is that because of the decompression issues in HTTP::Client from stdlib
<SamantazFox>
I did implement a decompression routine (https://github.com/iv-org/invidious/pull/2623), but it raises the following exception "HTTP::Client::Response#body_io cannot be nil (NilAssertionError)" in some edge cases.
casionaut has joined #crystal-lang
<SamantazFox>
I've deployed that fix for a few days now, on bare metal Debian, without a problem. But we keep getting issue reports about it.
<SamantazFox>
So I'm trying to figure out if the problem is due to docker, or some specific container.
<FromGitter>
<Dan-Do> Regarding the body_io, sometimes the client cannot parse the response. I have a monkey patch like this
<SamantazFox>
yxhuvud: because of a bug in the stdlib, a response's body is not always decompressed, and rather than checking if it was properly done, I've made a patch in my code to send the Content-Encoding header, which disables auto decompression, and do that by myself.
<SamantazFox>
but, Compress::Gzip::Reader and Compress::Deflate::Reader both takes IOs, not Strings
<yxhuvud>
if gets to end has been called, it will be nothing more to decompress anyhow, so it wouldn't matter
<SamantazFox>
my problem is that `response.body` is a String, and I have to feed it to Compress::Gzip::Reader
<FromGitter>
<Blacksmoke16> `body_io` is only set if you're using the block version of one of the request methods
<SamantazFox>
So I though: let's use response.body_io instead, to directly have an IO
<straight-shoota>
There is no way to access either body or body_io. They're mutually exclusive
<SamantazFox>
That's something I'd expect, yeah, but why `body` is always the full body, as a `String` and `body_io` is that same body as `IO`, but `Nil` on Docker?
<straight-shoota>
Sorry what has Docker to do with this?
<SamantazFox>
I'm trying to figure that out, actually.
<SamantazFox>
Said issue is: "body is sometimes decompressed, sometimes not"
<SamantazFox>
So, I've set "Content-Encoding" to "gzip, deflate" to disable HTTP::Client's auto-decompression, and added the required logic to decompress the body by myself
<SamantazFox>
What's the most recommended? `Foo::Bar.echo` or `Toto::Foo::Bar.echo`
<FromGitter>
<Blacksmoke16> probably doesnt really matter, could argue the former since its shorter, or the latter because its more clear what specific type it points to
<FromGitter>
<jrei:matrix.org> In rare casea you have no choice of the latter if the stdlib uses the same name