views:

594

answers:

8

To begin with, I'm virtually sold on the 'whole functional language thing'. It occurs to me that, for years, I've been doing mostly functional-style programming in Java. But I'm a bit loss as to how to start a large functional app. I'd like to see the source and build structure of a large project (OSS or whatever) so that I can see how modularity is best handled in such an environment.

The context of my question is that I want to start a large JVM project and I'm currently thinking of choosing a Java/Groovy mix or a Scala/Groovy mix. I don't want to go with the Scala/Groovy mix unless I'm going in the functional direction because I don't like Scala for OO programming (a completely different topic). This means avoiding stuff like DI frameworks, AspectJ, etc. (I know I can emulate/accomplish/approve on these things with functional programming... but that's not relevant here.) I'm worried that the lack of very large publicly visible projects using these languages is due to the common argument that they really are poor for large projects, which would be a real shame...

So I ask, what large fp projects (lets say 20K+ lines) do you follow? I'd be most happy to hear of any that run in a language on the JVM. Especially if you feel they handle modularity in a good way.

+9  A: 

I'm trying to grok Erlang these days, which Scala is influenced by. I like to study the source code of yaws, which is a high-performance http server, and Wings 3D, a subdivision modeler. Very educational, the best way to learn a new language is to read it.

sunny256
+2  A: 

I know large portions of Emacs and basically all of Maxima are written in Lisp. These don't run in the JVM, but they are the top examples I can think of for large, well established, and widely used and appreciated applications written in a functional language.

280Z28
Emacs is not written in a functional style.
jrockway
+4  A: 

Emacs has lots of Lisp in it, but it is written in a very imperative style. GHC is a large project written in Haskell, and of course the OCaml compiler, etc., are written in OCaml.

Kragen Javier Sitaker
Mind you, there's a difference between Lisps. The language inside Emacs is Emacs-lisp. Common Lisp is a whole different language, which was even cast as an ANSI standard.
Leonel
+4  A: 

The darcs distributed version control system is pure haskell, i.e. pure and lazy fp. By lines of code this might not seem to be a large project, but keep in mind that haskell syntax is very dense.

ordnungswidrig
+3  A: 

There are two big open source efforts in Scala that I know of: Lift and ESME (Apache Incubator).

Though it seems Google-related new language Noop is written in Scala so far. That's likely to change when Noop becomes stable enough to compile itself.

Daniel
+4  A: 

Xmonad is a window manager written in Haskell, they have a very detailed tutorial for writing extensions.

Yogthos
The tutorial does not cover any actual programming; only using Darcs and Haddock.
jrockway
my bad here are the developer docs http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Doc-Developing.html
Yogthos
+1  A: 

It is written in OCaml and therefore does not run on the JVM, but Frama-C is a 200000+ lines project implementing a static analysis framework for C, with a plug-in architecture.

Frama-C uses dynamic loading of native code where available, but plug-ins can also always be loaded dynamically as bytecode or linked statically if you are willing to recompile the whole thing.

More information, including source code, at http://frama-c.cea.fr/ and considering the nature of your question, you might appreciate this article at ICFP 09

Pascal Cuoq
A: 

Koders, the Open source Code Search engine might be of help as it allows you to search in programming languages.

PlanBForOpenOffice