News for hackers. Stuff that matters.
Re:Converting Codebases with LLMs by zcbenz on Saturday July 20, 2024 @08:37AM (#41016032)
A few months ago I ported ~15k lines of python code (10k are tests) to typescript, using GPT4. It cost me ~$70.

The python project is https://github.com/ml-explore/mlx and the converted project is https://github.com/frost-beta/node-mlx

I wrote a long prompt: https://github.com/frost-beta/node-mlx/blob/main/tests/promp...

The first result was almost always bad, but after manually modifying the assistant's answer, following generation usually went much better.

Re:Converting Codebases with LLMs by newzisforsukas on Saturday July 20, 2024 @08:46AM (#41016082)
> Use () => instead of function() for defining functions.

> Use const when possible, but use let if the same name is reused in the same scope.

looks like some of that could have been handled with a linter autofixing afterwards.

$70 seems like a lot for 15,000 lines?

Re:Converting Codebases with LLMs by mmastrac on Saturday July 20, 2024 @10:03AM (#41016577)
In the absence of an AST based tool, that's probably an absolute minimum of 20-40 hours of dev time (likely more) at $100-200 hourly, no?
Re:Converting Codebases with LLMs by imvetri on Saturday July 20, 2024 @10:13AM (#41016652)
There is no AST tool nor anyone had solved cross language refactor. Direct me if I'm wrong
Re:Converting Codebases with LLMs by iknowstuff on Saturday July 20, 2024 @02:28PM (#41018539)
They mean running it on typescript post conversion.
Re:Converting Codebases with LLMs by newzisforsukas on Saturday July 20, 2024 @10:15AM (#41016658)
I just meant for processing, not compared to skilled or mindless translation done by humans.
Re:Converting Codebases with LLMs by mmastrac on Saturday July 20, 2024 @10:32AM (#41016753)
$70 is not a lot given the value of the output. I understand where you're coming from, though, but it's important to compare against the value the human labour this is replacing.
Re:Converting Codebases with LLMs by imvetri on Saturday July 20, 2024 @01:06PM (#41017921)
Why 70 is not a lot? Value for money
Re:Converting Codebases with LLMs by kordlessagain on Saturday July 20, 2024 @04:44PM (#41019688)
It's less than half a cent a line!
Re:Converting Codebases with LLMs by dsp_person on Saturday July 20, 2024 @02:59PM (#41018795)
For the cost I'm curious what's the breakdown in terms of specific gpt4 model and context length?

What was the verification process like?

Also any thoughts on transpilers? There's Brython for javascript, and some others like py2many, mypyc. And the approach in oil shell: written in python, translated to C++ with custom tools