All Projects → bamboo → Idris Cil

bamboo / Idris Cil

Licence: other
A Common Intermediate Language backend for Idris.

Programming Languages

haskell
3896 projects

idris-cil Build Status

A Common Intermediate Language backend for Idris.

Why

Because programmers targeting the CLR deserve a modern pure functional language with dependent types.

Usage

Given a Main.idr file:

module Main

main : IO ()
main = putStrLn "Hello, Idris!"

Compile it to cil and execute it with .NET Core:

idris --codegen cil Main.idr -o HelloWorld.exe \
  && dotnet HelloWorld.exe

The resulting assemblies can also be used with Mono or Unity.

Installing

It's important that the version of the Idris executable matches the version used to build idris-cil:

git clone [email protected]:bamboo/idris-cil
cd idris-cil
stack install idris
stack install

Contributing

Issue reports and PRs are welcome.

Brought to you by @bamboo, @sangamon and contributors.

License

BSD3

Requirements

.NET Core 1.1 with ilasm

Install ilasm using nuget:

dotnet new console -o ilasm-setup
cd ilasm-setup
dotnet add package runtime.osx.10.10-x64.Microsoft.NETCore.ILAsm
cd .. && rm -fr ilasm-setup

Replace the runtime.osx.10.10-x64 prefix above with the right value for your system, for instance, ubuntu.14.04-x64.

Add ilasm to your PATH with something like:

export PATH=$(find $HOME/.nuget/packages -name ilasm | xargs dirname):$PATH

If you get an error from ilasm saying it cannot load libcoreclr.dylib, add the dotnet/shared dir to DYLD_LIBRARY_PATH:

export DYLD_LIBRARY_PATH=/usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.1.2:$DYLD_LIBRARY_PATH
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].