barrett โœจ's Avatar

barrett โœจ

@barretts.club

i work with computing nonsense ๐Ÿ“Œ Tulsa, OK ๐Ÿ‘‹ they/he ๐Ÿ”— https://barretts.club

296
Followers
484
Following
1,167
Posts
18.10.2024
Joined
Posts Following

Latest posts by barrett โœจ @barretts.club

Why Async? - Asynchronous Programming in Rust

so, I think your argument works great against green threads, as those had really no usage in the STL or elsewhere.

but Futures are an essential building block for many people! OS threads seem heavy and unergonomic where Futures shine. see: rust-lang.github.io/async-book/0...

13.03.2026 02:09 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

futures can be used for cleanup, waiting for heavy I/O or computation to complete, and even tiny millisecond-long tasks.

they practically stack infinitely, taking only a handful of bytes of memory per future, and use the stack by default. and they're flexible enough to box and use on the heap!

13.03.2026 02:09 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

the reason why `std::future` has a place and `green` never did is simple: Futures are easy to manage and compose, while green threads are not!

13.03.2026 02:09 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
std::task - Rust API documentation for the Rust `task` mod in crate `std`.

the way futures are usually handled looks more like green threads over `std::thread`, though `green` was removed from Rust after 0.12.0. you can see it before removal here: doc.rust-lang.org/0.12.0/std/t...

and here: doc.rust-lang.org/0.12.0/green...

13.03.2026 02:09 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

their API is heavily integrated, too! async-await ergonomics are clean and obvious, with a simple graph-like structure of futures resulting from the syntax and external events (e.g., "wait for this timer to elapse", "load this from disk pls", or "wait for all these futures to complete")

13.03.2026 02:09 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

Futures (and, often, conceptual "tasks") are less hefty. an executor will have a thread pool (or even just one thread) and handle scheduling in-process, meaning fewer required interactions w/ the kernel!

in many cases, futures are faster and more scalable.

13.03.2026 02:09 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

respectfully, they don't really solve the same problem. ๐Ÿฅน

threads can be extremely heavy in terms of representation and are harder to manage. the API is less integrated into the language -- by a lot!

13.03.2026 02:09 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 1

it's so fun to solve the little problems. but definitely frustrating for newer folks

I'd love a stl-bundled `tokio` or something for better diagnostics

12.03.2026 21:46 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

not sure if i understand... what would you prefer? :D

12.03.2026 21:44 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

I really hate this opinion. Rust's async implementation is the least bad of all popular systems languages, by faaaaaar

11.03.2026 06:32 ๐Ÿ‘ 39 ๐Ÿ” 3 ๐Ÿ’ฌ 10 ๐Ÿ“Œ 0

lesbianest software ever made

08.03.2026 15:17 ๐Ÿ‘ 73 ๐Ÿ” 12 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
A series of three info boxes from the linked page.

"Warning [with an orange triangle warning symbol]

Think twice before removing RESIZE from the set of decorations as it causes problems with resizing and minimizing the window. You usually want to keep RESIZE enabled.

Danger [with a red lightning bolt symbol]

If you just want to remove the title bar, set window_decorations = "RESIZE" as you will run into problems if you remove RESIZE from the set of decorations.

Tip [with a green flame symbol]

You probably always want RESIZE to be listed in your window_decorations."

A series of three info boxes from the linked page. "Warning [with an orange triangle warning symbol] Think twice before removing RESIZE from the set of decorations as it causes problems with resizing and minimizing the window. You usually want to keep RESIZE enabled. Danger [with a red lightning bolt symbol] If you just want to remove the title bar, set window_decorations = "RESIZE" as you will run into problems if you remove RESIZE from the set of decorations. Tip [with a green flame symbol] You probably always want RESIZE to be listed in your window_decorations."

I love this. Are you sure. Are you very sure. Have you thought about this carefully. Maybe think again. Look we're not going to stop you but is this *definitely* what you want. #wezterm
wezterm.org/config/lua/c...

08.03.2026 16:07 ๐Ÿ‘ 9 ๐Ÿ” 3 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

i guess all you can do is poll their events page and await a time where they do one in europe

07.03.2026 05:06 ๐Ÿ‘ 5 ๐Ÿ” 1 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

ok i'm starting to like this

07.03.2026 06:09 ๐Ÿ‘ 35 ๐Ÿ” 2 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 1
Virus.DOS.Michelangelo (25 years later)
Virus.DOS.Michelangelo (25 years later) YouTube video by danooct1

happy Michelangelo Virus Day for those who celebrate

youtu.be/kl_Hbj0BpRU?...

06.03.2026 17:59 ๐Ÿ‘ 37 ๐Ÿ” 9 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
Post image

Please note that Chrome pushed an update, and

