haskell - Side-effect vs non-destructive in lisp -
for example in mathematica programs generate new list every operation performed on list dramatically faster in place manipulations in list(say append, drop etc).
haskell gives new list default every operation performed on list.
i read lisp provides both facilities, creating new list every time or choosing in place manipulations in list.
but confused states in place helps in reusing same list again , hence reduces garbage. so, way effective, because seeing 2 great languages opposite.
immutable data structures let compiler reason them easier. (some zealots have argued mutable data structures crutch poor compilers. :-)
mutable structures (arrays, lists, hash tables - of them present in lisp) let 1 things easier, , let programmer micro-optimize code, not stupid when "sufficiently smart compiler" more of pipe dream now.
ps. not quite fair compare haskell , mathematica lisp belong different generations. lisp second oldest programming language still in use (after fortran) while haskell , mathematica build on 30+ years of cs research.
Comments
Post a Comment