3 ms·
F# without the .NET platform is essentially OCaml. The differences between the two languages are primarily in the way it integrates with the .NET platform and
by sparkie 8y ago
F# without the .NET platform is essentially OCaml.
The differences between the two languages are primarily in the way it integrates with the .NET platform and many assumptions on it.
If you wanted something similar on say, the JVM, starting from OCaml, you would make many different design choices and the result would be a very different language.
- kazinator 8y agoSo F# is the name of an OCaml implementation for .NET, which adds nothing but very .NET-specific extensions that don't make sense anywhere else?
- sparkie 8y agoMostly. It does add some novel new features which could be reused on other platforms, but many of the features are tightly linked to the .NET base class library, and would not translate cleanly over to other platforms (certainly possible to simulate them, but you would probably want something which integrates better with your VM) For example, the whole type system is based on .NETs type system. interfaces, subtyping and generics, properties and indexed properties, which are quite different on the JVM and other platforms. F# usually relies on having attributes (annotations in Java) for compatibility with other .NET languages like C# where certain features did not fit into the OCaml syntax and semantics cleanly. These also wouldn't transfer over to other platforms very well. Some features which F# has that could transfer over to other platforms include measure types, active patterns, and type providers. I believe some of these have already made it to other languages. Gosu, for example, on the JVM had a feature similar to type providers before F# got them, so you could argue that F# borrowed that feature.