5 ms·
The Rust code is both safer and faster at the cost of more keystrokes. I'm not certain the point of writing unsafe code in Haskell when there are better tools
by jakevn 12y ago
The Rust code is both safer and faster at the cost of more keystrokes.
I'm not certain the point of writing unsafe code in Haskell when there are better tools for the job. Haskell is fast enough as is and using it to hammer screws just reeks of wrong tool for the job.
- imanaccount247 12y agoYour comment says absolutely nothing, and that appears to be the goal. What is the point of writing any code in any language? It is a benchmark, the point of it is to write the fastest code you can. You aren't obligated to write lower level code in haskell, nobody has a gun to your head. So why do you pretend it is a problem, and claim other languages are "better tools" for that job despite haskell clearly being very good at that job?
- igouy 12y ago>>It is a benchmark, the point of it is to write the fastest code you can.<< The point of it is to show the performance differences, but that doesn't exclude a program like -- http://benchmarksgame.alioth.debian.org/u64q/program.php?test=meteor&lang=ghc&id=4 http://benchmarksgame.alioth.debian.org/u64q/program.php?tes... -- or like -- http://benchmarksgame.alioth.debian.org/u64q/program.php?test=spectralnorm&lang=ghc&id=2 http://benchmarksgame.alioth.debian.org/u64q/program.php?tes... etc
- imanaccount247 12y agoIt doesn't exclude "idiomatic" versions, but the data is presented so as to make them useless. How do I compare "idiomatic" rust to "idiomatic" haskell? All you can get is "here's the fastest versions from each language". If you want to compare any other version you have to do it on an individual basis, one at a time. So there's absolutely no reason for people to bother adding "idiomatic" versions.
- igouy 12y ago"Idiomatic" in whose opinion? "Idiomatic" is a slogan not a well-defined property. The reason for people to bother adding "idiomatic" versions, is that other people really do work through looking at the source code "on an individual basis, one at a time."
- platz 12y agoThis exact thread came up last year when we started talking about the shootout and haskell. And Its always the same people who bring up the shootout and defend the existing entries. Please stop bringing up the shootout (esp when haskell is mentioned) and dragging everyone through this conversation again. Benchmarks are great to debate but this one is causing more harm than good; let's talk about other benchmarks.
- igouy 12y ago>>Please stop bringing up the shootout…<< I didn't! Your accusation is completely wrong! (And it hasn't been called that for over 7 years.)
- imanaccount247 12y ago>"Idiomatic" in whose opinion? That's the point I'm making. People constantly dismiss the results they don't like as "unidiomatic" and embrace they ones they do as "idiomatic". >is that other people really do work through looking at the source code "on an individual basis, one at a time." Except that people don't bother adding them, so your reasoning for why isn't relevant. If you want to claim the shootout is useful for this, you need to allow for grouping benchmarks together to be presented against the "standard" ones. Let Bob and Sally submit "Bob and Sally version of Foo benchmarks" and let me compare them against Foo and against other languages.
- igouy 12y ago>>Except that people don't bother adding them …<< I already provided links to two programs and you're still saying that people don't bother adding them.
- codygman 12y agoAs 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!