Frege is a purely functional programming language inspired by the Haskell language. The Frege program will be compiled into Java and executed on the JVM. It is so similar to Haskell. So that it was called Haskell on the JVM. The name of Frege is to commemorate the German mathematician, logic, philosopher Gottlob Frege.
The main features of language
- Pure Functional programming language
Inherits the spirit of the functional programming language Haskell. The default is invariant (immutability).
- execute on top of JVM
The Frege program is compiled into Java bytecode. Executes on top of the JVM (Java 7+). Frege Code and Java code can call each other.
- non-strongly typed languages
The type is inferred by a powerful type guessing.
The background of the language designer
The Frege was designed by Ingo Wechsung. Ingo Wechsung has about 34 years of computer development, design, consulting work experience.
Now leads the Frege project.
The purpose of designing this language
The reason for designing Frege language. The main focus is to move Haskell to the JVM, allowing some Java projects to take full advantage of Haskell's functional programming encoding. The Frege language is designed to be powerful, simple and expressive.
Application areas
Temporary Frege is not yet mature and there are no commercial projects that use that language. Now the main use in the field of education, teach you what is Frege, and how to use Frege.
Sample code Demo for a typical scenario
Frege's Hello World Demo sample code is as follows:
module Hello wheregreeting friend = "Hello, " ++ friend ++ "!"main args = do println (greeting "World")
Interesting discussions for developers
The following discussion originates from hacker News.
Frege claims to be purely functional programming. But also agree that Frege calls the Java code is not pure. This does not
Will it destroy the purity of Frege?
answer : Encapsulate the variable Java code inside the Frege. The code block will be arranged in an St Monad, which is usually IO monad. This means that Frege using Java's hashset will force the calling code into IO monad.
So the purity of Frege is still preserved.
How is the Frege compiler written? Written entirely from the beginning. Or is it a lot to learn from Haskell?
answer : The Frege compiler is newly written and has nothing to do with the Haskell compiler.
Can Frege invoke the currently existing third-party Java library?
answer : Of course you can. Between Frege and Java, you can call each other, just need some encapsulation work.
Frege--based class Haskell pure functional programming language