Live data from Hacker News

AI converts between hundreds of programming languages

codelanguageconverter.com

1–10 of 60 posts

Re: AI converts between hundreds of programming languages

#2
I think I broke it.

    Input: TypeScript
    Output: QuakeC
    Code: Sample 3
Seems to spin forever. (Which makes sense, as QuakeC is incapable of the constructs in Sample 3).

Edit: after a few minutes spinning it's... Spewing a lot of nonsense. It seems to be dumping every variable combination it can "think" of that it has seen in QuakeC.

Re: AI converts between hundreds of programming languages

#4
post #2

I think I broke it. Input: TypeScript Output: QuakeC Code: Sample 3 Seems to spin forever. (Which makes sense, as QuakeC is incapable of the constructs in Sample 3). Edit: after a few minutes spinning it's... Spewing a lot of nonsense. It seems to be dumping every variable combination it can "think" of that it has seen in QuakeC.

I think maybe they're being a bit too ambitious by trying to cover so many languages. Obscure languages won't have nearly as many examples to train on.

Re: AI converts between hundreds of programming languages

#5
Just tried the default example from C to Forth. It gave an answer but also appended two other commented Forth functions to it.

Also, this almost immediately adds a signup wall not for the real product, but to the little demo box on the home page that makes it not worth playing with

Re: AI converts between hundreds of programming languages

#6
post #2

I think I broke it. Input: TypeScript Output: QuakeC Code: Sample 3 Seems to spin forever. (Which makes sense, as QuakeC is incapable of the constructs in Sample 3). Edit: after a few minutes spinning it's... Spewing a lot of nonsense. It seems to be dumping every variable combination it can "think" of that it has seen in QuakeC.

Prolog also seems to be broken; it keeps importing modules over and over

Re: AI converts between hundreds of programming languages

#7
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.

Re: AI converts between hundreds of programming languages

#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.

Re: AI converts between hundreds of programming languages

#10
post #2

I think I broke it. Input: TypeScript Output: QuakeC Code: Sample 3 Seems to spin forever. (Which makes sense, as QuakeC is incapable of the constructs in Sample 3). Edit: after a few minutes spinning it's... Spewing a lot of nonsense. It seems to be dumping every variable combination it can "think" of that it has seen in QuakeC.

TypeScript to Fortran is also broken, generating lots of dlopen/dlsym/dlclose calls (one for every variable, it seems), but never actually doing anything else with it.

For what it's worth, Sample 2 generates syntactically invalid code, having `:` instead of `::`. Sample 1 is actually working code (but relies on the implicit typing rules, which gives you the default real kind instead of double precision reals). Interestingly, translating Sample 1 from Rust to Fortran suddenly generates a subroutine instead of a function, but does generate types.

Post reply on HN