@yosh@toot.yosh.is
@yosh@toot.yosh.is avatar

yosh

@yosh@toot.yosh.is

Better things are not only possible; they're within reach.

Concurrent Computing ←
Programming Language Design ←
Rust and WebAssembly at Microsoft ←

u(๑╹ᆺ╹)

This profile is from a federated server and may be incomplete. Browse more on the original instance.

isntitvacant, to random
@isntitvacant@hachyderm.io avatar

A jetlagged, maybe-silly thought: what if, instead of defining a language to compose wasm components (as in WAC), we took a page from pulumi/terraform CDK and exposed wasm component composition as a set of javascript APIs

yosh,
@yosh@toot.yosh.is avatar

@isntitvacant if you’re going to do this, why would you define it in JS if you could instead use any language for this via WIT?

yosh, to random
@yosh@toot.yosh.is avatar

@fasterthanlime hey what’s that application called again you use to edit your scripts in? I remember it looked pretty neat, but I don't remember what it's called.

yosh, to random
@yosh@toot.yosh.is avatar

I too have discovered balantro oh no

yosh, to random
@yosh@toot.yosh.is avatar

LRT: wooh, the Rust compiler has apparently improved compile speeds by nearly 40% since 2020, as measured on Linux. That’s actually incredible!

yosh, to random
@yosh@toot.yosh.is avatar

Wrote a few words on how we could adapt the async let syntax introduced in Swift SE-0304 to async Rust. But rather than using tasks, we could lower them to just futures and futures-concurrency.

I've include an example of how we'd write this today; and tbh - it's kind of convinced me we should maybe look into this more seriously, sooner. (Known unknown: I don't know whether the compiler can access the control flow graph soon enough to insert the right rewrite rules)

https://github.com/rust-lang/keyword-generics-initiative/blob/15c0fe4d5a367ab13c178290e5367989918c546f/evaluation/auto-concurrency.md

yosh, to random
@yosh@toot.yosh.is avatar

I was talking with TC from WG Async yesterday, and I think we arrived at a useful framing for cancellation in async Rust: we should treat it nearly identically to panic.

A panic is an exceptional state in Rust: you can usually catch it, but when you do you probably want to to treat all resources in the panic's blast zone as poisoned, and usually discard them. You don't, and I repeat - do not - use panic as a primary control-flow mechanism in Rust. And the same applies to async cancellation.

yosh,
@yosh@toot.yosh.is avatar

“What about the select macro tho?” - I've been advising people for the past five years to steer clear of select!. We do not need it, we should not use it. Better alternatives exis

