top | item 23927963

(no title)

brutt | 5 years ago

You will need to create common library for all these languages, then write all your programs using your own libraries only.

discuss

order

cosmic_quanta|5 years ago

I don't get why? The AST can be parsed by any single language. Haskell is particularly well-suited for writing parsers.

tsimionescu|5 years ago

I believe the point is that you can have perfect syntactic compatibility, but that means nothing when your program calls boost::asio or a Common Lisp defmethod and you want to interpret it as Haskell.

The only way this could work is if you write the whole stdlib in your AST system.

Of course, this still won't mean your lazy Haskell program works as an eager C program. Language semantics are too different, even between similar languages, you'll ALWAYS hit corner cases on anything more than a toy program. Even if you translate C# to Java. Well, maybe C to C++ will work decently, as few programs use the diverging features.