News for hackers. Stuff that matters.
Re:Transpiling between any programming languages (2019) by yters on Monday February 17, 2020 @09:10PM (#22352844)
Lets say we have a language where each function can return a string expression of itself. E.g. print.str() = "print". gen_exp() uses this function at least for some of its operation. Once we transpile the resulting expression will no longer run in the target language, even with the inner call to transpile. Maybe there is an easy solution to this issue too, but it seems I can keep coming up with new complications the transpiler will need to account for, thus I can't see how transpilation can be guaranteed in general. We would need a general proof that no counter example is ever possible for some given transpilation scheme to guarantee generality.
Re:Transpiling between any programming languages (2019) by firethief on Wednesday February 19, 2020 @12:21PM (#22367651)
A transpiler is a compiler. There's nothing that can be compiled but can't be transpiled, because transpiling is just what we call compiling when the target is subjectively deemed a high-level language. So the problem you're describing isn't with transpilation; it sounds like it's with compiling a dynamic language with reflection. That's a tractable problem; you just can't solve it as statically as you would for an AOT-compiler for a more analyzable language. Reflection has to be as late-bound as the rest of the language.
Re:Transpiling between any programming languages (2019) by yters on Friday February 21, 2020 @02:46PM (#22386105)
Right the problem applies to compilation as well, which is why not all languages can be compiled. Compilation in general is undecidable.