Top
Best
New

Posted by adius 21 hours ago

Ladybird adopts Rust, with help from AI(ladybird.org)
1142 points | 624 commentspage 7
PowerElectronix 16 hours ago|
What are Rust programmers to do now that LLMs can port code to Rust??
Perz1val 10 hours ago||
It reads like a joke without a punchline
maleldil 13 hours ago||
Rejoice?
WesolyKubeczek 15 hours ago||
I wouldn't mind if one result of this was a writeup on what patterns/antipatterns are there when converting code and concepts that used to be very aligned with C++-style OOP, deep inheritance and all that jazz, to what feels natural in Rust, and how you can rephrase those concepts without loss in the substance of what you need to do.

I guess it's a long way off, since the LLM translation would need to be refactored into natural Rust first. But the value of it would be in that it's a real world project, and not a hypothetical "well, you could probably just...".

aero-glide2 20 hours ago||
Sigh agents keep killing all the passion I have for programming. It can do things way faster than me, and better than me in some cases. Soon it will do everything better and faster than me.
LeFantome 13 hours ago||
> Soon it will do everything better and faster than me

There is no evidence of that coming from this post. The work was highly directly by an extremely skilled engineer. As he points out, it was small chunks. What chunks and in what order were his decision.

Is AI re-writing those chunks much faster than he could. Yes. Very much so. Is it doing it better? Probably not. So, it is mostly just faster when you are very specific about what it should do. In other words, it is not a competitor. It is a tool.

And the entire thing was constrained by a massive test suite. AI did not write that. It does not even understand why those tests are the way they are.

This is a long way from "AI, write me a JavaScript engine".

rzerowan 12 hours ago||
Id put it as a example of a carpenter preparing their material with a lathe and circular saw vs one working with a handsaw and chisel.

Both will get a skilled craftsman to the point where thie output is a quality piece of work. Using the autotoools to prepare the inputs allows velocity and consistency.

Main issue is the hype and skiddies who would say - feed this tree into a machine and get a cabinet.Producing non-detrministic outputs with the operator being unable to adjust requirements on the fly or even stray from patterns/designs that havent been trained yet.

The tools have limitiations and the operators as well , and the hype does adisservice to what would be establishing reasonable patterns of usage and best practices.

supriyo-biswas 20 hours ago|||
Is a migration from language X to Y or refactoring from pattern A to B really the kind of task that makes you look forward to your day when you wake up?

Personally my sweet spot for LLM usage is for such tasks, and they can do a much better job unpacking the prompt and getting it done quickly.

In fact, there's a few codebases at my workplace that are quite shit, and I'm looking forward to make my proposal to refactor these. Prior to LLMs, I'm sure I'd have been laughed off, but now it's much more practical to achieve this.

misnome 20 hours ago||
Right. I had a 100% manual hobby project that did a load of parametric CAD in Python. The problem with sharing this was either actively running a server, trying to port the stack to emscripten including OCCT, or rewriting in JS, something I am only vaguely experienced in.

In ~5 hours of prompting, coding, testing, tweaking, the STL outputs are 1:1 (having the original is essential for this) and it runs entirely locally once the browser has loaded.

I don’t pretend that I’m a frontend developer now but it’s the sort of thing that would have taken me at least days, probably longer if I took the time to learn how each piece worked/fitted together.

throwaway2027 20 hours ago|||
It's the opposite for me, most of the time it's first rough pass it generates is awful and if you don't have good taste and a solid background of years of experience programming you won't notice it and I keep having to tell it to steer into better design choices.
nananana9 20 hours ago|||
I'm not sure 25,000 lines translated in 2 weeks is "fast", for a naive translation between languages as similar as C++ and Rust (and Ladybird does modern RAII smart-pointer-y C++ which is VERY similar to Rust). You should easily be able to do 2000+ lines/day chunks.
nicoburns 20 hours ago|||
Yeah, it also a lot that the person doing the translation is the lead developer of the project who is very familiar with the original version.

I imagine LLMs do help quite a bit for these language translation tasks though. Language translation (both human and programming) is one of the things they seem to be best at.

camel-cdr 19 hours ago||||
Agreed, however, I'm quite sure 25,000 lines translated in "multiple months" is very "slow", for a naive translation between languages as similar as C++ and Rust.
OtomotO 20 hours ago|||
2000+ lines/day chunks are 10 days for 20+k lines...
nananana9 19 hours ago||
I'm aware. What I meant is this is a reasonable output for a 1:1 translation by hand, without LLM use.
tonyedgecombe 18 hours ago||
2000 lines a day feels like a lot to me if you want to be thorough.
michaelcampbell 20 hours ago|||
"I will never be a world class athlete, so I play for the love of the sport."

Helps me.

airstrike 20 hours ago|||
Not sure why you'd get that from this post, which says it required careful small prompts over the course of weeks.

In the hands of experienced devs, AI increases coding speed with minimal impact to quality. That's your differentiator.

pjmlp 20 hours ago|||
Look into platforms like Workato, Boomi, or similar iPaaS products, unfortunely it feels like those of us that like coding have to be happy turning into architect roles, with AI as brick layers.
bigstrat2003 15 hours ago|||
Despite the many claims to the contrary, agents can't do anything better than a human yet. Faster, certainly, but the quality is always poor compared to what a human would produce. You aren't obsolete yet, brother.
storus 11 hours ago||
Dunno, that probably doesn't hold for webapps with backend as they are typically complete garbage and LLMs (even local ones) would give you about the same result but in 1 hour.
apples_oranges 20 hours ago||
It automates both the fun and the boring parts equally well. Now the job is like opening a box of legos and they fall out and then auto-assemble themselves into whatever we want..
close04 20 hours ago||
Rather like opening a box of legos and reading them the instruction sheet while they auto assemble based on what they understood. Then you re-read and clarify where the assembly went wrong. Many times, if needed.
gethly 20 hours ago||
i rememebr seeing interviews saying rust is not suited for this project because of recursion and dom tree. how they tested multiple languages and settled on swift. then they abandon swift and now they shift towards rust.

