voxfrege
Joined 13 years ago
Joined 13 years ago
OTOH, one experience we did make is that the JVM is not so bad in running pure code, as far as the JIT and GC is concerned.
The biggest hurdles on the JVM are: absence of value types (e.g. tuples), the smallish, fixed stack, and lack of tailcall bytecode.
And, in addition, to Java source code.
You can call "into" Frege code from any JVM language. OTOH, you can call any JVM code you could with Java (Frege is compiled to Java source code).
The crucial point are the data that get exchanged between Frege and Java in either direction. While there are no problems with primitive types or Strings, standard JVM container classes like java.util.HashMap or java.util.ArrayList represent mutable data, and thus we can't use them with _pure_ Frege code.
For that reason, we still need monads (in particuar, IO and ST) to deal with mutable data in Frege.
Whoever told you it's impossible in .NET is probably wrong. Don't you have interfaces in C# ? But you don't even need interfaces. Strictly speaking, unless you use typeclasses with polymorphic recursion, you don't need a runtime representation for typeclasses at all.
Here is an example:
ingo@freguntu:~/Frege/frege$ time java -jar fregec.jar -version
3.23.900
0:00.22 62016k
ingo@freguntu:~/Frege/frege$ ls -l fregec.jar -rw------- 1 ingo ingo 33426802 Mär 6 12:32 fregec.jarThe goal of the Frege developers is to achieve full Haskell 2010 compatibility by the end of this year. However, that still doesn't mean you can port all code easily.
What it does mean is that you can use your Haskell skills in projects that are for some reason restricted to the JVM.
The difficulties are clearly stated in the Hasell wiki here https://wiki.haskell.org/GHC:FAQ#Why_isn.27t_GHC_available_f...
The short answer is that it is not derived from existing Haskell compilers.
When you don't need the JVM, by all means, use GHC or some other native Haskell compiler! You'll have more language extensions, libraries, and your program will be faster and use less memory in most cases.