3 ms·
As an aside, if your interested in safer and faster I'm benchmarking some of the ATS2 code examples[0] which were created for (but not yet in[1][2]) the compute
by codygman 12y ago
As an aside, if your interested in safer and faster I'm benchmarking some of the ATS2 code examples[0] which were created for (but not yet in[1][2]) the computer language benchmarks game. It seems to beat C and C++ in some (many?) cases and create TINY binaries. I was trying to benchmark all the examples but got tired of doing it ;) Here are a couple anyway:
Pidigits:
$ patscc -I/home/cody/sources/ATS-Postiats-contrib/contrib -pipe -O3 -fomit-frame-pointer -march=native pidigits.dats -o bin/pidigits.ats_run -lgmp
$ gcc -pipe -Wall -O3 -fomit-frame-pointer -march=native pidigits.c -o bin/pidigits.gcc_run -lgmp
$ time ./bin/pidigits.gcc_run 10000 > /dev/null
real 0m0.969s
user 0m0.963s
sys 0m0.004s
$ time ./bin/pidigits.ats_run 10000 > /dev/null
real 0m0.972s
user 0m0.968s
sys 0m0.004s
$ ls -larth bin/pidigits.*
-rwxrwxr-x 1 cody cody 15K Dec 13 18:59 bin/pidigits.ats_run
-rwxrwxr-x 1 cody cody 14K Dec 13 18:59 bin/pidigits.gcc_run
k-nucleotide:
$ g++ -c -pipe -O3 -fomit-frame-pointer -march=native -std=c++0x k-nucleotide_gpp3.c++
$ $(PATSCC) -DATS_MEMALLOC_LIBC -pipe -O3 -fomit-frame-pointer -march=native -std=c99 k-nucleotide.dats
$ patscc -DATS_MEMALLOC_LIBC -pipe -O3 -fomit-frame-pointer -march=native -std=c99 k-nucleotide.dats
$ time ./k-nucleotide_gpp3 < ~/Downloads/knucleotide-input.txt
real 0m0.177s
user 0m0.300s
sys 0m0.055s
$ time ./k-nucleotide < ~/Downloads/knucleotide-input.txt
real 0m0.056s
user 0m0.036s
sys 0m0.020s
$ ls -larth k-nucleotide k-nucleotide_gpp3
-rwxrwxr-x 1 cody cody 38K Dec 13 19:07 k-nucleotide
-rwxrwxr-x 1 cody cody 96K Dec 13 19:07 k-nucleotide_gpp3
[0]: https://github.com/githwxi/ATS-Postiats-contrib/tree/master/projects/MEDIUM/SHOOTOUT/ATS2 https://github.com/githwxi/ATS-Postiats-contrib/tree/master/...
[1]: https://alioth.debian.org/forum/forum.php?thread_id=14942&forum_id=2965&group_id=100815 https://alioth.debian.org/forum/forum.php?thread_id=14942&fo...
[2]: https://groups.google.com/forum/#!topic/ats-lang-users/QdwKpqUnJUY https://groups.google.com/forum/#!topic/ats-lang-users/QdwKp...
- jakevn 12y agoI don't know much about ATS, but you've given me reason to investigate. Thank you!