17
heyheni
4y

https://arxiv.org/abs/2006.03511

New reasearch paper about machine learning applied to translate code into different programming languages.
Would you see a use case for this at your work?

Comments
  • 6
    24% success seems a bit low...
  • 6
    @cafecortado like everything machine learning give it a half to a year of advancement and it will beat every human, doesn't it? 😄

    could you use a "google translate" for your code? and what would it be?
  • 7
    I've seen software to convert legacy COBOL code in modern Java. Obviously the software wasn't able to convert 100% of the input code, but it made life easier to programmers that just had to "fix" failed tests. I don't think it was fueled by machine learning though, and I don't think we will ever see a perfect language-to-language converter. But if they require you this kind of job and machine learning can help you, why not?
  • 7
    I'm terrified of "certain devs" using "certain frontend languages" that are going to do things they shouldn't.
  • 4
    @Jilano here some nightmare fuel from two years ago. scribble an app on paper and hold it under a camera and the ml model generates a fully functional react app for prototyping.

    https://youtu.be/3MPc3PZ6dc4
  • 4
    @heyheni dayum... I guess if we give the AI program a few UMLs giving the structure of program, we could get a relatively better output... Just need to train it on UMLs only so that the structure is relatively formal

    Also, now that I think of it, how will we get a training dataset?
  • 2
    At my work in the foreseeable future, no. But I can definitely see use cases for this, and broad range of them, ranging from a case of a prototype or a POC written in one language then realizing that to make some of the features required for the production version another language could work better (or the devs responsible for doing POCs and the ones eventually having to maintain the production version are well-versed in different languages) to use cases as an educational tool for learning one language if you have a base in another...
  • 3
    Wtf is this shit.

    Why would you like to transpile high level languages with ML, when the important thing is the compiled form. Either try to uniformely optimize compiled code or "transpile" code from legacy systems to modern systems.

    But this once again proofs to me that ML is just one huge cluster fuck of people not understanding problem domains and just throwing computing power against a wall in hope of something sticking to it
  • 1
    @Yggdrasil nah mate... you sometimes want to convert a complex code and translate and paste it in your project...

    With the fuck all in Kotlin, had the Android Studio not kept option of keeping both java and kotlin code in the same project, and working perfectly fine, my brain might have had exploded in my previous project
  • 0
    @gitlog maybe if the code was this complex it needed a rework badly, just saying.

    Bad design stays, no matter how much "ML-Transpilation" you do
  • 0
    @Yggdrasil tbh I am not that proficient in kotlin, and when I was informed that kotlin didn't have few things, I tried to learn that stuff and failed.

    Not to say I didn't have much time in hand and the code was well written and modular enough to bear one nail in that beautiful wall
  • 2
    I don't think language to language translating will every be perfect since third party library and framework will mess it up.

    The translating will work if the source language only use standard library. If the source language use third party library there may not be equivalent library in target language.Therefore the best result you can ask for is compromise.

    I am surprise that nobody is mentioning third party library/framework. Am I missing the point somehow?
  • 0
    @mr-user you are already thinking way to far first there should be a real use case, third party libraries are details 😅
  • 1
    @heyheni yo what the fuck
  • 3
    @heyheni Lalalalalalala I can't hear youuuuu!
    (I'll check it out, thanks)

    @gitlog You'll get interns to train your AI
  • 5
    No. High level languages have a very complex implementation behind simple instructions, with decisions that are meant to prefer specific coding styles and use cases. eg. when writing certain algorithms in C#, you probably want to use structs instead of classes, because classes are always placed on the heap and garbage collected. When (if) implementing them in python, you don't have that option. This means that unless the ML can tell infrastructure from algorithms, transpiling these algorithms from python to C# will produce a suboptimal result. Alternatively, the ML can make this decision based onn how often the objects are assigned, in which case its choice will be seemingly spontaneous and depend on code that's scattered all over the codebase. Doubleplusungood.
  • 0
    It reminds me WSDL generator hell
  • 1
    @LeFlawk it’s called llvm and web assembly, bytecode alliance is working on it
  • 1
    @LeFlawk yeah haxe is nice, unfortunately it wasn’t supported by any big company but only by small game dev community and when it started with flash, adobe completely ignored this technology like they ignored 3d and unity was created, funny times.
    Fuck I’m old.
  • 0
    > Python to C++

    h m m
  • 1
    To be honest, I wouldn't worry or believe any hype related to full automation (especially in Generative Models). It is not going to work. The cost, time, and uncertainty of the outcomes are incredibly high. I work in the area of NLP, and I would never use a generative output in production. We are far from real,” Ai.” I believe it will be possible one day, but that day - humans will have an evolved perspective of reality and life. Complete different from ours today (clearly).
  • 0
    If they had to guess any generous models they're successful in the next decade will likely grow out of existing IDE efforts such as automated code Improvement suggestions. Fuck me I can't remember what they're called. Anyway.
  • 2
    If you really want to do this, design a language for the AI to work with and translate through that. This way the AI will only have to be trained for simple decisions like "Should this be a reference or a value?" and "What kind of collection should I use for this JS array?"
  • 0
    @Lor-inc

    Isn't that the same as interpreter that language like C# and Java use?
  • 0
    AI is meant to solve problems that don't have an obvious algorithm. This isn't such a problem, except for some isolated questions.
  • 0
    @mr-user No, those are low level intermediate representations that are meant to be JIT compiled. What this problem needs is a high level IR with classes, lambdas, closures and the like.
  • 0
    @mr-user You need a separate representation for lambda because you want the code to "look" similar not just "work" similar, because high level languages are meant to be read. There would be no point in transpiling to anything but C unless you want to read it.
Add Comment