Hacker News new | ask | show | jobs
by callmecosmas 4776 days ago
Python implementations do not have tail call optimization but that doesn't really have anything to do with functional programming.

Common Lisp has mutable data structures by default and actually I think one of the most elegant parts of CL is the setf macro http://www.lispworks.com/documentation/HyperSpec/Body/m_setf..., which is a very clean interface to changing state.

The best functional lisps to use right now would be Clojure and Racket. They both use immutable data structures by default, though neither is "pure". Clojure if you want all the good JVM bits and maybe actually convincing your manager to use it and Racket if you just want to learn using a language that's more beginner-friendly (http://htdp.org/ and the DrRacket IDE) or (mostly) compatible with Scheme (SICP, Little Schemer, etc.).

I've found there aren't really any widely used purely functional languages out there except Haskell (which needs it due to laziness).

1 comments

Purity is a false idol. CL is a functional programming llanguage. Functional as in programming with functions. Maintenance of referential transparency is the duty of the programmer. As long as you have HOFs and some form of lexical closure as basic language features, you can call a language functional. tail-call optimization, default immutability, automated structure cloning, parameteric datatypes, default currying and h-m type inference are language features that make mathematical reasoning easier, but they are neither essential nor definitive requirements of a functional programming language.
Then python is also a functional language just like cl. Except no-one calls python a functional language, and everyone seems to call cl a functional language.