Erlang code generator for Idris 2. Currently this repository includes a full copy of the Idris 2 compiler, but at some point I want to make this repository into a standalone code generator.
Note that this project is still work in progress. Feedback and contributions are appreciated!
Idris 2 is a purely functional programming language with first class types. The development of Idris 2 is led by Edwin Brady. More information about Idris 2 is available at:
erlc)
mix_idris2 to automatically recompile changed modules.base package. (Currently a few modules are placed in the Erlang namespace)Create a file called Main.idr with the following content:
main : IO ()
main = putStrLn "Hello Joe"
Run the Idris 2 program via generated Erlang code: idris2erl --exec main Main.idr
More code samples:
To run the generated Erlang code, Erlang OTP 21.2 or newer is recommended.
There are three alternative methods to install Idris 2 with the Erlang code generator:
idris2 executable — Recommended if you want to contribute to Idris2-Erlang.The built executable is named idris2erl. This is done to avoid clashing with an existing installation of idris2. idris2erl is configured to use Erlang as the
default code generator.
On Windows, you may need to install via MSYS2 (https://www.msys2.org/). On Windows older than Windows 8, you may need to set an environment variable OLD_WIN=1 or modify it in idris2/config.mk.
This repository contains a rebar3 project that can build a standalone Escript executable. The Escript contains the libraries and can be freely moved around. The Erlang run-time needs to be available to run this Escript.
The generated Erlang source files are only included in specific releases, and not in the main branch.
Steps:
git clone https://github.com/chrrasmussen/Idris2-Erlangcd Idris2-Erlanggit checkout tags/v0.2.1-alpha.1 -b v0.2.1-alpha.1rebar3 escriptizeThe Escript executable is built to _build/default/bin/idris2erl.
This installation method requires Chez Scheme to be installed.
Steps:
git clone https://github.com/chrrasmussen/Idris2-Erlangcd Idris2-Erlang/idris2make bootstrap SCHEME=chez (Replace chez with the name of your installed version of Chez Scheme)make installThis will install the idris2erl executable, libraries and support files into $HOME/.idris2erl. For easy access, add $HOME/.idris2erl/bin directory to your $PATH.
idris2 executableThis installation method requires Chez Scheme to be installed, and that you have idris2 available in $PATH. To install the official version of Idris 2, see Idris 2's installation instructions.
Steps:
git clone https://github.com/chrrasmussen/Idris2-Erlangcd Idris2-Erlang/idris2make allmake installThis will install the idris2erl executable, libraries and support files into $HOME/.idris2erl. For easy access, add $HOME/.idris2erl/bin directory to your $PATH.
Idris 2 supports interactive editing. See Idris 2's download page for a list of supported editors.
In my experience, the Idris 1 extensions for Visual Studio Code and Atom mostly works for Idris 2. After installing the extension, you need to change location of the Idris executable to point to idris2erl.
The Idris 2 libraries tries to include documentation for its functions and data types. The documentation can be accessed using the :doc command in the Idris 2 REPL.
References:
Samples:
The Idris website contains links to locations where you can find the Idris community.
The Idris 2 compiler is released under the 3-clause BSD license.
The Erlang code generator is derived from the Idris 2 compiler and is released under the 3-clause BSD license.
(top 30 of 209)
Idris
95.3%
C
2.4%
Erlang code generator for Idris 2. Currently this repository includes a full copy of the Idris 2 compiler, but at some point I want to make this repository into a standalone code generator.
Note that this project is still work in progress. Feedback and contributions are appreciated!
Idris 2 is a purely functional programming language with first class types. The development of Idris 2 is led by Edwin Brady. More information about Idris 2 is available at:
erlc)
mix_idris2 to automatically recompile changed modules.base package. (Currently a few modules are placed in the Erlang namespace)Create a file called Main.idr with the following content:
main : IO ()
main = putStrLn "Hello Joe"
Run the Idris 2 program via generated Erlang code: idris2erl --exec main Main.idr
More code samples:
To run the generated Erlang code, Erlang OTP 21.2 or newer is recommended.
There are three alternative methods to install Idris 2 with the Erlang code generator:
idris2 executable — Recommended if you want to contribute to Idris2-Erlang.The built executable is named idris2erl. This is done to avoid clashing with an existing installation of idris2. idris2erl is configured to use Erlang as the
default code generator.
On Windows, you may need to install via MSYS2 (https://www.msys2.org/). On Windows older than Windows 8, you may need to set an environment variable OLD_WIN=1 or modify it in idris2/config.mk.
This repository contains a rebar3 project that can build a standalone Escript executable. The Escript contains the libraries and can be freely moved around. The Erlang run-time needs to be available to run this Escript.
The generated Erlang source files are only included in specific releases, and not in the main branch.
Steps:
git clone https://github.com/chrrasmussen/Idris2-Erlangcd Idris2-Erlanggit checkout tags/v0.2.1-alpha.1 -b v0.2.1-alpha.1rebar3 escriptizeThe Escript executable is built to _build/default/bin/idris2erl.
This installation method requires Chez Scheme to be installed.
Steps:
git clone https://github.com/chrrasmussen/Idris2-Erlangcd Idris2-Erlang/idris2make bootstrap SCHEME=chez (Replace chez with the name of your installed version of Chez Scheme)make installThis will install the idris2erl executable, libraries and support files into $HOME/.idris2erl. For easy access, add $HOME/.idris2erl/bin directory to your $PATH.
idris2 executableThis installation method requires Chez Scheme to be installed, and that you have idris2 available in $PATH. To install the official version of Idris 2, see Idris 2's installation instructions.
Steps:
git clone https://github.com/chrrasmussen/Idris2-Erlangcd Idris2-Erlang/idris2make allmake installThis will install the idris2erl executable, libraries and support files into $HOME/.idris2erl. For easy access, add $HOME/.idris2erl/bin directory to your $PATH.
Idris 2 supports interactive editing. See Idris 2's download page for a list of supported editors.
In my experience, the Idris 1 extensions for Visual Studio Code and Atom mostly works for Idris 2. After installing the extension, you need to change location of the Idris executable to point to idris2erl.
The Idris 2 libraries tries to include documentation for its functions and data types. The documentation can be accessed using the :doc command in the Idris 2 REPL.
References:
Samples:
The Idris website contains links to locations where you can find the Idris community.
The Idris 2 compiler is released under the 3-clause BSD license.
The Erlang code generator is derived from the Idris 2 compiler and is released under the 3-clause BSD license.
(top 30 of 209)
Idris
95.3%
C
2.4%