7 ms·
"Pleasant to use" is not benchmarkable, it is subjective. You can benchmark the speeds and figure out which one runs something faster, but it's very hard to qu
by Periodic 17y ago
"Pleasant to use" is not benchmarkable, it is subjective. You can benchmark the speeds and figure out which one runs something faster, but it's very hard to quantify what languages are the most pleasant to develop in.
Some people like OO, some people like FP. Some people like things explicit, some people want things inferred.
All these popular languages are built around various trade offs. As I understand it, the functional languages allow you to use FP for your high-level stuff, but tend to be a bit slower than C (like one order of magnitude). Ruby has a lot of flexibility and allows for rapid development, but can be very slow for some things. C is fast, but it's C.
Get what I mean? Try a few. Find a language that works the way you think.
- Tichy 17y agoOK, different attempt then: are there ANY other choices than C/C++ and Java for high performance computing? (No Fortran please, I suppose). I think there is a fundamental reason why languages with dynamic types will usually be slower than languages with static types, but some statically typed languages should be able to compete in terms of speed? I suppose that puts Scala and Haskell on the map. I am not a 100% sure about LISP - I think there are variants where static types are optional? Nitpicking aside, let's assume "pleasant to use" means "deemed cool by the HN crowd". Just give me some suggestions, then I can still decide if I agree or not. Edit: in the flawed language shootout, Haskell seems to kick ass: http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=ghc&lang2=icpp&box=1 http://shootout.alioth.debian.org/gp4/benchmark.php?test=all... I guess learning Haskell just moved up several steps on my TODO heap.
- Periodic 17y agoPlay around with the Computer Language Benchmarks Game. It's good at showing what some of the trade-offs are. Of course, it's really not very scientific, but it gives you an idea. http://shootout.alioth.debian.org/ http://shootout.alioth.debian.org/ You'll usually see C, C++, Java, Haskell, OCaml, Fortran, Scala, and Lisp in the 1-10x range (of the fastest solution). They all should be reasonably competative on most things, and so you might make your decision based on personal preference and available libraries. This is in contrast to things like Ruby, Perl, and Python which are often take 100x the time.
- Tichy 17y agoThanks - I really need to pick up one of these languages. I know Java well, but don't want to use it anymore. So far I have only tried "slow" alternatives, though. Given my interests (machine learning), sometimes speed is called for.
- camccann 17y agoC# and Ada are typically fast as well (as expected). Interestingly, Erlang and Lua seem to consistently come out a bit ahead of almost everything else that's not compiled to native code, running on a JITing VM, and/or Lisp.
- igouy 17y ago> http://shootout.alioth.debian.org/gp4/ http://shootout.alioth.debian.org/gp4/ Please choose the up-to-date measurements instead of these.
- ericlavigne 17y agoI have used two varieties of Lisp: Common Lisp and Clojure. Both have dynamic typing with optional "type hints", which allow you to get the performance of a statically typed language. Type hints are typically used only in small doses, for parts of your code that are very performance critical.
- sunkencity 17y ago>(No Fortran please, I suppose). I've got a friend who works on simulating air currents around areroplanes real-time. They have to do everything in Fortran but he says that Fortran-99 is actually pretty pleasant. Pretty pleasant compared to older fortrans perhaps :)
- rkts 17y agoHaskell does well in benchmarks but this hides the fact that its performance is very unpredictable. Try it and you'll see what I mean. Also, Common Lisp does well in benchmarks but only after a lot of declarations are added which make the code nearly unreadable. Personally I get the best results from the MLton SML compiler. OCaml is also pretty fast and more practical. YMMV.