Skip to content

Instantly share code, notes, and snippets.

@master-q
Last active August 29, 2015 13:56
Show Gist options
  • Save master-q/9087345 to your computer and use it in GitHub Desktop.
Save master-q/9087345 to your computer and use it in GitHub Desktop.
Compare ATS2/Ajhc/Idris
### Versions
casper$ patsopt --version
Hello from ATS2(ATS/Postiats)!
ATS/Postiats version 0.0.6 with Copyright (c) 2011-2014 Hongwei Xi
casper$ ajhc --version
ajhc 0.8.0.11 (e601dfc26abce79686e41c2609ed5beb7fd7f4d5)
compiled by ghc-7.6 on a x86_64 running linux
casper$ idris --version
Idris version 0.9.11.2
### Source codes
casper$ ls
HelloAjhc.hs hello_ats2.dats hello_idris.idr
casper$ cat hello_ats2.dats
implement
main0 () = {
val () = println! ("Hello world!")
}
casper$ cat HelloAjhc.hs
main :: IO ()
main = putStrLn "Hello world"
casper$ cat hello_idris.idr
module Main
main : IO ()
main = putStrLn "Hello world"
### Compile
casper$ patscc -o hello_ats2 hello_ats2.dats
casper$ ajhc -o HelloAjhc HelloAjhc.hs
casper$ idris -o hello_idris hello_idris.idr
### Compare size (smaller is good)
casper$ size hello_ats2 HelloAjhc hello_idris
text data bss dec hex filename
3473 724 32 4229 1085 hello_ats2
14040 1373 528 15941 3e45 HelloAjhc
80690 968 32 81690 13f1a hello_idris
### Compare number of libraries depended on (smaller is good)
casper$ ldd hello_ats2 | wc -l
3
casper$ ldd HelloAjhc | wc -l
3
casper$ ldd hello_idris | wc -l
4
### Compare number of undefined symbols (smaller is good)
casper$ nm hello_ats2 | grep -c " U"
6
casper$ nm HelloAjhc | grep -c " U"
19
casper$ nm hello_idris | grep -c " U"
45
@master-q
Copy link
Author

Idris is not portable...

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