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 run on the JVM. It is so similar to Haskell that some people call it 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, which is invariant (immutability) by default.
    • run on top of JVM
      The Frege program is compiled into Java bytecode and runs on top of the JVM (Java 7+). Frege Code and Java code can be called each other.
    • non-strongly typed languages
      The type is judged by powerful type speculation.
The background of the language designer

Frege is designed by Ingo Wechsung, Ingo Wechsung about 34 years of computer development, design, consulting work experience. Currently leads the Frege project.

The purpose of designing this language

The Frege language was designed primarily to move Haskell to the JVM, making it possible for some Java projects to take full advantage of the coding of Haskell's functional programming. The Frege language is designed to be powerful, simple and expressive.

Application areas

Temporarily Frege is not yet mature, and no commercial projects use that language. At present, the main use in the field of education, teach you what is Frege, and how to use Frege.

Sample code for a typical scenario

Frege's Hello World 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 allows Frege to invoke impure Java code without
      Will it destroy the purity of Frege?

      answer : Wrap The variable Java code inside the Frege, and 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 the Frege is still preserved.

    2. How is the Frege compiler written? Written entirely from scratch, or did you learn a lot from Haskell?

      answer : The Frege compiler is newly written and has nothing to do with the Haskell compiler.

    3. Can Frege call the currently existing third-party Java library?

      answer : Of course, between Frege and Java, you can call each other, but you need some encapsulation work.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

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.