Skip to content

Instantly share code, notes, and snippets.

@dysinger
Created February 1, 2014 23:40
Show Gist options
  • Save dysinger/8760823 to your computer and use it in GitHub Desktop.
Save dysinger/8760823 to your computer and use it in GitHub Desktop.
Idris -> Java Hello World in 6 lines
$ cabal sandbox init
$ cabal install idris
$ echo 'main : IO () ; main = print "hello"' >hello.idr
$ ./.cabal-sandbox/bin/idris --mvn --codegen Java -o hello hello.idr
$ cd hello
$ mvn -DmainClass=hello package shade:shade
$ java -jar target/hello.jar
"hello"
@LeifW
Copy link

LeifW commented May 14, 2014

Why the round trip through --mvn? As opposed to leaving off that flag, and lines 5 & 6. Also, it produces self-executably jars - just ./hello should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment