views:

465

answers:

3

What are examples of well designed functional (as opposed to object oriented) web apps that make their source code available? I am currently studying the Hacker News source but I'd like to see some other non-trivial examples, ideally in clojure.

For MVC there are lots of Rails and PHP apps, frameworks, and tutorials to study - what is there for functional programming?

+5  A: 

There's:

That list is enough to keep you busy giving a sample of functional languages with different characteristics:

  • Clojure: multi-paradigm?, flexible? it isn't a pure functional language and although it is preferred that you program in a functional style, it isn't strictly necessary. You can write java-style OOP through the Java interop, or you can abstract away from it using multi-methods. There's a lot of flexibility there, although it is still a little early to say whether it is just "flexible" or "multiparadigm" in the way common lisp is. Designed, in part, to be a lisp that handles concurrency easily, it actually shoots at a lot of targets, hence the flexible or multiparadigm designation.
  • Scheme: Closer to being a pure functional language than Clojure, it pushes the programmer a bit more forcefully into a functional style than does Clojure.
  • Erlang: Functional programming built for reliable concurrency. Erlyweb is built on a platform that is designed to be highly concurrent.
  • Smalltalk: Highly OO functional programming (even control structures are objects within the object system, and not syntactic constructs).

If you want to see how webapps look in a language that is functional "at all costs", then the jrockway's suggestion is the one to look at.

Pinochle
For an introduction to the PLT Scheme web server, have a look at http://docs.plt-scheme.org/continue/ .
Eli Barzilay
Could you please explain why the PLT Scheme Webserver and Seaside are listed here? Are their implementation good examples of functional programming?
Vijay Mathew
Pinochle
Well, as far as I understand, continuations have got nothing to do with functional programming.
Vijay Mathew
http://en.wikipedia.org/wiki/Continuation Continuations are the way that functional programming language can grant access to the stack. They are the functional equivalent of goto statements. Of course, this all depends on what you mean when you say 'functional' and it is possible to restrict the meaning of this word to such an extent that nothing is 'functional' but a very restricted set of phenomena. Whatever floats your boat. It must be recognized, however, it is a question of perspective and most people will look at continuations as features of 'functional' languages.
Pinochle
http://snapframework.com - a functional, high performance framework in Haskell
Dan
+1  A: 

If you are looking for real-world open source projects implemented in a pure functional language, this link might help: http://haskell-news.blogspot.com/2008/01/top-10-most-popular-haskell-programs.html

If you are very specific about web applications, please look at this: http://www.haskell.org/haskellwiki/RPC

Vijay Mathew
+2  A: 

Weblocks is a proven object-oriented functional framework that takes inspiration from Seaside.

It's written in Common Lisp, and two basic examples (weblocks-demo, simple-blog) can be found here: http://bitbucket.org/S11001001/weblocks-dev/src/tip/examples/

skypher
but it is not functional, see the question above
Rainer Joswig