Giter Club home page Giter Club logo

idris-jvm's Introduction

Idris 2 for JVM

Build Status

Idris 2 is a purely functional programming language with first class types. This repository provides Idris 2 compiler targeting JVM bytecode so that Idris 2 compiler and Idris 2 programs can run on the JVM.

Install

  • Download the latest Idris 2 JVM release from here https://github.com/mmhelloworld/idris-jvm/releases/latest.
  • Extract the archive and add idris2 launcher script directory <EXTRACTED_DIRECTORY_ROOT>/bin to PATH.
  • Create an environment variable IDRIS2_PREFIX pointing to <EXTRACTED_DIRECTORY_ROOT>/lib

Example

helloworld.idr

    module Main

    data Tree a = Leaf
                | Node (Tree a) a (Tree a)

    inorder : Tree a -> List a
    inorder Leaf = []
    inorder (Node left a right) = inorder left ++ [a] ++ inorder right

    tree : Tree String
    tree = Node
            (Node
              (Node Leaf "3" Leaf)
              "+"
              (Node Leaf "7" Leaf))
            "/"
            (Node Leaf "2" Leaf)

    main : IO ()
    main = printLn $ inorder tree

Compile

idris2 helloworld.idr -o main

Run

  • On Linux/Mac OS: java -cp "build/exec/main_app/main.jar:$IDRIS2_PREFIX/*" main.Main
  • On Windows: java -cp "build\exec\main_app\main.jar;%IDRIS2_PREFIX%\*" main.Main

License

This repository extends idris-lang/Idris2 repository with JVM backend. Files from idris-lang/Idris2 are covered by that repository's license.

All other files from this repository are covered by BSD-3-Clause License. See LICENSE.

idris-jvm's People

Contributors

andrevidela avatar andylokandy avatar buzden avatar chrrasmussen avatar claymager avatar clayrat avatar cypheon avatar edwinb avatar fabianhjr avatar gallais avatar jfdm avatar madman-bob avatar marcelinevq avatar mattpolzin avatar mb64 avatar melted avatar michaelmesser avatar mmhelloworld avatar nickdrozd avatar ohad avatar rbarreiro avatar russoul avatar shinkage avatar ska80 avatar stefan-hoeck avatar stepancheg avatar sventimir avatar timsueberkrueb avatar z-snails avatar ziman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.