Live data from Hacker News

Ladybird adopts Rust, with help from AI

ladybird.org

591–600 of 731 posts

Re: Ladybird adopts Rust, with help from AI

#591
post #406

Earlier quoted context omitted.

Can you release it as open source code?

Sure; I’ll throw it online in a few hours when I’m at my computer.

Code is here: https://github.com/josephg/claude-mail

Live version: https://seph.au/claude-webmail/

Re: Ladybird adopts Rust, with help from AI

#592
post #44

Earlier quoted context omitted.

Is it any surprise that the cocaine cartels really want you to buy more cocaine, so they don't focus on its usefulness in pain relief and they refine it and cut it with the cheapest substances that will work rather than medical-grade reagents? Same thing.

LLMs are drugs because they’re addictive and sap your abilities, is it? (or generally: “Is the cocaine cartel comparison fair or unfair?”)

LLMs are fair to compare to cocaine because while there certainly could be ethical producers who follow reasonable laws and work to develop good uses, the market is completely dominated by organizations that don't.

And in my experience potheads offer you a toke and if you politely refuse, no problem at all. Coke addicts don't want to take no for an answer and insist that everybody should do it, they get so much more done, decisions are faster and better and what the hell is wrong with you if you don't want some?

So, the users are similar too.

Re: Ladybird adopts Rust, with help from AI

#593

I'm a long-time Rust fan and have no idea how to respond. I think I need a lot more info about this migration, especially since Ladybird devs have been very vocal about being "anti-rust" (I guess more anti-hype, where Rust was the hype). I don't know if it's a good fit. Not because they're writing a browser engine in Rust (good), but because Ladybird praises CPP/Swift currently and have no idea what the contributor's…

> I guess more anti-hype, where Rust was the hype Yeah that is the thing I struggle with. I am really happy for people falling in love with Rust. It is a amazing language when used for the right use case. The problem is that had my Rust adventures a few years ago and I am over the hype cycle and able to see both the advantages and disadvantages. Plus being generally older and hopefully wiser I don't tie my identity t…

I find the attitude of the Ladybird devs refreshing though, and it kinda aligns with my opinions about Rust.

I never fell in love with Rust or got particularly excited about adopting it. But, I just don't see a serious alternative (maybe Swift is fine for some cases but not in my field).

I believe Google's Rust journey was even more closely aligned with Ladybird: "we want memory safety, but with low impedance mismatch from C++". After like 5 years of trying to figure something like that out they seemed to go "OK actually fuck that we just have to use Rust and deal with the challenges it brings for a C++ shop".

Re: Ladybird adopts Rust, with help from AI

#594
How is this approach better than letting claude or some AI catch memory bugs better than humans in the c++ code itself?

Given it's not launched and it's donor driven, I guess conserving developer time is a key priority? Dual track sucks lots of time?

Re: Ladybird adopts Rust, with help from AI

#595
post #300

The byte-for-byte identical output requirement is the smartest part of this whole thing. You basically get to run the old and new pipelines side by side and diff them, which means any bug in the translation is immediately caught. Way too many rewrites fail because people try to "improve" things during the port and end up chasing phantom bugs that might be in the old code, the new code, or just behavioral differences.…

> Way too many rewrites fail because people try to "improve" things during the port I'd say that porting is a great time to "improve" many things, but like you suggest, not a great time to add new features. You can do a lot of improvements while maintaining output parity. You're in the weeds, reading the code, thinking about the routines, and you have all the hindsight of having done it already. Features are great to…

LLMs are great at producing documentation - ask one "hey can you add a TODO comment about the thing on line 847 that is probably not the best way to do this?" while you're working on the port, and it will craft a reasonably-legible comment about that thing without further thought from you, that will make things easier for the person (possibly future-you) looking at the codebase for improvements to make. Meanwhile, you keep on working on the port that has byte-for-byte identical output.

Re: Ladybird adopts Rust, with help from AI

#596
post #545

