Ask HN: Most applicable functional language to learn?
Before reading through this, I understood the concept. I understood expressiveness, no declarations, functions are data and data are functions, etc. I understand the concept and how side-effect free code creates wins, and even could see how this concept could be used for web programming.
But I'm not certain if I should keep plugging away with this tutorial, or if theres something better out there with Lisp or Scheme, and where my time is best spent.
Any tutorials that take a relaxed presentation style and try not to keep it completely mathematical (my CS set theory books bored the crap out of me and sometimes got very confusing), would be best.
Functional programming is something missing from my skill set and its beginning to bother me that I'm not slightly proficient in at least one good one.
Thanks guys!
15 comments
[ 3.5 ms ] story [ 42.9 ms ] threadDoes anyone have good links? I'm looking for a good mix of theoretical and practical application.
Learning Clojure:
The best concise intro I've come across: http://en.wikibooks.org/wiki/Learning_Clojure
You can't go wrong starting with the introductory stuff on the site: http://clojure.org/rationale
This looks like a good longer intro, but I haven't more than glanced at it: http://java.ociweb.com/mark/clojure/article.html
A longer Wikibook: http://en.wikibooks.org/wiki/Clojure_Programming
Monad tutorial (site currently broken): http://onclojure.com/2009/03/05/a-monad-tutorial-for-clojure...
And there's one Clojure v 1.0 book out, only $20 for the ebook version: http://www.pragprog.com/titles/shcloj/programming-clojure
(Note that a whole lot of learning material assumes you're coming from a Java background ... which I'm not (in fact, I learned MACLISP before C and never had a chance to go beyond C++ to C# or Java).)
Setting up your EMACS Clojure development environment (VIM and various IDEs are also supported): http://incanter-blog.org/2009/12/20/getting-started/ and http://lisp-book.org/contents/ch18.html
And there are a bunch of videos, Rich Hickey does them well; note that most of the quotes below are from someone else that I then cut and pasted into my TODO file for future reference:
Clojure for Lisp Programmers Part 1 of 2: http://blip.tv/file/1313398
Part 1 of a presentation by Rich Hickey at the Boston Lisp meeting. A fairly extensive introduction to Clojure, with a presumption of prior knowledge of Lisp. Transcript available at: http://clojure.googlegroups.com/web/clojure-for-lispers-tran...
Clojure for Java Programmers - 1 of 2: http://blip.tv/file/982823
Part 1 of a presentation by Rich Hickey to the NYC Java Study Group. A gentle introduction to Clojure, part 1 focuses on reader syntax, core data structures, code-as-data, evaluation, special operators, functions, macros and sequences. No prior exposure to Lisp is presumed.
Persistent Data Structures and Managed References: http://www.infoq.com/presentations/Value-Identity-State-Rich... (very good).
Clojure Concurrency: http://blip.tv/file/812787
A presentation by Rich Hickey to the Western Mass. Developers Group on Clojure and concurrency. Brief overview of Clojure, discussion of concurrency issues, locking, and immutabiity. In-depth look at Clojure's refs, transactions and agents. Demonstration and review of code for a multithreaded ant colony simulation.
Clojure Sequences: http://blip.tv/file/734409
An informal introductory talk/screencast covering Clojure's sequences by Rich Hickey, the author of Clojure. Covers the motivation behind sequences, their relationship to cons, iterators/enumerators and collections, the sequence library, and laziness.
Clojure Data Structures - Part 1: http://blip.tv/file/707974
Part 1 of an informal introductory talk/screencast covering Clojure's data structures by...
You should look at Clojure (http://clojure.org/), which pushes the FP aspect of Lisp hard, especially so that you can do interesting concurrency things. It's "secret sauce" is a data structure (http://en.wikipedia.org/wiki/Hash_array_mapped_trie) that pretty neatly solves the trivial update problem (changes are O(n) where n is no greater than 32 and more likely 5-6).
Upon this foundation of practical immutable data several methods for dealing with concurrency are provided, e.g. actor like "agents" (not actors since they share the same address space, but that's safe) and an MVCC STM.
And of course it's a Lisp, which might be nice if you're tired of static typing and/or complex syntax (albeit more complex than earlier Lisps since vectors, hashes and sets are first class citizens and quite a bit of normal syntax uses vectors). The Clojure community is also nice, friendly and helpful, and doing interesting things like monads which have been adopted into the official contributed library.
I highly recommend both, Clojure seems like a good choice but I've never been crazy about languages built on top of the JVM...
-- Cesarini/Thompson, Erlang ; Logan, Merritt, Carlsson, OTP in action
-- Halloway, Clojure (supposedly, besides the Manning MEAP PDF book, another Manning and a Apress book are in preparation)
-- Scala: (all 3 books out look pretty good, tho I haven't spent a lot of time digging in, and haven't decided if scala's language syntax is denser than clojure's; The Odersky/Spoon / Venners is the largest and not an easy book to get thru, but probably authoritative. The Payne/Wampler text freely available online
http://programming-scala.labs.oreilly.com/
-- haskell: Real World. content freely available online.
http://book.realworldhaskell.org/