← Back to context

Comment by bogtog

4 hours ago

> But now that most code is written by LLMs, it's as "hard" for the LLM to write Python as it is to write Rust/Go

The LLM still benefits from the abstraction provided by Python (fewer tokens and less cognitive load). I could see a pipeline working where one model writes in Python or so, then another model is tasked to compile it into a more performant language

It's very good (in our experience, YMMV of course) when/llm write prototype with python and then port automatically 1-1 to Rust for perf. We write prototypes in JS and Python and then it gets auto ported to Rust and we have been doing this for about 1 year for all our projects where it makes sense; in the past months it has been incredibly good with claude code; it is absolutely automatic; we run it in a loop until all (many handwritten in the original language) tests succeed.

  • IDK what's going on in your shop but that sounds like a terrible idea!

    - Libraries don't necessarily map one-to-one from Python to Rust/etc.

    - Paradigms don't map neatly; Python is OO, Rust leans more towards FP.

    - Even if the code be re-written in Rust, it's probably not the most Rustic (?) approach or the most performant.

    • It doesn't map anything 1 to 1, it uses our guidelines and architecture for porting it which works well. I did say YMMV anyway; it works well for us.

      1 reply →

I think that's not as beneficial as having proper type errors and feeding that into itself as it writes

NP (as in P = NP) is also much lower for Python than Rust on the human side.

  • What does that mean? Can you elaborate?

    • Sorry, yes. LLMs write code that's then checked by human reviewers. Maybe it will be checked less in the future. But I'm not seeing fully-autonomous AI on the horizon.

      At that point, the legibility and prevalence of humans who can read the code becomes almost more important than which language the machine "prefers."

      3 replies →