5 ms·
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-exp
by zcbenz 2y ago
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 https://github.com/ml-explore/mlx
and the converted project is https://github.com/frost-beta/node-mlx https://github.com/frost-beta/node-mlx
I wrote a long prompt:
https://github.com/frost-beta/node-mlx/blob/main/tests/prompt_test_py_to_js.txt 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.
- newzisforsukas 2y ago> 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?
- mmastrac 2y agoIn 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?
- _f9cu 2y agoThere is no AST tool nor anyone had solved cross language refactor. Direct me if I'm wrong
- iknowstuff 2y agoThey mean running it on typescript post conversion.
- newzisforsukas 2y agoI just meant for processing, not compared to skilled or mindless translation done by humans.
- kordlessagain 2y agoIt's less than half a cent a line!
- dsp_person 2y agoFor 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