Live data from Hacker News

AI converts between hundreds of programming languages

codelanguageconverter.com

41–50 of 60 posts

Re: AI converts between hundreds of programming languages

#41
post #38

First underwhelming AI post on the frontpage. Thank god our jobs are safe atleast!

Writing code is rarely the problem anyway. Understanding the problem and devising a suitable solution given the full context is where the magic is. And since most humans have a hard time even accurately describing a problem and full context, there's no threat that AI will replace developers. If we can build up an immense library of clearly defined problems and solutions, with variants which fit with all conceivable u…

> If we can build up an immense library of clearly defined problems and solutions, with variants which fit with all conceivable unique contexts, then maybe it will become possible for AI to provide useful assistance.

Agreed. What you're describing (an immense library of problems and solutions) is essentially what's in the head of a very experienced developer. A system that helped surface those in a simple way for "new" problems so that people aren't constantly reinventing the wheel and making the same mistakes would be great. I've seen ideas about similar "tacit knowledge" systems in other domains (though I'm not sure there is a good one yet). For software, such a system would be way more helpful, and a much better goal, than this kind of idiot-savant gpt stuff

Re: AI converts between hundreds of programming languages

#42
post #38

First underwhelming AI post on the frontpage. Thank god our jobs are safe atleast!

Writing code is rarely the problem anyway. Understanding the problem and devising a suitable solution given the full context is where the magic is. And since most humans have a hard time even accurately describing a problem and full context, there's no threat that AI will replace developers. If we can build up an immense library of clearly defined problems and solutions, with variants which fit with all conceivable u…

The interesting bit will be when the AI is smart enough to take an “easy” language like Typescript and convert it to rust or c++

Re: AI converts between hundreds of programming languages

#43

Tried pasting a big piece of code. "Whoah, that's big, try something smaller." Ok, paste small snippet of code. Click "translate". "Sign up first". Urgh, fine, this looks just about exiting enough to try, but barely so. After signing up, I have zero credits, without a single translation performed. I mean, not that I expect free lunch, but I'm also not gonna pay money before seeing a single 10 line example.

Plus a trivial translation is just that, trivial. It’s not going to rewrite the huge web of dependencies that any given app consists of, nor will it recreate the various differences between runtime environments for interpreted languages. It’s essentially a cute party trick. Stuff like copilot is where I see the utility in the space.

Not today anyway, but it's not like this type of conversion lives in a unknown future.

Re: AI converts between hundreds of programming languages

#44
post #38

First underwhelming AI post on the frontpage. Thank god our jobs are safe atleast!

Writing code is rarely the problem anyway. Understanding the problem and devising a suitable solution given the full context is where the magic is. And since most humans have a hard time even accurately describing a problem and full context, there's no threat that AI will replace developers. If we can build up an immense library of clearly defined problems and solutions, with variants which fit with all conceivable u…

Programming is 10-20% of the job, sure it's fundamental but even if an AI could generate optimal code solutions for most use cases it'd still never replace us...

...probably.

Re: AI converts between hundreds of programming languages

#45
post #38

First underwhelming AI post on the frontpage. Thank god our jobs are safe atleast!

Writing code is rarely the problem anyway. Understanding the problem and devising a suitable solution given the full context is where the magic is. And since most humans have a hard time even accurately describing a problem and full context, there's no threat that AI will replace developers. If we can build up an immense library of clearly defined problems and solutions, with variants which fit with all conceivable u…

So what we need is an AI that completely understands the problem space and can tell us what to code.

Re: AI converts between hundreds of programming languages

#47

Earlier quoted context omitted.

Plus a trivial translation is just that, trivial. It’s not going to rewrite the huge web of dependencies that any given app consists of, nor will it recreate the various differences between runtime environments for interpreted languages. It’s essentially a cute party trick. Stuff like copilot is where I see the utility in the space.

Not today anyway, but it's not like this type of conversion lives in a unknown future.

There are some bits that just simply cannot be translated. For example, you can’t just “translate” a stdlib function from a high level language into a low level language, there’s likely no comparison in the low level language.

Re: AI converts between hundreds of programming languages

#49
I used GitHub Copilot to translate a few small programs, from Javascript to Python.

Results:

- single lines went over well, and even became idiomatic in the destination language

- snippets translated well

- for two snippets translated separately, the 2nd snippet didn't understand the original context and got confused. Lesson: translate a whole file at once, or you'll have to fix cross-function references/names.

One test I thought didn't work. My 100 lines of (admittedly crappy) Javascript got cut off. Actually... it worked! It translated 100 lines of JS into 50 lines of idiomatic Python! I was extremely surprised.

More results

- original had a driver function and a worker function. The translated code just inlined everything. I'd have preferred the multiple functions be preserved, but it's okay.

- idiomatic Javascript was translated to idiomatic Python

- it used modules I'd never heard of. I thought the AI had just made things up, but the modules were actually real! Very happy with this.

- it also used old modules. I had to rewrite several lines and retarget the code to use a modern module, vs the original which was deprecated.

Bottom line: at least the AI I tried (Copilot), is effing magic! We saved our client probably $1000 in just one usage of this tool.

I'm going to continue paying for this out of my own pocket, to use for learning new languages, modules, and for translating the occasional small program.

Huge caveat: talk to your Dir Eng or CTO about sending their proprietary code to some random service on the internet. They probably will NOT like it. Thus, AI can only be used in occasional "I'm starting from scratch and learning this" type situations. You can NOT use AI on business code without company consent, which dramatically limits its usefulness for the moment.

Re: AI converts between hundreds of programming languages

#50

I have written translators and they are really hard. I think training on code bases is the way to go but I am skeptical overall that it is even worth the effort. The problem is that the translation doesn't get you all the way there. The code produced is buggy and wrong in most cases. You probably get a better result from re-designing and re-implementing. I wonder what the data being trained on even is. It has to incl…

I’ve written translators that also had to consider pattern changes. The amount of training to translate code effectively is enormous to be effective at scale. I assume this is segmenting separate models based on each language permutation.

I would love to see AI applied to predict algorithms and provide intelligent recommendations.

Post reply on HN