Live data from Hacker News

Ladybird adopts Rust, with help from AI

ladybird.org

351–360 of 731 posts

Re: Ladybird adopts Rust, with help from AI

#351

Earlier quoted context omitted.

> Go is a better Rust. Rust is an ugly version of C++ with longer compile times and a band of zealous missionaries. Eh. There's a lot I like about Go. I adore its compilation speed and the focus on language simplicity. But its got plenty of drawbacks too. Default nullability is a huge mistake. And result types (zig, swift, rust) are way better than go's error handling. Sum types in general are missing from Go, and on…

> Compiling stalwart takes about 20 minutes 20 minutes! What hardware is this on? I've worked on Rust projects with similar numbers of dependencies where the compile time (for a clean release build) was 2-4 minutes (on a MacBook M1 Pro)

UPDATE: tried compiling stalwart on my machine, and it took 14 minutes, with a really weird timing profile:

- 99% of the ~700 crates were done compiling in about a minute or 2 - RocksDB (a C++ dependency) was 2 minutes by itself - And then it took 10 minutes (ten!) just for the final binary at the end.

That's not normal for Rust code at all. Even large ones like Servo or Rustc or Zed.

UPDATE2: turns out they have LTO enabled by default. Disabling that brings the compile time down to 7 minutes. But that's still really unexpectedly slow.

Re: Ladybird adopts Rust, with help from AI

#352

Earlier quoted context omitted.

> classic HackerNews title shortening algorithm Woah, this is a wild claim. @dang: Is this a thing? I don't believe it. I, myself, have submitted many articles and never once did I see some auto-magical "title shortening algorithm" at work!

I've seen it happen a couple times, iirc, it removes things after commas, and removes certain words as well

Adds [video] to YouTube links, too.

Re: Ladybird adopts Rust, with help from AI

#353
post #15

> I used Claude Code and Codex for the translation. This was human-directed, not autonomous code generation. I decided what to port, in what order, and what the Rust code should look like. It was hundreds of small prompts, steering the agents where things needed to go. After the initial translation, I ran multiple passes of adversarial review, asking different models to analyze the code for mistakes and bad patterns.…

I haven’t done a ton of porting. And when I did, it was more like a reimplementation. > We’ve verified that every AST produced by the Rust parser is identical to the C++ one, and all bytecode generated by the Rust compiler is identical to the C++ compiler’s output. Is this a conventional goal? It seems like quite an achievement.

My company helps companies do migrations using LLM agents and rigid validations, and it is not a surprising goal. Of course most projects are not as clean as a compiler is in terms of their inputs and outputs, but our pitch to customers is that we aim to do bug-for-bug compatible migrations.

Porting a project from PHP7 to PHP8, you'd want the exact same SQL statements to be sent to the server for your test suite, or at least be able to explain the differences. Porting AngularJS to Vue, you'd want the same backend requests, etc..

Re: Ladybird adopts Rust, with help from AI

#354

Earlier quoted context omitted.

Agree, and it's also such a shame that none of the AI companies actually focus on that way of using AI. All of them are moving into the direction of "less human involved and agents do more", while what I really want is better tooling for me to work closer with AI and be better at reviewing/steering it, and be more involved. I don't want "Fire one prompt and get somewhat working code", I want a UX tailored for long se…

Of course there are tools focusing on this. It takes a little getting used to how prevalent it is. My editor now can anticipate the next three lines of code I intend to write complete with what values I want to feed to the function I was about to invoke. It all shows up in an autocomplete annotation for me. I just type the first two or three characters and press tab to get everything exactly how I was about to type i…

Still magical a few years in?

>Imagine if I had written a comment to explain my intent for the function before I started writing the function body.

This in particular is not dissimilar from opening a chat with a model and giving it a prompt as usual but then adding at the end:

