Frege--based class Haskell pure functional programming language

Source: Internet
Author: User

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.

    1. 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.

    2. 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.

    3. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.