Ask HN: Used ChatGPT for nontrivial porting to another language?

2 points by AtlasBarfed ↗ HN
So I'm out of work and playing around with FreeCiv, which is a BAD IDEA for productivity, and I'm digging around the guts of it and thinking "this might be fun to do ... in my favorite language.

You know what would impress me beyond the "I can write sample code for you" tricks I've seen ChatGPT do, and what would REALLY show if it can do it's stuff.

What if I type:

"port freeciv server from C to Groovy"

Freeciv is an interesting test case for this IMO. It has client interfaces and boundaries, nontrivial data interactions and usages obscured by the usual C is-it-a-pointer or is-it-an-array, it can be interactively tested using the clients.

Anyone taken a swing at ChatGPT for such a thing?

This is a class of problem that could really be mutually beneficial between AI and programmer, not the pseudo-adversarial one it currently is. Porting "good code" between languages is a BIG PROBLEM that is holding up good languages.

If ChatGPT could enormously speed up standard library conversion authoring and sharing of good algorithms and designs between languages, it could be an enormous boon to the programming language practice.

Because that's a big pain in the ass that NOBODY wants to do in the large. Sure people might want to play with api designs they have good domain knowledge, but serialization formats for example, or basic api/library interfaces? Yuck.

And this is a good "bulk charge" money maker. Businesses will flock to this for porting old legacy code and the like. This can be a BIG moneymaker for ChatGPT.

3 comments

[ 3.2 ms ] story [ 10.4 ms ] thread
It's nowhere near being able to do that now, but if you can break the task up into bits it can probably help you. It would be fun to see what it does for porting a function from C to Groovy.
But in six months .... ????

And if you want to do consulting around this, probably want to start practicing sooner rather than later.

To do interesting things around this six months from now I'd say go to

https://huggingface.co/

and learn how to do things with the models they publish. Looking at the literature that goes by every day in arxiv.org the general theme is "we can do zero-shot learning by feeding it a prompt and it is 70% accurate, we can fine-tune one with a few thousand examples (maybe artifically generated) and it is 95% accurate". In six months you will be able to download a much better model than you can today and it will run on your hardware and you can finetune it and keep the changes.