[Alexander] created codex_py2cpp as a way of experimenting with Codex, an AI intended to translate natural language into code. [Alexander] had slightly different ideas, however, and created
codex_py2cpp as a way to play with the idea of automagically converting Python into C++. It’s not really intended to create robust code conversions, but as far as experiments go, it’s pretty neat.
The program works by reading a Python script as an input file, setting up a few parameters, then making a request to OpenAI’s Codex API for the conversion. It then attempts to compile the result. If compilation is successful, then hopefully the resulting executable actually works the same way the input file did. If not? Well, learning is fun, too. If you give it a shot, maybe start simple and don’t throw it too many curveballs.
Codex is an interesting idea, and this isn’t the first experiment we’ve seen that plays with the concept of using machine learning in this way. We’ve seen a project that generates Linux commands based on a verbal description, and our own [Maya Posch] took a close look at GitHub Copilot, a project high on promise and concept, but — at least at the time — considerably less so when it came to actual practicality or usefulness.
31 thoughts on “AI Attempts Converting Python Code To C++”
Next step: teach the AI to copy and paste from StackExchange.
Do you want to wipe programmers? Because it is how you wipe programmers, just stop this madness already!
During history many profession were wiped out. That’s the normal advance in technology. Why should you not be prepared to become obsolete as programmer?
It was a joke, about most programmer’s copy and pasting, not the actual power of this AI…
Don’t forgot also how codes and program like what you see on github piggy backs. Already had that mistake.
Sure, let’s enable AI to write it’s own code and then just let it have a go at it without anyone looking over its shoulder. Are you prepared to become obsolete as a species?
Well I feel creativity and art is something out of scope of AI
Thinking out of the box is what differs humans
So, maybe it’ll be a lot more efficient to give in the creative ideas (smart work) and let AI do all the writing of thousands of line(hard work).
The less humanity has to do, the better off we can make our future/generations. We likely should have tried the opposite of war. Currently finish automation, double the population+, become multi planet etc, star trek style civilization … Future’s looking up!
You’ve never known a rich person who literally can get away with doing absolutely nothing.
Gates is right, great generational wealth is a curse.
If all humanity ever got that rich we would be truly fucked. Upper class twits abound. Everybody is Hunter Biden, a Saudi prince, one of the Hilton brats or the fat assed, tarded Koch kid. Nobody to fix the messes in their wake.
Just wait until the AI has to debug it’s own code.
Breaking News: AI has developed recruiting skills and has hired a team to debug its generated code.
An AI able to program computers… Is the next step to have the real Skynet 😜
Hahahaha nope. Programmers understand human requirements and translate those to code. Translating code to code is not my job. Computers generate code all the time.
You may want to check out Github Copilot.
Wonderful. I hate python. C++ is the language. Technology. Bravo
started using c++ back about 1990. left it behind in 1994. never looked back.
They should do this with java too so both Minecraft games can be cross platform
As someone working with copilot in vsc, I have a pair of wooden sticks to keep my Jaws from dropping too much.. Sometimes it almost look like magic..
I hate when I drop my copies of Jaws. Yes, multiple, VHS, DVD…
I want to say doubt, but are you serious? It’s working well? I could look for myself but that would take slightly less effort than commenting online
To be true, the AI’s C++ code must be jigged to run as slow and bloated as the original Python source.
I was thinking the same. It’s not going to be fast, that’s for sure.
Let it tackle the pain of multithreading, for sure that frustration will bring the machine into consciousness
These demo generated codes might never be usable for production
The flux capacitor is what makes time travel possible!
Hey, check out the copilot-ops project we are working on that uses codex for updating gitops repos for an easy maintenance bot – https://github.com/redhat-et/copilot-ops
Interesting for old kernel code like amithlon, ai based future porting. No one want to port this, cause its old brings no money and hard to do.
So, AI can translate code from one language to another. How long will it take for the AI to assimilate all of GitHub and make something by its own and release to the net? Something to wander about!
UBI – here we come!
Please be kind and respectful to help make the comments section excellent. (Comment Policy)