@fasterthanlime@hachyderm.io titelbild
@fasterthanlime@hachyderm.io avatar

fasterthanlime

@fasterthanlime@hachyderm.io

hi, I'm amos! 🦀 I make articles & videos about how computers work 🐻‍❄ cool bear's less cool counterpart ✨ be kind

Dieses Profil is von einem föderierten Server und möglicherweise unvollständig. Auf der Original-Instanz anzeigen

fasterthanlime , an Random Englisch
@fasterthanlime@hachyderm.io avatar

Good, uhhh.. good morning

fasterthanlime OP ,
@fasterthanlime@hachyderm.io avatar

oooh, tokio does fun things (like automatically boxing your future if it's big and you're in debug mode)

fasterthanlime OP ,
@fasterthanlime@hachyderm.io avatar

@k0nserv I would assume so!

fasterthanlime OP ,
@fasterthanlime@hachyderm.io avatar

I'm learning lldb against my will, send help

fasterthanlime OP ,
@fasterthanlime@hachyderm.io avatar

@dysfun it's not as bad in my 30s, now that I'm no longer fighting it

fasterthanlime OP ,
@fasterthanlime@hachyderm.io avatar

Ah, I see

fasterthanlime OP ,
@fasterthanlime@hachyderm.io avatar

I'm at a loss re: how to make tokio happy across shared object boundaries. Yes there's N copies of tokio's code, now I can't share them because different monomorphizations = missing symbols (the cargo-add-dynamic trick doesn't work with my "cdylib plugins" approach).

Handle::enter across SOs panics. Handle::spawn panics. I thought "mostly" tokio::spawn needed a "current runtime", but "Sleep::new" does too, duh.

I foresee lots of debugging in my future.. god that's a lot of debugging.

fasterthanlime OP ,
@fasterthanlime@hachyderm.io avatar

@dysfun the module uses a crate that calls tokio::spawn, tokio::time::Sleep::new, etc.

fasterthanlime OP ,
@fasterthanlime@hachyderm.io avatar

@dysfun but yeah, maybe the solution is to patch all those crates to allow passing in an executor instead...

fasterthanlime OP ,
@fasterthanlime@hachyderm.io avatar

@dysfun me neither but that would be fine — hickory-resolver has a "Sync" interface which is #[tokio::main] in a trench coat and that works great! It's getting it to use the tokio executor I already have which is a hassle.

fasterthanlime , an Random Englisch
@fasterthanlime@hachyderm.io avatar

Found another snag re: dynamic linking Rust code — N copies of tokio are present, so that's N distinct thread-locals storing the "current tokio context"

...and the binary is calling the library from an executor, but the library doesn't think so.

https://github.com/tokio-rs/tokio/blob/65d0e08d39f06eba88661d3d6de665b14588f30d/tokio/src/runtime/context.rs#L77-L122

fasterthanlime OP ,
@fasterthanlime@hachyderm.io avatar

Well, it’s nothing nested tokio runtimes cannot fix 🤡

fasterthanlime OP ,
@fasterthanlime@hachyderm.io avatar

@noah having gone through other unsuccessful paths right now: how would you even make that work?

fasterthanlime OP ,
@fasterthanlime@hachyderm.io avatar

@noah pthread_key_create?

fasterthanlime , an Random Englisch
@fasterthanlime@hachyderm.io avatar

Okay well JPEG-XL might not be supported in browsers but nobody said I can't use it as an "original" format in my blog's content/ directory, right?

(Note: I'm still serving AVIF to browsers)

Showing total file sizes: 1.1GiB for PNG, 16MB for JPEG-XL. I explain I used lossy compression with quality 30, which is still visually undistinguishable

fasterthanlime OP ,
@fasterthanlime@hachyderm.io avatar

@andyeff Custom CDN! I do PNG to JXL with Magick but then my site converts with the image crate and some libjxl binding

fasterthanlime , an Random Englisch
@fasterthanlime@hachyderm.io avatar

back on my bullshit

(trying to load Rust code as a dynamic library and getting the segfaults I well deserve)

fasterthanlime OP ,
@fasterthanlime@hachyderm.io avatar

I remember when itch.io suddenly appeared as "logged in as admin" for everyone for a few minutes and I didn't understand how it could happen

I UNDERSTAND NOW OKAY. RAPID DEPLOY PIPELINES CUT BOTH WAYS

fasterthanlime OP ,
@fasterthanlime@hachyderm.io avatar
  • Alle
  • Abonniert
  • Moderiert
  • Favoriten
  • random
  • haupteingang
  • Alle Magazine