this entire project starts to look like "how am i feeling today?" rather than a serious project.

tcfhgj 20 hours ago||
So Swift didn't turned out like they imagined and Rust is just the next best alternative to that failed vision using Swift.

So far this is the first and only shift

adastra22 19 hours ago||
They were doing their own custom language before Swift.
tcfhgj 17 hours ago||
didn't know

> The browser and libraries are all written in C++. (While our own memory-safe Jakt language is in heavy development, it’s not yet ready for use in Ladybird.)

https://awesomekling.github.io/Ladybird-a-new-cross-platform...

only thing I could find - has it been actually used in Ladybird after all?

LeFantome 13 hours ago||
No, they never completed or adopted their own language. It was back in the SerenityOS days, before the browser forked into its own project.

https://github.com/SerenityOS/jakt

norman784 18 hours ago|||
From the link it seems that Ladybird architecture is very modular, in this case LibJS is one of the subsystems that has less external dependencies, said that they don't need to migrate everything, only the parts that makes sense.
MrFurious 19 hours ago|||
Yes, i understand that in a personal project, but they have investors behind them.
cromka 19 hours ago||
They adopted Rust for LibJS, not the browser and its engine.
blub 16 hours ago||
I feel similar about the potential of this technique and have heard this from other C++ developers too.

Rust syntax is a PITA and investing a lot of effort in the language doesn’t seem worth the trouble for an experienced C++ developer, but with AI learning, porting and maintenance all become more accessible. It’s possible to integrate Rust in an existing codebase or write subparts of larger C++ projects in Rust where it makes sense.

I was recently involved in an AI porting effort, but using different languages and the results were fine. Validating and reviewing the code took longer than writing it.

ocd 20 hours ago||
I am unsure if I can rationally justify saying this, but I am left with disappointment and unease. Comparable to when a series I care about changes showrunner and jumps the shark.
OtomotO 20 hours ago|
Maybe you're part of an anti-cult-cult?

Would be as bad as being in a cult.

nz 19 hours ago||
Hate to tell you this, but it's cults all the way down. Plato understood this, and his disdain for caves and wall-shadows, is really a disdain for cults. The thing is, over the last 2300 years, we have gotten really good at making our caves super cozy -- much cozier than the "real world" could ever be. Our wall-shadows have become theme parks, broadway theaters, VR headsets, youtube videos, books, entire cities even. In Plato's day, it made sense to question the cave, to be suspicious of it. But today, the cave is not just at parity with reality, it is superior to it (similar to how a video game is a precisely engineered experience, one that never has too little signal and never has too much noise, the perfect balance to keep you interested and engaged).

I'm no mind reader, and certainly no anthropologist, but I suspect that what separates humans from other (non extinct) animals, is that we compulsively seek caves that we can decorate with moving shadows and static symbols. We even found a series of prime numbers (sequences of dots, ". ... ..... .......") in a cave from the _ice age_. Mathematics before writing. We seek to project what we see with our mind's eye into the world itself, thereby making it communicable, shareable. Ever tell someone you had a dream, and they believed you? You just planted the seed for a cult, a shared cave. Even though you cannot photograph the dream, or offer any evidence that you can dream at all.

The industrial and scientific revolutions have distanced our consciousness from this idea, even as they enabled ever more perfect caves to manifest. Our vocabulary has become corrupted and unclear. We started using words like "reality", and "literally", and "truth", when we mean the exact opposite.

The conspiracy theorists and cultists, are just people who wandered into a new cave, with a different kind of fire, and differently curved walls, and they want to tell people from their old cave that they have found a way out of the cave into reality -- they do not yet realize (or do not want to accept), that they live in a network of caves, a network of different things in the same category.

During the early 2020s, we did a lot of talking about the disappearance of "consensus reality". This is scientific terminology mapped over the idea of caves and cults. You can tell, because the phrase is an oxymoron. It is not reality, if it requires consensus. It is fantasy, it is fiction, it is a dream. The cave has indeed become so widespread that we even _call_ it reality.

If you speak language, and read words, you are participating in a cult (we even call caves that had a kind of altar in the center a cult -- in Eurasia, there was a cave-cult called _the cult of the bear_, which had a bear skull placed in its center during the last ice age, and I would not be surprised if people spoke to it, with the help of hallucinogens). The only question is whether the cult is nourishing you or cannibalizing you.

To the person you are responding to (user ocd): your cave (ladybird, your hypothetical tv-series), no longer nourishes you like it once did. Maybe find a new cave, build a fire in it. Unlike a television series, you can fork a code base. You make it into the perfect cave, just for you. And if another person likes this cave, chooses to sit by the fire with you, well, now you have a cult.

einpoklum 11 hours ago||
Chatbot-translated code which is C++ foisted onto Rust? I will respectfully roll my eyes.

Ah, but I see they actually haven't done that to most of their code, so maybe it's just a bit of pandering to the hype and fashion.

unit149 7 hours ago||
[dead]
xxxx_xxxx 9 hours ago||
[dead]
sohpha6B 14 hours ago|
[dead]
More comments...