Software has two ingredients: opinions and logic (=programming). The second ingredient is rare and is typically replaced by the first.
I blog about code correctness, maintainability, testability, and functional programming.
This blog does not represent views or opinions of my employer.

Thursday, June 27, 2013

Making Groovy more functional - Fpiglet open source

I started a new project on google code it is called Fpiglet:  http://code.google.com/p/fpiglet/
It stands for FUNctional Programming in Groovy and the 'let' is from a syntax I will try to DSL at one point.

My main motivation is to have fun with it.  I am spending my work hours dealing with very imperative code in Groovy and Grails and I often have a feeling that lots of that could be made more readable, maintainable and beautiful it it was just less OO and more FUN.

The other motivation is my perception that most (almost all developers) today miss out on one very useful concept:  function composition.  For that reason I started with supporting the concept of curried functions.

I am starting with basics:  Lazy Lists, Streams, but I also DSL-ed some syntax like if-elseif-else.
I am trying to use function composition whenever I can so my DSL is drawing heavily on curried function composition.

With DSL my goal is not to meta-program Groovy into something else.   Rather be 'gentle' and not intrusive with DSL.  My goal it so 'eat my own dog food' approach.  I also do not believe in writing super-complex hard to maintain imperative code just to expose nice interface to the outside world even if it that interface looked like Haskell.

Why the name?  I considered groovyz  but then that is just being a copy-cat and I am more motivated by Haskell these days.  GroovyH?

No comments:

Post a Comment