← Back to context

Comment by cyode

1 day ago

I hope, with the velocity unlocked by these tools, that more pure ports will become the norm. Before, migrations could be so costly that “improving” things “while I’m here” helped sell doing the migration at all, especially in business settings. Only to lead to more toil chasing those phantom bugs.

One of the biggest point of rewriting is you know better by then so you create something better.

This is a HUUUGE reason code written in rust tended to be so much better than the original (which was probably written in c++).

Human expertise is the single most important factor and is more important than language.

Copy pasting from one language to another is way worse than complete rewrite with actual idiomatic and useful code.

Best option after proper rewrite is binding. And copy-paste with LLM comes way below these options imo.

If you look at real world, basically all value is created by boring and hated languages. Because people spent so much effort on making those languages useful, and other people spent so much effort learning and using those languages.

Don’t think anyone would prefer to work in a rust codebase that an LLM copy-pasted from c++, compared to working on a c++ codebase written by actual people that they can interact with.

  • > Copy pasting from one language to another is way worse than complete rewrite with actual idiomatic and useful code.

    But translating with automated tools is a much faster experiment.

    Sometimes (not always), rewriting from scratch ends up in a big loss of time and resources and never replaces the old version.

    • I've seen more than a few rewrite attempts fail throughout the years. However, I've never seen a direct language to language translation fail. I've done several of these personally: from perl to ruby, java to kotlin, etc.

      Step 1 of any rewrite of a non-trivial codebase should should be parity. You can always refactor to make things more idiomatic in a later phase.

  • I rewrote two times my personal tool, one to rust, and out of rust with LLM, I mainly "vibe code" for reasons but the tool is more complete and less buggy than most B2B and enterprise business or IT software that I have seen in 20years at different fortune 100.

    I feel the effort and frustration to have parity with LLM is more than doing a full rewrite without.

  • It depends on your goals. If your only initial goal is to ensure the safety of your code, and that is rather important for a browser!

  • These are two different kinds of rewrites, for two different kinds of codebases, in two different situations. The important thing is to know which kind of rewrite you're doing, and have the whole team onboard.

    The sort of rewrite you're talking about can work well at an early stage of a project, in the spirit of Fred Brooks's "plan to throw one away". But for a mature browser like Ladybird that's trying to not break the user experience, it's much better to have a pure translation step, and then try to improve or refactor it later.