Earlier quoted context omitted.
> "undefined" corners but that's not because we don't understand them but because they are deliberately left open. Even they are precisely defined. Not sure what language you are referring to, because this statement is very vague, but it's worth pointing out that undefined behavior in the C/C++ sense is absolutely not precisely defined. If a program executes undefined behavior in either of these languages, the entire…
> it's worth pointing out that undefined behavior in the C/C++ sense is absolutely not precisely defined. I think OP means "it is precisely defined by the spec which actions result in undefined behaviour"
Deep learning to translate between programming languages
71–80 of 81 posts
Re: Deep learning to translate between programming languages
#72Cool magic trick but I fail to see anything useful coming out of it. I would not blindly rewrite code, rather see how it can be improved and maybe dig a bit in the existing functionality, clean it out, use the new language in my advantage... Also as a programmer your mental modal is completely out of sync, how do you work on such application suddenly now that its all in Python (coming from C++)? Or is this shipped to…
You would, but FB and some other companies are dealing with 20 years and millions of lines of code written by a small army of developers. If they decide to switch language and rebuild their services, just doing it manually will in all likelihood take longer and more people if they don't apply tricks like automatic conversion, because it takes more effort to rebuild than to build fresh due to multiple reasons.
Re: Deep learning to translate between programming languages
#73Earlier quoted context omitted.
You would, but FB and some other companies are dealing with 20 years and millions of lines of code written by a small army of developers. If they decide to switch language and rebuild their services, just doing it manually will in all likelihood take longer and more people if they don't apply tricks like automatic conversion, because it takes more effort to rebuild than to build fresh due to multiple reasons.
But the options aren’t “manual” and “ai”. There is a third option of using classical static analysis and compiler techniques that have been around for decades to do transpilation and large scale refactors. There are entire companies already build around this.
It may be more cost effective to keep around some developers who know the old code base and the language it's written in.
Re: Deep learning to translate between programming languages
#74I've been thinking of a pandoc-like tool to translate between languages, i.e. a transpiler. You would need to write down the most general abstract syntax tree (AST) that encompasses all supported languages' features, as well as a way to read languages into this AST, and write the AST into languages. The cool thing about pandoc is the ability to transform the AST between the read and write. In the context of a transpi…
Re: Deep learning to translate between programming languages
#75Earlier quoted context omitted.
I've heard that LLVM uses neural networks to drive the register allocator. I don't know how well it works, but it's a pretty cool idea.
In the PGO category, there's also this recent proposal: http://lists.llvm.org/pipermail/llvm-dev/2020-April/140763.h... At compile-time only, people have also been using trained models to derive cost functions for sequences of instructions (as opposed to analytical models which become very difficult to derive these days given the complexity of modern CPU architectures)
It's hard to even figure out if the scheduling algorithms that work well on the Pentium and PentiumPro are worthwhile for the x86-64.
Re: Deep learning to translate between programming languages
#76This sounds more impressive than it is. I kept an auto-translation going for quite a while from C# to Go just by creating some bash scripts. These languages are so similar, that while not idiomatic, you can be up and running with quite few rules and some simplifications to the original code. While I believe this is a good arena for algorithms to provide solution, I'm sceptical that ML in its current incarnations is t…
How do you handle generics? Go doesn’t have them, right? C# has an open source compiler (Rosyln) with an API that exposes lot of information, so for advanced needs there is this road too.
Re: Deep learning to translate between programming languages
#77Earlier quoted context omitted.
That seems like a lot of effort when Julia is both high-level and efficient already.
Ok but I have 3 million lines of Python code, so that doesn't help me. I'm not gonna spend a year or two writing everything in Julia.
Re: Deep learning to translate between programming languages
#78This sounds more impressive than it is. I kept an auto-translation going for quite a while from C# to Go just by creating some bash scripts. These languages are so similar, that while not idiomatic, you can be up and running with quite few rules and some simplifications to the original code. While I believe this is a good arena for algorithms to provide solution, I'm sceptical that ML in its current incarnations is t…
Maybe take a look at the translations in the paper and come back to give a second opinion?
Re: Deep learning to translate between programming languages
#79Earlier quoted context omitted.
That seems like a lot of effort when Julia is both high-level and efficient already.
Ok but I have 3 million lines of Python code, so that doesn't help me. I'm not gonna spend a year or two writing everything in Julia.
Re: Deep learning to translate between programming languages
#80Earlier quoted context omitted.
That seems like a lot of effort when Julia is both high-level and efficient already.
Let's rewrite everything in Julia.
But yeah, I won't start any new projects in Python.