Live data from Hacker News

AI converts between hundreds of programming languages

codelanguageconverter.com

21–30 of 60 posts

Re: AI converts between hundreds of programming languages

#22
post #8

Interesting going from untyped languages to typed languages, as an inference needs to be made. For example, in JavaScript: function add(a, b) { return a + b; } converting to Go, it becomes: func add(a int, b int) int { return a + b } Where as the original JS version works with integers, floats, strings, arrays, etc.

Same for ruby and elixir. Assumed type..

Re: AI converts between hundreds of programming languages

#25

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.

At least the samples seem legit, in the sense that some break the algorithm badly enough that we can be confident they weren't hard-coded lol.

ha ha

Re: AI converts between hundreds of programming languages

#29
I think the best case something like this could achieve is a syntax translate and nothing more.

At best I'd get Ruby code with elixir syntax.

Programming languages require thinking about memory and code differently. That's why we have them.

I'd be interested to see this in elixir :)

while (s++ = t++);

Re: AI converts between hundreds of programming languages

#30
Seems completely broken now; like others, I tried to test something, found I had to sign up, signed up, and found I have "0 free credits".

I really wanted to see what it was gonna do for Python -> C++ converting some nested dictionary and list comprehensions:

    def foobar(x, y):
      return {
        _: __
        for _, __ in zip(
          [_ for _ in x if _ in y],
          [_ for _ in x if _ not in y]
        )
      }
        
    {3: 1, 4: 2} == foobar([1, 2, 3, 4], [3, 4, 5, 6])
Post reply on HN