Begin your response below:

  { func

Re: Ladybird adopts Rust, with help from AI

#355

Earlier quoted context omitted.

> Rust is the final language. I honestly can't tell if this is a humorous attack or not. Poe's law is validated once again.

It's honest. If we can serialize our ideas to any language for durability, Rust is the way to go. It's not the best tool for the job for a lot of things, but if the LLMs make writing it as fast as anything else - whelp, I can't see any reason not to do it in Rust. If you get any language outputs "for free", Rust is the way to go. I've been using Claude to go ridiculously fast in Rust recently. In the pre-LLM years I…

> It's honest.

It's not, nor is it well informed. People are currently developing languages specifically for use by LLMs.

> It's not the best tool for the job for a lot of things

Then how could it possibly be the final language?

> if the LLMs make writing it as fast as anything else - whelp, I can't see any reason not to do it in Rust

This has nothing to do with the claim that it's the final language.

Re: Ladybird adopts Rust, with help from AI

#356
post #330

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…

it's very odd that someone with no experience would take a big project like this and just jump to another language because he trusts the AI generated code of current models if it works it works i guess, but it seems mad to me on the surface

Why do you think the creator behind SerenityOS has no experience? I mean it’s not the most popular OS out there but he seems like a capable individual.

Re: Ladybird adopts Rust, with help from AI

#357

Earlier quoted context omitted.

Wasting electricity to "generate tens of thousands of lines of useless code" at will? Why is that in any way a desirable future?

Optimists will imagine it to one day be as taxing and thus as wasteful as firing up MS Paint. No that’s a stretch, but firing up a AAA game.

At least you (hopefully) get hours of entertainment from firing up an AAA game. Whereas generating vast amounts of code that you're never going to use has… some novelty value, I suppose. Luckily the novelty is going to wear off soon, I can't really see many people getting their daily happiness boost from making code machine say brrrrt straight to /dev/null. Even generating smut is a vastly more understandable (and vastly more commonplace, even now) use case for running genAI every day for hours.

Re: Ladybird adopts Rust, with help from AI

#358
post #15

> I used Claude Code and Codex for the translation. This was human-directed, not autonomous code generation. I decided what to port, in what order, and what the Rust code should look like. It was hundreds of small prompts, steering the agents where things needed to go. After the initial translation, I ran multiple passes of adversarial review, asking different models to analyze the code for mistakes and bad patterns.…

We keep seeing this pattern over and over as well. Despite LLM companies' almost tangible desperation to show that they can replace software engineers, the real value comes from domain experts using the tools to enhance what they're already good at.

Re: Ladybird adopts Rust, with help from AI

#359
post #15

> I used Claude Code and Codex for the translation. This was human-directed, not autonomous code generation. I decided what to port, in what order, and what the Rust code should look like. It was hundreds of small prompts, steering the agents where things needed to go. After the initial translation, I ran multiple passes of adversarial review, asking different models to analyze the code for mistakes and bad patterns.…

I haven’t done a ton of porting. And when I did, it was more like a reimplementation. > We’ve verified that every AST produced by the Rust parser is identical to the C++ one, and all bytecode generated by the Rust compiler is identical to the C++ compiler’s output. Is this a conventional goal? It seems like quite an achievement.

It’s a very good way of getting LLMs to work autonomously for a long time; give it a spec and a complete test suite, shut the door; and ask it to call you when all the tests pass.

Re: Ladybird adopts Rust, with help from AI

#360

Earlier quoted context omitted.

Agree, and it's also such a shame that none of the AI companies actually focus on that way of using AI. All of them are moving into the direction of "less human involved and agents do more", while what I really want is better tooling for me to work closer with AI and be better at reviewing/steering it, and be more involved. I don't want "Fire one prompt and get somewhat working code", I want a UX tailored for long se…

Of course there are tools focusing on this. It takes a little getting used to how prevalent it is. My editor now can anticipate the next three lines of code I intend to write complete with what values I want to feed to the function I was about to invoke. It all shows up in an autocomplete annotation for me. I just type the first two or three characters and press tab to get everything exactly how I was about to type i…

Which editor?

> Imagine if I had written a comment to explain my intent for the function before I started writing the function body.

The loon programming language (a Lisp) has "semantic functions", where the body is just the doc comment.

Post reply on HN