Earlier quoted context omitted.

> Interface defines an open class of types But can also define a closed set of types, perfectly satisfying "sum types". > This enables different syntax, like the match expression to be used, in which you exhaustively list all the variants. Go does not provide this out of the box, but that is not prerequisite for sum types. The mathematical theory says nothing about "the compiler must produce an error if the user does…

By that definition a void* pointer in C is a sum type. By that definition assembly has sum types. This argument feels like the “we have sum types at home” meme. Ergonomics matter. I write a lot of rust. Rust has traits which are similar to Go’s interfaces. But the features aren’t the same, and I use enum all the time. (I also use trait all the time, but I use trait and enum for different things).

> By that definition a void* pointer in C is a sum type.

No. That doesn't make any sense. void* is essentially equivalent to any in Go, which isn't sum types either.

You can construct sum types in C by combining structs, enums, and unions, but it is not an out of the box feature like in Go. Sum types are a first-class citizen in Go.

> Ergonomics matter.

Math doesn't care about ergonomics. You might care about ergonomics, but logically when talking about those ergonomics you'd call those ergonomics by name, not by some unrelated thing from type theory.

Re: Ladybird adopts Rust, with help from AI

#597

Earlier quoted context omitted.

First, it is important for these discussions that people include details like I did. We're all better off to not generalize. RE: Claude Code, no I haven't used it, but I did do the Anthropic interview problem, beating all of Anthropic's reported Claude scores even with custom harnesses etc. It's not a dunk that agents can't produce "as fast as can be" code; their code is usually still reasonably fast; it's just often…

There is a lot to be done with good prompting. Early on, these code agents wouldn't do basic good hygiene things, like check if the code compiled, avoid hallucinating weird modules, writing unit tests. And people would say they sucked .... But if you just asked them to do those things: "After you write a file lint it and fix issues. After you finish this feature, write unit tests and fix all issues, etc ..." Well, th…

Yep. Claude code is best thought of as an overachieving junior / mid. It can run off and do all sorts of work on its own, but it doesn't have great instincts and it can't read your mind about what you want.

Use it as if you're the tech lead managing a fresh hire. Tell it clearly what you want it to focus on and you get a much better result.

Re: Ladybird adopts Rust, with help from AI

#598

This may sound stupid, but I wonder if using GPUI for a web browser could have some performance benefits...

I don't get the impression they care that much about performance. Besides, it would limit the number of platforms it could run on if it requires a recent GPU.

Re: Ladybird adopts Rust, with help from AI

#599

Earlier quoted context omitted.

When you do fully value-oriented programming in Rust (i.e. no interior mutability involved) that's essentially functional programming. There's mutable, ephemeral data involved, but it's always confined to a single well-defined context and never escapes from it. You can even have most of your code base be sans-IO, which is the exact same pattern you'd use in Haskell.

I actually like rust more than Haskell, but `You can even have most of your code base be sans-IO, which is the exact same pattern you'd use in Haskell.` glosses over the fact that in Haskell it's enforced at compile time.

Another argument as to why rust isn't the forever-language. My forever language should include effects!

Even rust has need of this. For example, I want a nopanic effect I can put on a function which makes it a compile error for anything that function calls to panic.

Re: Ladybird adopts Rust, with help from AI

#600
post #258

If it is this easy, surely the trend is Rust output being an intermediate pass of the LLM super compiler. A security subset if you will (like other kinds of optimization), it will move from Rust specs to some deeper level of analysis and output the final executable. Some brave souls will read the intermediate Rust output (just like people used to read the assembler output from compilers) but the LLM super compiler wi…

Do you seriously think LLMs will not just spam unsafe blocks in it like they do with any task ever?

I'd generally be quite surprised to see LLMs spam unsafe blocks, both because that's behavior that I haven't observed while using them and because that contradicts my mental model of them where they imitate the styles of code that they were trained on (which in rust generally does not include spamming unsafe).
Post reply on HN