@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

codl , an Random Englisch
@codl@chitter.xyz avatar

computer always problem

fasterthanlime ,
@fasterthanlime@hachyderm.io avatar

@codl is this a subtoot

fasterthanlime ,
@fasterthanlime@hachyderm.io avatar

@codl lol nvm I thought we were mutuals! my bad

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

my cats are always unsure whether I'm cleaning because I have guests or whether I'm cleaning because I'm going away, so they're on their best behavior right now on the off-chance it makes me stay

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 OP ,
@fasterthanlime@hachyderm.io avatar

@kinnison that doesn't work (it's the monomorphization thing): both my app and my plug-in invoke tokio functions with different generic types (often, async blocks which are opaque types) — if you use the libtokio.so from the app with the lib, it has missing symbols. if you use the other, same.

fasterthanlime OP ,
@fasterthanlime@hachyderm.io avatar

OH LORDY LORD I solved it.

The outer and inner "tokio"s had different cfgs, so the layout of tokio::runtime::Handle were different, hence, mutex::lock was falling on some other fields, oh god.

fasterthanlime OP ,
@fasterthanlime@hachyderm.io avatar
fasterthanlime OP ,
@fasterthanlime@hachyderm.io avatar

@noah I mean it's not ideal. very easy to accidentally use the wrong thread-local (but tokio::spawn, Sleep::new, etc. will yell at you that there's no reactor running)

..and the whole tokio code is duplicated in all shared objects but... I actually do not mind in this case, since no code changes required = happy me.

fasterthanlime OP ,
@fasterthanlime@hachyderm.io avatar

@noah more importantly, SUPER easy to accidentally enable a different set of tokio features and land on different internal layouts, which uhhh isn't great

fasterthanlime OP ,
@fasterthanlime@hachyderm.io avatar

@noah yeah! I'm very VERY happy with it — this new structure makes build times & deploy times ridiculously fast for me: I can have a new version of my site up and running around the world in ~2 minutes

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

what a time to be alive https://www.twitch.tv/gamesdonequick

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 , (Bearbeitet ) an Random Englisch
@fasterthanlime@hachyderm.io avatar

Neo-noir novel: "He seemed like the kind of person whom, if you'd asked what their threat model was, would answer 'the Blender default cube'"

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

I enjoy flipping back and forth between eating breakfast outside ("at least I didn't have to cook it!") and breakfast at home ("at least I didn't have to pay for it!").

I'm bi alright — bistable.

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

is macOS Sequoia Developer Beta 2 more stable than the first one?

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

me as a rust beginner: yay I love adding methods to random types with trait MyExt
me now: what the fuck are these all traits, who the fuck added all of th-oh.

fasterthanlime OP ,
@fasterthanlime@hachyderm.io avatar

@baloo Using it excessively, let’s say

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
fasterthanlime OP , (Bearbeitet )
@fasterthanlime@hachyderm.io avatar

ok I took my site down for a sec because — you're gonna laugh — "mod_config" was setting the ENVIRONMENT: AtomicU8 to "production" alright, but..

..it was setting its copy. meanwhile the main binary's copy said "development". I THOUGHT IT WAS EVALUATING MARKDOWN TOO MUCH.

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
wingo , an Random Englisch
@wingo@mastodon.social avatar
fasterthanlime ,
@fasterthanlime@hachyderm.io avatar

@wingo "computers are for helping us multiply new matrices"

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

having some fun with https://earthly.dev tonight

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

“We would like to share the trait solver with rust-analyzer by the end of this year”

Let’s goooo!! https://blog.rust-lang.org/2024/06/26/types-team-update.html#fnref-117703

fasterthanlime OP ,
@fasterthanlime@hachyderm.io avatar

P.S: can someone fix those links on the Rust blog footnotes? (the ones that lead to pull requests — people click those, you know!)

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

mhhhhhhHHhhh

fasterthanlime OP ,
@fasterthanlime@hachyderm.io avatar

well I just switched to rspack (and lightningcss), that was on my list anyway

(and lightningcss is part of the parcel cinematic universe so it's not even a true betrayal)

fasterthanlime , an Random Englisch
@fasterthanlime@hachyderm.io avatar
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

@Igigog those are very large pictures, and I used lossy compression for those JXL

fasterthanlime OP ,
@fasterthanlime@hachyderm.io avatar

@thejpster bwahahah

fasterthanlime OP ,
@fasterthanlime@hachyderm.io avatar

@porglezomp Yup I found out and started serving it!

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 , (Bearbeitet ) an Random Englisch
@fasterthanlime@hachyderm.io avatar

IMPORTANT: did you get traumatized by watching Wallace & Gromit as a kid? Specifically “A close shave”? I still have nightmares

fasterthanlime OP ,
@fasterthanlime@hachyderm.io avatar

@closingtags That and “wrong trousers” yes

  • Alle
  • Abonniert
  • Moderiert
  • Favoriten
  • random
  • haupteingang
  • Alle Magazine