An Architect's View

CFML, Clojure, Software Design, Frameworks and more...

An Architect's View

Lambda Jam 2013

July 14, 2013 · 2 Comments

The first annual Lambda Jam (US) conference was held at the extraordinarily beautiful Intercontinental hotel in downtown Chicago, a few blocks from the lake. Lambda Jam was unusual in a couple of ways:

  • First off, it specifically targeted a broad range of functional programming languages - and only functional ones;
  • Second, it aimed to be much more hands on than normal conferences by having regular "lecture" sessions only in the morning and turning the whole afternoon over to workshops and "jams".

Overall, I thought Lambda Jam was excellent! We got a broad range of languages well-represented, we got a good mix of intermediate to advanced material (with a couple of sessions bordering on introductory as a way to explain the "why" and/or "how" of some particular language). I got the impression the workshops were a bit variable but I got a lot out of both of mine and heard some very high praise for most of the others. The jams also seemed to be a lot of fun, with folks working in teams - and not always in their "home" language - to tackle some interesting problems that they took turns to present to the group. I'd definitely say that the hands on "experiment" was successful.

My primary goal for the conference was to learn some other functional languages so I somewhat deliberately avoided the Clojure content, signed up for workshops on F# and Erlang, and made an effort to meet / hang out with new people. This was, after all, a vacation for me, with flights covered by air miles and a Sunday night red eye chosen to cut down on hotel costs! I came back exhausted, having made a lot of new friends, many of them outside of my normal "crowd". I was extremely impressed with F# and quite intrigued by Erlang so it was also a "success" for me!

  • Data, Visibility, and Abstraction - Stuart Sierra
    • Stuart kicked us off with an interesting trip down memory lane as he explored languages he'd worked with and what he liked and disliked about them, and the path that led him to Clojure. He liked clean, clear data structure representations and manipulations; he liked visibility into code structure - and into errors when things went wrong; he was positively influenced by Perl; he found C++ had a real lack of visibility, especially when things went wrong. An interesting and somewhat unusual discourse. His talk was recorded so keep an eye out for it.
  • Simile-Free Monads - Aditya Siram
    • I keep going to monad talks because I know they're important and I want to understand them. Almost every talk I attend gives me a little bit more insight. This talk was intended to strip away a lot of the mystique and just present three or four bare monads in a real world context, using Haskell as the exposition language. In some ways this was both the most straightforward talk on monads I've ever attended and at the same time one of the most obtuse and incomprehensible. I think my main problem here was that I'm not familiar enough with Haskell to understand why you'd do things this way so it just looked like a complicated way to do something simple.
  • Let It Crash - Tristan Sloughter
    • A good introduction to the whys and wherefores of Erlang, it's history, and how it is used at Heroku for very high throughput, fault tolerant things like request routing and logging. I was very interested to learn that the heap and associated garbage collection in Erlang is per (lightweight) process - unlike the JVM where there is a single huge heap and GC process shared by all the processes / threads running there. It set the scene nicely for the Erlang workshop I had signed up for on day two.
  • Workshop: Try F# from Zero to Data Science - Rachel Reese
    • We used the Try F# web site to learn and explore the language. This was good insofar as we didn't need to install anything, but bad when we had network problems or when the site actually crashed on us for a short while in the middle of the workshop! Rachel structured the workshop to follow three of the online tutorials with some additional challenges for us to try at various points, and encouraged us to work in pairs, as well as keeping things nice and interactive. We got the basic syntax out of the way quickly and moved on to charting a number of data sets. I had a bit of a fail on the statistics section of the workshop but we quickly arrived at the coolest - and most impressive - part: Type Providers. F# is a strongly typed, statically typed language with solid type inference so it's very concise but also helps you avoid a lot of coding errors while you're exploring because the type system allows the editor - even on the web - to provide you with live insight into the data structures you're working with. Type Providers are dynamically created, strongly typed wrappers around (large) sets of data fetched from various places, such as third party websites, databases and so on. We worked with a couple of providers but mainly focused on the World Bank data set which provides all manner of raw statistics about most countries around the world over varying periods of history. This allows you to do some pretty amazing data manipulation in just a few lines of code:
      // load World Bank Type Provider:
      #r "Samples.WorldBank.dll"
      // get the initial data context:
      let data = Samples.WorldBank.GetDataContext()
      // get a sequence of:
      //   pairs of:
      //     country name
      //     gas price for 2010 (or zero if it is missing):
      let countryGas = seq { for c in data.Countries ->
                               c.Indicators.``Pump price for gasoline (US$ per liter)``.GetValueAtOrZero(2010) }
      Once we have that data, we can easily find the country with the most expensive gas that year:
      let maxPrice = countryGas |> Seq.maxBy snd
      We get a pair of "Eritrea" and 2.54. We can also create a bar chart of the top ten most expensive countries:
      // sort by gas price descending (by negative gas price)
      // and take the ten most expensive:
      let top10 = countryGas |> Seq.sortBy ( snd >> (~-) ) |> Seq.take 10
      // draw a chart:
      ( top10 |> Chart.Column ) .WithLegend()
      Apart from the statistics-induced angst, I really enjoyed the workshop and I really liked what I learned of F#. It's a very nice, clean language and if I was planning to work on .NET (or Mono!), it would be my language of choice. Huge kudos to Rachel for a fun, challenging and well-run workshop!
  • Keynote: Systems that Run Forever Self-Heal and Scale - Joe Armstrong
    • Wildly entertaining keynote from the creator of Erlang about the challenges behind creating highly available, highly scalable, complex systems of collaborating processes. Erlang, created back in the mid-80's, succeeds by running completely counter to most other languages in terms of how errors are handled: instead of coding defensively and trying to trap (and sometimes handle) every error you can think of, you just program the "happy path" and let your process fail fast when things go wrong. Because the Erlang virtual machine and process infrastructure is managing your graphs of linked processes, when a process fails, the system can quickly kill off and restart parts of the graph that experienced the failure.
  • Clojure Birds of a Feather
    • Despite avoiding Clojure during the day, I was drawn to this informal session in the evening because it was going to cover the newly released core.async library, inspired by channels and asynchronous blocks in the Go language. The real "wow" moment came from David Nolen as he showed a browser app that tracked keystrokes and mouse movements (as would be needed in a game), built using core.async and ClojureScript (compiled to JavaScript). The code was elegant and expressive - and needed no callbacks due to the way blocks can park and resume asynchronously!
  • Distributed Programming with Riak Core and Pipe - John Daily
    • Kicking off day two, I went to another Erlang talk. Unfortunately, since we'd already had the introduction and background in Tristan's talk, followed by Joe's deeper insight into the concepts behind Erlang, the first half of John's talk was a bit redundant and so he was just getting into the meat of the Riak Core library when his forty minutes ran out. I suspect Riak Core and Pipe would have been very interesting if John had just jumped in but he tried a bit too hard not to lose anyone in the material.
  • Semantics, Clarity, and Notation - Tracy Harms
    • This was an odd presentation. The session description sounded interesting albeit very conceptual but it was rather more navel-gazing than I had hoped. I don't think the choice of the J language (it's APL in ASCII - here's an example of J in action) helped Tracy's cause: J is certainly a very pure notation (I did APL back in the 80's so I appreciate the power and conciseness) but it appears like so much line noise that it really distracts from any talk that is intended to focus on clarity and meaning. In some ways, this talk represents the very worst in the FP world that puts a lot of people off: dense, academic and a very dry delivery, of something that has no obvious application to people's day to day work. And that's a real shame because I think the underlying message Tracy was trying to get across was a valuable one.
  • QuickCheck - Joseph Wayne Norton
    • With day two not going particularly well, I had lowered my expectations by the third session but was pleasantly surprised. I'm familiar with the concepts of QuickCheck but hadn't seen the Erlang version before. I didn't get much out of the session but it was a very well executed introduction to the principles and benefits of automated property-based testing - so it was exactly what it said on box, nicely delivered.
  • Workshop: Building Applications in Erlang - Garrett Smith
    • I'd made sure to install Erlang on my laptop, and got erlang-mode working in Emacs, and Garrett had confirmed on Twitter that was all I needed. Unfortunately, the workshop followed the E2 Project tutorial and I was using a Windows laptop and they don't really go well together so the first hour of the workshop was an exercise in frustration. Coupled with that, Garrett didn't really make things very interactive and said we could either type along or just watch so at that point I was pretty annoyed I'd spent $50 on this... but then I figured out how to get a reasonable workflow running on Windows (working around some shortcomings of "make" and "rebar", having to run "make shell" in a command window rather than rely on erlang-mode to run a shell, and using make:all([load]). manually). Once I'd conquered that, I was able to catch up and keep up with Garrett as he worked thru the tutorial and explained each piece of it. At the end of three hours, I had a database service running, and a telnet server linked to it, so I could connect in (via PuTTY!) and run GET key and PUT key value - all written in Erlang! Oh, and I had the application monitor up so I could randomly kill parts of the system and watch Erlang automatically restart processes! So, in the end, definitely worth $50, but I really would have liked it to be a lot more interactive.
  • Keynote: Programming for the Expression of Ideas - Gerald Sussman
    • Jerry is something else... You'll have to watch the video to get the full effect but the TL;DR version is that creating representations of models in code can shine a light on ambiguity and help you achieve clarity in the expression of concepts. As always, Sussman was provocative and insightful - but all that mathematical formula notation!! Ouch, my poor brain!
  • Functional Mobile Applications in F# - Adam Granicz
    • Day three and back to F#. Compiling to JavaScript is becoming pretty popular these days: CoffeeScript, TypeScript, ClojureScript. I learned that F# can also be compiled to JS, via FunScript or WebSharper. The latter is a (free) product offered by Adam's company but he soon overcame any marketing or commercial objections I might have to a potential product pitch. WebSharper provides automatic management of JS resource loading and type-safe integration with a number of JS libraries. Adam showed a couple of application examples that were F# all the way down but compiled to JS on the front end or .NET bytecode on the back end, with RPC calls as necessary between them. The approach is very clean, with a focus on composability. I'd already been sold on the idea of building mobile applications using JS/CSS rather than a native approach, but the simplicity and cleanliness of F# top-to-bottom was an eye-opener.
  • Protocols, Functors and Type Classes - Creighton Kirkendall
    • This was a fascinating talk about abstraction and extensibility, couched in a comparison of four languages - Clojure, Ocaml, Haskell and Scala. When you have a mismatch between a data format and a library, the OOP way is the wrap the data in a new object so the library can process it, but the FP way is to extend the library to support the data natively. Creighton showed how various functional languages provide a way to extend libraries to allow new types of data to be processed. In Clojure, we can use protocols, in other languages, other type-based solutions are available. It was very instructive to see the same overall approach in four languages and it really brought home the differences between OOP and FP. As an aside, I have more notes from this session than any other, over the three days, as I found the side-by-side language comparisons to be absolutely fascinating!
  • Journey to the Heart of For-Yield - Kelsey Innis
    • This was a wonderful presentation and quite unlike any of the others I attended: Kelsey started out with an assumption of an imperative approach to a basic problem and showed us an evolution of both expressiveness and concision along with complexity. We moved from a simple imperative loop to a simple for yield to nested loops to combinations of list and optional values. It was a very compelling argument for a functional approach. It was nice to see some of the new features in Scala 2.10, as well as seeing both "monads" and "applicative functors" slipped in quietly behind the scenes. Way to go, Kelsey!
  • Jam!
    • None of the day three workshops had really grabbed my attention so I planned to take part in the free programming "jam" session. Unfortunately, I was enjoying lunch a little too much and lost track of time so I was about half an hour late getting back to the hotel and missed too much of the background for the jam to feel like catching up. It looked like a lot of fun: everyone had broken up into small teams to solve a maze generation problem in various languages, with two algorithms on offer, and then several groups presented their solutions in the final section. As with Creighton's session, it was very interesting to see the same problem solved side-by-side in different languages.
  • Keynote: Everything I have Learned, I Learned from Someone Else - David Nolan
    • Closing out the conference, David showed us how much inspiration we as engineers can draw from research papers. David's probably most well-known for core.logic and his tireless work on ClojureScript. He talked about how core.logic came about, inspired by academic research, and what we can learn from the wealth of published research - especially when there opportunities to engineer real world software based on the solutions outlined in that research. It was a good way to finish off the three days!

Did Lambda Jam satisfy my goals? Yes, I learned quite a lot about Erlang and F# (through five sessions and two workshops), as well as a little more exposure to Haskell, Scala, and Scheme - and seeing J for the first time - and I also had fun socializing with people outside my usual community (particular kudos to the F# crowd who were awesome to hang out with on Tuesday!). Will I attend next year? Hell yeah! So a big thank you to Alex Miller for putting this together, along with The Strange Loop and Clojure/West!

Tags: clojure · programming

2 responses so far ↓

  • 1 David Grenier // Jul 14, 2013 at 7:32 PM

    "with RPC calls as necessary between them."

    I think that's more like the cherry on the cake rather than a necessity. You can still create rest urls and gather your data and wire that up in a jQuery ajax call but why would you want to do that?

    I wonder if anyone could come up with the possibility of having client-side code call server-side method directly without any http boilerplate, all type checked without a yourlang-to-JS compiler. That's the beauty of it!

  • 2 george // Jul 15, 2013 at 8:58 AM

    Great report, thanks!

Leave a Comment

Leave this field empty