4 ms·
An oldie but goodie. This helped explain a lot of the often-praised features of Lisp and functional programming that had never made sense before.
by pchristensen 17y ago
An oldie but goodie. This helped explain a lot of the often-praised features of Lisp and functional programming that had never made sense before.
- mace 17y agoOlder post: http://news.ycombinator.com/item?id=127736 http://news.ycombinator.com/item?id=127736
- projectileboy 17y agoDitto. Thanks to the RethinkDB guys for doing these all those years ago...
- eru 17y agoYes. However keep in mind that Lisp has left the forefront of functional programming mostly to ML derived languages. Common Lisp isn't even very functional. Not much more than e.g. Python. Scheme is a bit more functional oriented.
- samatman 17y agoClojure, OTOH, is beautifully functional. Also, it is supported by NetBeans and Eclipse, so no SLIME needed.
- eru 17y agoYes, I forgot about Clojure.
- ced 17y ago> Lisp has left the forefront of functional programming mostly to ML derived languages I'd be grateful if you could expand upon that statement. I'm a Lisper, and half the time I see one of these Haskell articles, I wonder if there really is a there there. For sure, functional programming can be a whole lot better than CL or Scheme, but I'd like to know if the difference is significant.
- eru 17y agoDepends on what you want to achieve. If you leave out the dimension of static vs dynamic typing, you could get most of Haskell's benefits by making your Scheme pure, and confining side-effects. (Monads are one solution for this, but not the only one. Have a look at Functional reactive programming, or see how Clean uses linear typing.) You could probably hack most of the pureness stuff together with macros in an already existing Scheme. Purity by (strong) default makes it easier to combine your programs. Lazyness can help, too, but I am not completely sure whether you should make lazy the default. Chris Okasaki's "Purely Functional Data Structures" argues for needing both lazy and strict evaluation to guarantee asymptotic run times. Have a look at, say, Software Transactional Memory to see what purity can buy you. Combinatorial parsers are another interesting application in Haskell; however they should be easily implementable in Scheme, too. Please have a look at how http://www.cs.kent.ac.uk/people/staff/smk/redblack/rb.html http://www.cs.kent.ac.uk/people/staff/smk/redblack/rb.html uses the type system to statically guarantee the balance of red-black trees. Please pardon that I mostly talked about the `how' and not so much the `why'. I hope giving some examples might not totally be in vain.
- pchristensen 17y agoI know. The article covers both (or did I mix it in with another of coffeemug's articles?). But coming from C# 2.0, Lisp's functional-supported-but-optional was still a big jump.
- eru 17y agoYes. Lisp is an acceptable functional language, and its communities also value functional approaches. (Whereas Python gives you almost the same support from the language, but much less from the communities and libraries. (My main grief is that dicts only have side-effecting operations.))