top | item 46773289

(no title)

bogtog | 1 month 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

discuss

order

anonzzzies|1 month ago

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.

behnamoh|1 month ago

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.

abrookewood|1 month ago

Why not get it to write it in Rust in the first place?

bko|1 month ago

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

LudwigNagasena|1 month ago

Expressive linting seems more useful for that than lax typing without null safety.

JumpCrisscross|1 month ago

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

behnamoh|1 month ago

What does that mean? Can you elaborate?