lepoulsdumonde.com is one of the many independent Mastodon servers you can use to participate in the fediverse.
Small french Mastodon instance for friends, family and useful bots

Administered by:

Server stats:

52
active users

#rust

41 posts33 participants0 posts today

Memory safety for web fonts: Skrifa is written in Rust, and created as a replacement for FreeType to make font processing in Chrome secure for all users. Skifra takes advantage of Rust's memory safety, and lets us iterate faster on font technology improvements in Chrome. Moving from FreeType to Skrifa allows Google to be both agile and fearless when making changes to our font code. developer.chrome.com/blog/memo Does anyone know how Firefox handles web fonts security?

Chrome for DevelopersMemory safety for web fonts  |  Blog  |  Chrome for DevelopersLearn how and why the Chrome team has replaced FreeType with Skrifa.

I kind of with #Rust #RustLang canonical formatting would put a space after the boolean not operator (!). In other words:

if ! filename.exists() {...}

instead of

if !filename.exists() {...}

This would make the negation a little easier to spot.

I don't wish this hard enough to even check if it's been discussed, never mind make a formal proposal. I'm just waiting for my test run to finish.

I'm going to make make Rust my first AI-only language. I learned some #rust but have never built anything significant with it BY HAND. I intend to keep it that way, and apply CHOP (CHat Oriented Programming as coined by Steve Yegge) only with anything I produce in Rust.

We had a discussion today about the future of programming languages with LLMs becoming good.

Do we need "AI Native" languages and what would they look like? My intuition would be that Rust is actually is a good fit, for a few reasons:

1. Safety
2. Performance
3. Easy to read, but hard to write. And if the LLM does the writing, that's actually not a problem.
4. Very strongly typed, which I think benefits LLMs a lot because it gives itself a very quick feedback loop — if it compiles, it's probably correct.

I've spent the better part of the day with Claud Code writing a program that otherwise I would probably have hacked in TypeScript or Python. Instead, I had Claude Code generate Rust code and it went really well. The result feels very robust, and it is fast.

Although I don't know Rust intimately, I do assume general programming principles apply like in any other language. I can read the code the LLM writes and to challenge it with general engineering practices. On many occasions have I asked it to write tests, refactor the code, take a completely different implementation approach. I may not know the subtleties of Rust as a language, but I'm not sure that it matters.

And picking a language I can't easily write myself has proven to be a very effective strategy to fight the urge to step in and do it myself.

Continued thread

for now, it pops up a scrolling table, based on data loaded by a multi-threaded indexing loop (doing concurrency in #rust is pretty enjoyable! no #async needed, either). lets you edit it (but crashes on backspace, lol). doesn't save it yet. pre-alpha stuff.

Continued thread

I was convinced at first that the output couldn't be right. I was sure that *somehow* I'd written code that depended... somehow... mysteriously... on the debug stuff somehow???

But it writes out 500 checkpoints as it does it's job. So I grabbed two points, plugged into my Python code... waited.. waited... waited... and they checked out (same two states take seconds for the #rust code to generate).

So... Yea... "--release" makes a *huge* difference.

Wow.. So I was trying to #optimize some Rust code that would take six hours to run.

My goal was to get that down to 3.5 hours (something I'd achieved previously with lost code). Some tweaking got it down to 5 hours estimated runtime.

Then I thought to do:

"cargo build --release" instead of just "cargo build" for the first time.

And we're down to 3 minutes.... not 3.5 hours... 3 minutes.

Ok.. Good to know. Debug adds just a tiny bit of overhead on some code ;-).