| The semantics can still be quite different. You start hitting a lot of corner cases very quickly, unless one of the languages was designed to have semantics close to the other's, or the two languages at least share heavy influence from a common ancestor. Many dynamically typed languages treat null/nill/None, empty string, and empty list as "non-truthy" in a Boolean context, but that's not universal. JavaScript's notion of a class is very different from Python's. Ruby's take on who can call private methods is different from most languages. Python is in a minority for supporting multiple inheritance. In Common Lisp, functions and variables have separate namespaces, whereas in Scheme, they share a single namespace. PHP just has bizarre object conversion and comparison rules that are often inconsistent and therefore incompatible with most other languages (ignoring the Turing tarpit). Getting good enough lexical analysis of the source language to efficiently implement lexical closures in a target language without them can be a pain. On the other hand, if you're cross-compiling buggy webapps written by developers who don't properly understand the semantics of the language they're written in, maybe you can just ignore the semantic mismatches and get a different set of bugs coming out the other side while accidentally fixing other bugs. |
Other than that you're right