Hacker News new | ask | show | jobs
by sealeck 345 days ago
> With minor exceptions, moving from one language to another isn’t a matter of simple syntax, trivia, or swapping standard libraries.

I think this is not true for most programming languages. Most of the ones we use today have converged around an imperative model with fairly similar functionality. Converting from one to another can often be done programmatically!

2 comments

The question isn’t whether there exists a function that can translate one language to another. If they’re Turing complete, it’s certainly the case that the same software CAN be written in different languages. The question is whether or not it would produce idiomatic code in the target language and whether or not you/the developer would recognize it as (not) idiomatic when it did.

You can’t tell me that precisely the same paradigms, mechanics, patterns and practices will be used to develop software in both Java/Spring and Ruby/Rails, for example. The way you need to (be able to) think about how you write the software using those two languages will be non-trivially different.

I mean, absolutely and obviously not, right?

Like, languages aren't just different ways to express the same underlying concepts? It's clearly not the case that you can just transliterate a program in language X to language Y and expect to get the same behavior, functionality, etc. in the end?

> It's clearly not the case that you can just transliterate a program in language X to language Y and expect to get the same behavior, functionality, etc. in the end?

You most definitely can; if you have Turing complete languages A and B, you can implement an interpreter for A in B and B in A; you can implement a simple X86/aarch64 interpreter in either A or B and use that to run compiled/interpreted programs in the other; you can also write higher-level routines that map to language constructs in one or the other to convert between the two.