IssueRaiser

Well, the problem with C++/Java and the ML language families is that they are quite incompatible, so it's not really trivial to mix ...

Well, the problem with C++/Java and the ML language families is that they are quite incompatible, so it's not really trivial to mix them. Many languages have tried, most recent languages really. Rust is C with ADTs or ML without garbage collection (not yet sure how closures will turn out), Scala is Java with first-class functions and ADTs, Java and C# are absorbing more and more features from ML, ... Swift is just another attempt to mix the two, quite a successful one IMO. They kept some warts, probably to maintain binary compatibility with Obj-C, but otherwise I think it's a huge improvement over Java-style languages. One particular pain point between Java-style and ML-style languages are generics; Java and C# have a common object protocol and thus allow a top type, Object, and run-time type information. So, they must decide whether generics/type parameters are only relevant at compile-time (Java) or are kept at run-time (C#). ML avoids this issue by not having any runtime type information (and no type-testing construct). I haven't yet found where Swift stands, but it's a hard problem to solve.

Posted by tomp on Jun 8, 2014, 11:02 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.9,500 issues0 comments

hackernews (Software)

Well, the problem with C++/Java and the ML language families is that they are quite incompatible, so it's not really trivial to mix ...

tompJun 8, 2014, 11:02 PM

Well, the problem with C++/Java and the ML language families is that they are quite incompatible, so it's not really trivial to mix them. Many languages have tried, most recent languages really. Rust is C with ADTs or ML without garbage collection (not yet sure how closures will turn out), Scala is Java with first-class functions and ADTs, Java and C# are absorbing more and more features from ML, ... Swift is just another attempt to mix the two, quite a successful one IMO. They kept some warts, probably to maintain binary compatibility with Obj-C, but otherwise I think it's a huge improvement over Java-style languages. One particular pain point between Java-style and ML-style languages are generics; Java and C# have a common object protocol and thus allow a top type, Object, and run-time type information. So, they must decide whether generics/type parameters are only relevant at compile-time (Java) or are kept at run-time (C#). ML avoids this issue by not having any runtime type information (and no type-testing construct). I haven't yet found where Swift stands, but it's a hard problem to solve.

Comments (0)

No comments yet. Start the discussion.

Comment on this issue