top | item 41016032

(no title)

zcbenz | 1 year 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 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.

discuss

order

newzisforsukas|1 year 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|1 year ago

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?

dsp_person|1 year ago

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