Last active

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Compare ATS2/Ajhc/Idris

View Compare.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
### 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
Owner

Idris is not portable...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.