YOUR DEV CONSOLE (history) MAY BE READ BY HUMAN REVIEWERS.

Sure, console should never be treated as a secure env, but I still fucking hate this.

06.03.2026 08:34 ๐Ÿ‘ 162 ๐Ÿ” 62 ๐Ÿ’ฌ 5 ๐Ÿ“Œ 25
A screenshot of the default page when you visit Stratos in a browser. Stratos is in a cool looking fancy ASCII art style reminiscent of crappy DOS role playing games from the 90s with fancy looking handwritten script.

Below is the text:

This is Stratos, a private permissioned data service for AT Protocol
Most API routes are under /xrpc/

Code: https://
Protocol: https://atproto.com

A screenshot of the default page when you visit Stratos in a browser. Stratos is in a cool looking fancy ASCII art style reminiscent of crappy DOS role playing games from the 90s with fancy looking handwritten script. Below is the text: This is Stratos, a private permissioned data service for AT Protocol Most API routes are under /xrpc/ Code: https:// Protocol: https://atproto.com

I couldn't figure out how to make a cool logo so I went for 90s RPG

05.03.2026 20:33 ๐Ÿ‘ 45 ๐Ÿ” 2 ๐Ÿ’ฌ 2 ๐Ÿ“Œ 1
Preview
Announcing Rust 1.94.0 | Rust Blog Empowering everyone to build reliable and efficient software.

Rust 1.94.0 has been released! ๐ŸŒˆ ๐Ÿฆ€โœจ

A few highlights are array_windows() and element_offset() on slices, Peekable::next_if_map(), LazyCell::get and friends, and the new `include` key in config.toml to include other toml files!

Check out the blog post for details: blog.rust-lang.org/2026/03/05/R...

05.03.2026 20:55 ๐Ÿ‘ 139 ๐Ÿ” 34 ๐Ÿ’ฌ 2 ๐Ÿ“Œ 3

Rust is so good man. Makes my small smooth webshit brain feel like I'm capable of systems programming (false)

04.03.2026 23:02 ๐Ÿ‘ 8 ๐Ÿ” 1 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

need them to make one out of plastic

i hate these hot-ahh chassis lol

04.03.2026 16:54 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

sounds like a fun way to say `dyn Trait` lol

but yeah, this will have the same result as Rust in this case; bring your own implementation

04.03.2026 03:49 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

LMAOOO I CLOCKED IT

04.03.2026 02:14 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

I'm not sure how Zig contributors are fixing this, though... :o

They'd probably have to build in a runtime and use greenthreading for something like io-uring..? Especially if it's built into their stl

03.03.2026 20:15 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 1

Sans I/O libraries are more flexible and can reduce the number of dependencies in a project, sometimes down to a runtime and other basic stuff: maybe `futures-lite`, `std`, or even just `core`!

So, experienced devs like Amos tend to write in the sans-IO style, resulting in more widespread usage.

03.03.2026 20:15 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

Many libraries choose to use Tokio, as it's the easiest and serves the vast majority of people.

However, other libraries are called "sans-IO", which means they don't expect any runtime by default and instead use generic data structures or adapters to read/move/write data asynchronously.

03.03.2026 20:15 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

Rust avoids choosing an async runtime for users (e.g., a runtime for embedded is likely less useful on desktop or server, and vice versa).

So, there are no included ways to interface with many forms of I/O asynchronously by default.

03.03.2026 20:15 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
Post image

** Speaker announcement ** At RustWeek 2026, Alona Enraght-Moon will talk about the complexities involved in writing your own tools that need information from deep inside the Rust compiler.

Info & tickets: buff.ly/9aHwJFE

See you in Utrecht May 18-23, 2026!

@alona.page
#rustweek2026 #rustlang

03.03.2026 13:17 ๐Ÿ‘ 9 ๐Ÿ” 3 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 1
Preview
GitHub - mrconter1/rustc-php: A Rust compiler with ownership checking, written in PHP A Rust compiler with ownership checking, written in PHP - mrconter1/rustc-php

Of all the f**king cursed projects to see on Reddit today, a rust compiler written in PHP has to be top, right? ::ping @tschundler.leds.social.ap.brid.gy @xconstants.bsky.social::

github.com/mrconter1/ru...

01.03.2026 23:55 ๐Ÿ‘ 35 ๐Ÿ” 11 ๐Ÿ’ฌ 4 ๐Ÿ“Œ 0

sounds like a cool paper and deadly new drug

01.03.2026 17:18 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

I'd like to think she works in the same Canon office with Godzilla

19.02.2026 17:59 ๐Ÿ‘ 133 ๐Ÿ” 46 ๐Ÿ’ฌ 5 ๐Ÿ“Œ 0