Pure Danger Tech


navigation
home

Lambda Lounge Launch!

04 Dec 2008

Wow! Tonight was the first meeting of the St. Louis Lambda Lounge, a brand new user group focused on functional and dynamic languages. I was hoping maybe 15 or 20 folks would show up but we had over 30 hard-core language geeks all in one room. Appistry hosted the meeting and very kindly provided beverages and food. Many, many, many thanks for all their kindness. Due to the larger than expected turnout, we started in the kitchen and upgraded to the conference room and even that was a little tight, but we all were very friendly. :)

We did some initial introductions and there were people in the room either working or interested in Java, Ruby, Groovy, Javascript, Scala, C++, C#, Perl, Python, Smalltalk, Clojure, Python, OCaml, and probably some more I missed. Over and over we heard, “I do Java during the day, but at night I hack “. Some variations on that theme were [Weiqi](http://www.weiqigao.com/blog/) saying he used “lambda-less” languages during the day, [Mike](http://codetojoy.blogspot.com/) claiming he was just there for the Bud Light, and [Matt](http://weblog.dangertree.net/) saying that functional and dynamic languages were the “rebel” languages and Java was the Empire. [Kyle Cordes](http://kylecordes.com/) made the insightful comment that 10 years ago all the language geeks were running away from these languages toward Java and now it’s just the reverse.

I had written up some features, topics, and examples of functional and dynamic languages and we kicked that around a bit. Here’s my summary. Please feel free to pick it apart yourself. :)

Functional

Characteristics

  • Functions are first-class objects
  • Data is immutable
  • Functions don’t have side effects, variables, loops?
  • Continuations

Topics

  • closures / lambdas
  • lazy vs eager evaluation
  • recursion
  • pattern matching
  • monads

Examples

  • Lisp
  • ML
  • Haskell
  • Clojure
  • Erlang
  • F#
  • Scala
  • Scheme

Dynamic

Characteristics

  • Do at runtime what other langs do at compile time: adding new code, modifying types, modifying instances
  • Dynamic typing (usually)
  • Duck typing
  • eval – generating and executing new code at runtime

Topics

  • metaprogramming
  • dynamic typing / duck typing
  • DSLs
  • categories / mixins / traits?

Examples

  • Smalltalk
  • Ruby
  • Lisp
  • Python
  • Groovy
  • Perl
  • Erlang
  • Scala?
  • Javascript

After that Matt Taylor did a great overview of categories and mixins in Groovy. Categories are defined effectively as static methods in a class, which are then made active with a “use” block in a limited code scope. If a method is not available when it’s being called, an attempt is made to match the method in the category as well.

I was struck by how similar this sounded to the extension methods proposal for Java 7. One difference is that in the Java proposal, the extra methods are declared by statically importing them whereas the activation is more obvious and explicit in Groovy due to the use { } block. I like the Groovy version a lot better. Matt also covered mixins, which can be defined for a class (affecting all prior and future instances of the class) or for particular instances of the class.

After a quick break and some last minute computer issues, Ryan Senior came up and did a walkthrough of some of the basics of Object Caml, which is a functional language from the ML family. Ryan covered some of the basics, static typing and type inference, parametric polymorphism, lazy eval, currying, and pattern matching. Lots of interesting stuff there – would love to see some of the same examples in other languages.

In talking about lazy evaluation, Ryan had a great example using log4j to explain why lazy evaluation is useful. Instead of having user code call isDebugEnabled() to avoid incurring the string concatenation for a message, lazy evaluation would allow you to call the debug method with a function that could lazily compute the string concatenation only if the string will actually be printed.

After the meeting, lots of people hung out talking about all sorts of stuff. I seem to recall some discussion on open source, the singularity, how the brain works, the future of concurrency, and more!

In all, it was a terrific night and I’m glad everyone seemed to enjoy the evening. Next month (Wed January 7th) we have Mario Aquino talking about either Android or Dashboard development in Objective-C and Mark Volkmann talking about Clojure. Should be another great evening of fascinating discussion, stop on by!