https://github.com/mmhelloworld/idris-jvm
JVM bytecode back end for Idris
https://github.com/mmhelloworld/idris-jvm
idris java jvm
Last synced: 10 days ago
JSON representation
JVM bytecode back end for Idris
- Host: GitHub
- URL: https://github.com/mmhelloworld/idris-jvm
- Owner: mmhelloworld
- License: bsd-3-clause
- Created: 2016-07-17T07:06:57.000Z (almost 10 years ago)
- Default Branch: main
- Last Pushed: 2026-06-10T00:52:40.000Z (12 days ago)
- Last Synced: 2026-06-10T02:19:01.362Z (12 days ago)
- Topics: idris, java, jvm
- Language: Idris
- Homepage:
- Size: 55 MB
- Stars: 482
- Watchers: 27
- Forks: 28
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Citation: CITATION.cff
- Support: support/Makefile
Awesome Lists containing this project
- awesome-java - Idris JVM
README
Idris 2 for JVM
============
[](https://github.com/mmhelloworld/idris-jvm/actions/workflows/install.yml)
[Idris 2](https://idris-lang.org/) 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 [releases page](https://github.com/mmhelloworld/idris-jvm/releases/latest).
* Extract the archive and add `idris2` launcher script directory `/exec` to PATH.
* Create an environment variable `IDRIS2_PREFIX` pointing to `/env`
## Example
#### helloworld.idr
```idris
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
```shell
% build/exec/main
["3", "+", "7", "/", "2"]
```
## Documentation
* [Idris JVM documentation](https://idris-jvm.readthedocs.io/en/latest/)
* [Idris 2 documentation](https://idris2.readthedocs.io/en/latest/index.html)
## License
This repository extends [idris-lang/Idris2](https://github.com/idris-lang/Idris2) repository with JVM backend. Files from [idris-lang/Idris2](https://github.com/idris-lang/Idris2) are covered by that repository's [license](https://github.com/idris-lang/Idris2/blob/main/LICENSE).
All other files from this repository are covered by BSD-3-Clause License. See [LICENSE](LICENSE).