"cancellation safety" exists outside of the type system, and bringing it into the type system would probably be about as useful as UnwindSafe (which we're in the process of removing). Trying to recover from cancellation really is similar to trying to recover from panics: as in, you probably shouldn't be doing it

yosh,
@yosh@toot.yosh.is avatar

I really don't have the time to jump on this; but I'm this close to writing a chapter for the async book to just put it all into words.

People don't really think of .await as "control flow may permanently yield to the caller here". And yet that's exactly what it does.

yosh, to random
@yosh@toot.yosh.is avatar

I’m out here writing async runtimes again like it’s 2019 — very pleased that I somehow still got it, hehe

yosh,
@yosh@toot.yosh.is avatar

Look at how cute it is! I wrote an HTTP client for it too today! This all runs on WASI 0.2, which I think it's shaping up really nicely!

yosh, to random
@yosh@toot.yosh.is avatar

I just compiled and published a list of national Covid wastewater dashboards!

https://github.com/yoshuawuyts/covid-wastewater-dashboards

These can be pretty tricky to find; so I figured I should make a list of the ones I know of. If you know of any not on this list, please let me know or file a PR.

yosh, to random
@yosh@toot.yosh.is avatar

@jer what’s your crate called again which makes everything scream if you LD_PRELOAD it? It’s the best and I want to reference it in a demo :P

thejpster, to random
@thejpster@hachyderm.io avatar

Idle thought: what if in Rust you were able to write:

pub nopanic fn foo() { … }

Functions marked nopanic can only perform operations that are themselves nopanic. A bit like const fns. If you really wanted you could make main a nopanic function. Unchecked arithmetic and slicing, and functions like unwrap, would all be forbidden inside a nopanic function.

You could also use the keyword “safe” instead of “nopanic”, leaving the default to be ?safe, or semi-safe (no UB, but could panic).

yosh,
@yosh@toot.yosh.is avatar

@thejpster yessssss!!

yosh,
@yosh@toot.yosh.is avatar

@thejpster :D

The way I’ve been thinking about my effects work is roughly: it’s the smallest extension to the language I can conceive of which will enable us to introduce these kinds of notations in a consistent, backwards-compatible way.

yosh, to random
@yosh@toot.yosh.is avatar

Async closures are finally available on nightly Rust! To celebrate I spent 30 mins today hacking together a semantically correct implementation of async Iterator::filter: https://github.com/yoshuawuyts/async-iterator/pull/5

This can actually borrow items in async closures; which is something that wasn't possible before. But also: check out how cool those bounds are!

whitequark, to random
@whitequark@mastodon.social avatar

I'm now officially a Bytecode Alliance Recognized Contributor 😊

I'm looking forward to many more years of fruitful collaboration and beautiful sociotechnical projects

yosh,
@yosh@toot.yosh.is avatar

@whitequark woohhh 🎉
Well deserved!

yosh, to random
@yosh@toot.yosh.is avatar

One of the worst, but imo solvable, aspects of email is that "reply" and "reply all" are both presented as equivalent options - and yet 99% of the time "reply all" is what you want to be doing.

It's either you want to reply to the thread ("reply all”), or you want to reply but modify the list of participants (“reply all” + edit recipients). "reply" is so rarely the right action, I don't understand why it is featured so prominently. Imo it really shouldn’t be.

yosh, to random
@yosh@toot.yosh.is avatar

Just saw an ad for consultations with calligraphers to help you make cooler signatures. And like, that seems pretty fun?

There’s some security risk to that, but I feel like, signatures aren’t particularly trusted anymore anyway?

yosh, to random
@yosh@toot.yosh.is avatar

New blog post: Extending Rust's Effect System

It's a transcript of the talk I gave last year at RustConf. I'm excited the videos are finally online so I can post this! This took me so many hours to put together; I hope people will enjoy it!

https://blog.yoshuawuyts.com/extending-rusts-effect-system/

xgranade, to random
@xgranade@wandering.shop avatar

You know what I miss? Video players. Not like a Netflix player, a Disney+ player, a YouTube player, a Crunchyroll player, a Hulu player....

Something where the interface is focused around playing videos and not around consuming a specific subscription. It was never the case with DVDs that the pause button moved around or worked differently depending on the movie studio that published a DVD.

yosh,
@yosh@toot.yosh.is avatar

@xgranade I like Infuse for exactly this reason • I have it pointed at an Emby server and it works great like that.

Separating the backend from the front end, neither of which is an app with a subscription. But more like, tools doing what they were built to do.

yosh, to random
@yosh@toot.yosh.is avatar

So you know the term “headless browser” which is a browser without a front end?

What would you call the opposite of that? Like a bodyless browser? For things which don’t actually contain the main thing, but only things like metadata. Like an HTTP request without a payload. Or a type system without runtime semantics?

yosh, to random
@yosh@toot.yosh.is avatar

Not that anyone asked but: I don’t have a Bluesky account. I have no intention of creating one either. Despite some of the folks working on the protocol being former colleagues and are generally quite lovely.

I view Bluesky as Twitter all over again. Someone needs to pay for all the video and images to be hosted. That bill is not being footed by the users of Bluesky, but by venture capital firms. So we need to ask: what is the plan for when Bluesky inevitably needs to start generating money?

yosh, to random
@yosh@toot.yosh.is avatar

It’s fun to see folks in th Rust community discover sans-io style libraries. Once you get the hang of it, I’ve found it often segues to thinking about capabilities as well.

I co-authored an entire sans-io HTTP stack a few years ago: https://blog.yoshuawuyts.com/async-http/ — I believe we had like, one piece of IO squirreled away there to handle HTTP timeouts correctly, and never quite got around to fixing it. But largely I believe this is the way we should be authoring our protocol libraries.

yosh,
@yosh@toot.yosh.is avatar

The idea that you could use this to abstract this over async is a strange one to me tho. Like, the interface for these libraries is either byte streams (AsyncRead) or object streams (AsyncIterator). HTTP/1.1 is basically a conversion of a byte stream to a sequence of object streams.

While it’s possible to use sans-io async libraries in non-async scenarios by using noop wakers — the other way around will get you in trouble the second you care about back-pressure. Which, spoiler, is always.

yosh,
@yosh@toot.yosh.is avatar

Oh I’m re-reading the same-io docs and I now see what they recommend doing:

https://sans-io.readthedocs.io/how-to-sans-io.html

This is a step beyond what I was doing, and they don’t even read directly from streams here. Which, I guess if you put users on the hook for manual buffer management then sure, I guess that can work. But like, the second you try and compose this it’s going to Be Something.

yosh,
@yosh@toot.yosh.is avatar

@Paxxi Yeah I hear you. Re: streaming - I believe it might be possible to support. But as a result the people using the library are on the hook for correctly responding to state machine events.

And that like, to me is part of the sin here. Sure it's "possible" to write things in a sans-io style. But imo it's necessarily going to be a worse experience for users of the library.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • mdbf
  • Durango
  • thenastyranch
  • ngwrru68w68
  • InstantRegret
  • DreamBathrooms
  • modclub
  • magazineikmin
  • Youngstown
  • everett
  • ethstaker
  • slotface
  • rosin
  • anitta
  • kavyap
  • osvaldo12
  • GTA5RPClips
  • cisconetworking
  • provamag3
  • khanakhh
  • tacticalgear
  • cubers
  • Leos
  • normalnudes
  • megavids
  • tester
  • lostlight
  • All magazines