haskell - haskellformac , why use 'runhaskell' command? -


reading http://blog.haskellformac.com/blog/running-command-line-programs :

this requires installing haskell mac command line tools outlined in previous article. tools include command named runhaskell, runs haskell program in "script mode" — i.e., being interpreted, instead of compiled (much like, say, python interpreter runs python script).

why provide tool run haskell in script mode ?

as code being interpreted mean run slower in script mode ?

yes, run slower, depending on application may not matter @ all. many interesting tasks don't in fact require lot of computations, wouldn't notice runtime difference between, say, java , ruby, though latter considered have worse performance.

for such quick-run applications, what's rather more important startup time. interpreted languages, pretty immediate, whereas recompiling script can take considerable time. so, interpreting can indeed faster compiling, in practise!

furthermore, because script interpreted doesn't mean every single computation is. in fact, of critical stuff defined in libraries are compiled , called interpreted code – single reason why languages python or matlab can competitive in scientifc computing: computationally intensive routines written in compiled c or fortran, not top-level language itself!

haskell gives advantages of both worlds (fast raw performance of compiled language; quick usage , conciseness of interpreted one), without need have 2 different languages – can choose parts run compiled , merely interpret!

(this not unique thing haskell – there exist in fact interpreters pretty compiled languages. only, it's not common run code interpreted except debugging. haskell turns out well-suited scripting tasks might written in python or bash, nobody bother procure entire java or c++ project for.)


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -