About Ulf Wiger

CTO of Erlang Training & Consulting. For personal ramblings, see http://ulf.wiger.net/blogspot/. Find me on Twitter as @uwiger or send an email to ulf . wiger (at) erlang-consulting . com

Bye U.S., on to Australia

Finishing up a whirlwind tour of the US West coast (QCon SF, Erlang Factory Lite LA, and a Cognitive Modeling workshop in Scottsdale), I am now waiting for a delayed BA flight at the Phoenix airport. Although I’ve spent as many days flying as I have on US soil, it’s been a great trip.

YOW 2010 Australia

Still, I can’t wait to get home and spend some time with the family. Soon, I’m off again. This time to Australia and YOW 2010. I will give a talk on Erlang, and also give two one-day tutorials on Erlang and OTP. I hope to see many new faces there. Come loaded with your trickiest questions, and I will do my best to answer them.

Gearing up for the experience Down Under, I joined my brothers in forming a Movember team. Movember is a great Australian initiative to raise funds funds and awareness for men’s health, specifically prostate cancer and depression in men. All you have to do is to grow a mustache during the month of November, and invite friends to make a donation (clicking that link, you can also judge how my mo is coming along).

Erlang.org traffic no longer exponential

Bjarne Däcker, who has been tracking download and web site statistics on erlang.org for years, just produced a new graphic.

Visits to http://www.erlang.org up to March 2010

Visits to http://www.erlang.org up to March 2010

For years, the erlang.org graph has been nicely exponential. This latest peak seems to break the pattern. It will be interesting to see what follows.

(Update: Looking closer at the graph, it appears to stretch as far as to March 2010. I changed the caption, but left the URL unchanged.)

(Update 2: Closer inspection suggests that this is indeed measurement error. Google analytics, which also takes mirrors into account, reports a steady, but decidedly less dramatic, rise. The number of visitors to erlang.org is now at ca 80,000/month, up from ca 57,000/month in September 2008.)

QCon 2010 Concurrency Track

I will be hosting the “Concurrency Challenge” track at QCon 2010. The speakers list is now ready with all titles and abstracts in place.

QCon 2010 London

I am quite pleased with the mix and the dignity of the speakers. One of the things we wanted to highlight is that there is no one-size-fits-all concurrency model, and it’s time for us to start being a little bit more specific about what kind of concurrency we have in mind.

Each setting brings its own set of challenges, and in this track, you can expect to get a good orientation from some brilliant people, who know how to tell a story and are not afraid of offering their opinion.

Øredev 2009

I made a quick stop at Øredev in Malmö on Friday Nov 6.
It seemed like it would have been a fun place to spend the week, but alas I was too busy to do more than just come in, give my talk, and go home again (getting up 4am London time to make it in time…) I did manage to catch Stuart Halloway’s talk on Clojure and had some good discussions.

Here is a copy of my slides

Erlang User Conference 2009 – In the Wild

About a month to go now to the 15th Erlang User Conference in Stockholm.
For the first time ever, the conference is arranged by someone other than Ericsson, namely Erlang Training and Consulting Ltd. In fact, it is also the first time since 1998 that the conference is held outside Ericsson premises. Then, it was held at Van der Nootska Palatset for reasons I no longer recall (I guess we wanted to spice it up a little).

This year, it will be at the Astoria in the center of Stockholm. The reason this time is clear: the EUC has outgrown the largest lecture halls at Ericsson. With a month to go, we have more than 200 registered participants, and we are now investigating what the maximum capacity of the Astoria is, to see how many more we can squeeze in.

Another difference this year is that the speaker roster filled up in no time! We now have 14 talks, which is a busy program for a one-day conference! You have every chance to make EUC week an intense learning experience, with courses on Nov 9-11, the EUC on the 12th and on the 13th either a hackathon hosted by Klarna or ProTest tutorials in Älvsjö south of Stockholm. Add to this the chance to meet people like Tom Preston-Werner, founder of Github, Rusty Klophaus, father of Nitrogen, and the members of the Erlang/OTP development team.

There is still time to register.

Concurrency Track at JAOO 2009

I had the pleasure of being invited to sit on the Expert Panel in the Concurrency Challenge Track at JAOO 2009 in Aarhus. JAOO is an impressive event, and the venue was very pleasant. Unfortunately, I didn’t have time to experience the surroundings or indeed the conference, except for the Concurrency track.

I did catch Simon Peyton Jones’ keynote speech in the morning. Simon is always entertaining, and as part of my background project to learn Haskell through osmosis, I wouldn’t miss a talk on Haskell type classes.

A large music auditorium is not the best for technical talks, though. I have had the experience of singing on such a stage, in which case the blinding spotlights can even have a focussing and reassuring effect. But for a technical talk, you really want to see the audience and sense whether they understand you. When singing you can’t well stop and ask ‘are you with me so far?’, so it’s better to just press on and do your thing – not always the right strategy for a tech talk. Simon, being a master of the podium, simply walked to the edge of the stage, shaded his eyes and asked the audience to wave as evidence that they understood. You don’t just learn Haskell when he is talking.

The Concurrency track was well stacked, with Brian Goetz, Kresten Krab Thorup, Dave Thomas, Rich Hickey and Simon P-J as speakers, and me joining them on the panel.

Brian Goetz gave the obligatory “Free lunch is over” talk, explaining the reasons behind the current multicore trend. I’ll admit that I haven’t been to that many commercial conferences, but my former employer Ericsson had both the foresight and resources to arrange many seminars over the years, inviting leading experts from Sun, Intel, SICS et al, to ensure that every software developer in the company got the message loud and clear. I assume that many have been exposed to similar indoctrination. But it is necessary, and most of all interesting – at least to all who thrive on challenge and new opportunities. Brian kept a good pace, making sure to repeat the key points regularly to make sure they sunk in.

Kresten and Dave played tag and gave an overview of actor-style modeling. Kresten managed to demo how awkward (albeit doable) it is to work with actors without appropriate syntax, and how nicely it could be formulated with the right syntax. An important point, I think, as I firmly believe that we tend to be much more affected by the mental cues built into the language syntax than we perhaps realise. I overheard parts of a discussion at breakfast about whether languages should “lecture us” on the best way to write software, or whether it should simply get out of our way as much as possible. I personally prefer opinionated languages, and my experience with use of Erlang (a very opinionated language) in large commercial projects has reinforced that view.

Dave accounted for some of his experiences with modeling concurrency with actors, drawing on human analogies. I grew fond of this style of modeling while working with Command & Control systems in Alaska. It’s tempting when trying to automate something to become a bit too theoretical and conceive strategies that look nothing like what humans would choose if solving the problem manually. My mentor back then, Col John (Shep) Shepherd, was a retired Air Force Colonel, former fighter pilot and AWACS Commander. He had no training on computers, but knew exactly what he wanted from a Command and Control system. And, like most who have not only trained for, but also seen combat, he had a fairly dramatic view on the consequences of failing to meet the requirements. Simple and intuitive strategies were favoured over the esotheric, and the results were nothing less than astounding.

Dave also mentioned a background in Command and Control, but we didn’t have time to compare notes in this regard. Some other time, maybe…

I will not say much about the panel, but the main criticism seems to have been that we did not disagree enough. Perhaps a few die-hard C++ and threading experts would have spiced it up a little? As it was, all members of the panel were advocates of functional programming and immutable data.

The afternoon session continued with Rich Hickey talking about Clojure’s strategy for handling values that change over time. A very well thought-out lecture with some very important lessons. Talking to some members of the Clojure Users’ Group in Denmark, it appears as if Rich’s approach works very nicely in practice too.

Simon Peyton-Jones ended the track with a talk on nested data parallelism in Haskell – one of his favourite research projects. A great talk. In the words of Ola Bini: “Neat, geeky stuff.”

Erlang Factory drawing near

I’ve had time to digest the impressions from the Bay Area Erlang Factory, and now it is time for the London version.

University: June 22nd – June 24th
Conference: June 25th – June 26th

It was quite a thrill to sense the energy of the Erlang community in the U.S. When Americans grab hold of something, they don’t do it by half. Being part of the “old guard”, as someone put it, I find it extremely refreshing that people pick up Erlang simply because they think it’s a great tool, supported by a great community. I’m certain we’re only seeing the beginning of what looks to be a fun ride.

Erlang Factory London

Those of you who couldn’t come to Palo Alto, please sign up for the Factory in London. It is going to be a great conference.

Kenneth Lundin, head of the Erlang/OTP team, will be there – a rare chance to get the information straight from the source, and to offer feedback in return.

I am also eager to listen to keynote speaker Simon Peyton-Jones, talking about the two childhood friends, Haskell and Erlang. Simon is a great speaker, and one of the great thought leaders of the functional programming community.

QCon London – Good Fun

I had great fun at QCon. This was one of my first “commercial” conferences – I’ve mainly frequented research conferences like ICFP and POPL before, partly because Erlang has enjoyed little commercial interest in the past.

I enjoyed Steve Vinosky’s account of the conference, as well as Ola Bini’s. I also enjoyed Steve’s talk on RPC, and Paul Downey’s on standardization in the Historically Bad Ideas track. And of course, listening to Sir Charles Anthony Hoare was a great treat. I’m a long-time fan of Hoare’s and warmly recommend his Turing Award Speech, “The Emperor’s Old Clothes”. There are some great lessons in there.

On Thursday, I stuck with the “Functional and Concurrent Programming Languages Applied” track, hosted by my friend and colleague Francesco Cesarini. When speaking in a track, I want to have heard the talks before mine, and also want to stay to hear the remaining talks.

This time, I was preceded by Rich Hickey’s talk on Persistent Data Structures and Managed References in Clojure. I was greatly intrigued by this talk and made a note to take a closer look at Clojure. Interestingly, Rich stressed that Clojure Agents are not actors a la Scala or Erlang. Part of my talk was to illustrate how Erlang processes are not “fibers”, and trying to use them for data-parallel algorithms can be problematic. Nice setup.

Friday ended with a few quick beers with Rich, Steve, Paul and Joe Armstrong, and then dinner at Francesco and Alison’s with Joe and Steve. Francesco is a great cook!

(Didn’t notice that Paul was taking pictures though. Judging by the angles, he was shooting from the hip…)

I'm speaking at the Erlang Factory

I’ll give the same talk at SF Bay Area Erlang Factory, April 27-29. I’m really looking forward to this conference. It should be the greatest Erlang conference yet, and I hope to see you there.

Sourdough on the rise

A major Swedish newspaper had a feature about sourdough today. Apparently, it’s becoming quite popular, with more and more small bakeries selling exclusive sourdough bread and giving courses on how to make your own sourdough.

Just having returned home from QCon in London, where there were some great talks about, and significant interest in, functional programming, I’m reminded of my own keynote from the ACM SIGPLAN Erlang Workshop in Tallinn 2005. It was called “Sourdough and Erlang”, and as much as I would like to flatter myself by calling it “prophetic”, I’m sure it would just tempt others who were there to propose some other, more fitting descriptions. I feel this is as good a time as any to finally release the slides. Perhaps it’s at least good for a few laughs. I still think that “stalking the wild yeast” is an outstanding metaphore for creative software development, though…

Micro-fiddling with erlhive

Every once in a while, my thoughts touch upon erlhive. While it may seem that the project isn’t going anywhere, I’m still pretty comfortable with it. It’s not as if I started it for the money, anyway, and the problems it addresses are real and interesting.

Someone mentioned to me that erlhive had been dismissed in a discussion with the argument the benefits are not worth a throughput of 50 pages per second.

I’m not sure where the 50 pages per second comes from, and in honesty, I’ve cared so little about performance that I haven’t benchmarked it myself. So, just to satisfy my curiosity, I ran a little speed test…

I chose to benchmark only the blog back-end, partly because erlhive (oddly enough for a “web framework”) doesn’t really have any web front-end yet. However, the back-end does have a functional API, and the front-end part can be made arbitrarily fast or slow, depending on context anyway.

Here is my little benchmark program:

fetch(N) when N > 0 ->
  erlhive:with_user(
    <<"user1">>,
    fun(M) ->
       Id = M:apply(erlhive.blog.flexiblog,
                    string_to_id,
                    ["ba/user1/1/1"]),
       [_|_] = M:apply(erlhive.blog.flexiblog,
                      read_article, [Id])
    end),
  fetch(N-1);
fetch(_) ->
  done.

Clocking this with timer:tc() in coLinux/Vista on my 2.17GHz dual-core Pentium laptop (not using SMP erlang, though), I achieve 1450 article fetches/second. That’s a lot better than I had expected. Erlhive, apparently, is not so slow after all.

To explain what the above does, I assume that the surrounding web framework has authenticated the user (<<“user1”>> in this case), and that there exists an article 1 in blog 1 of the user. All objects in erlhive can be given user-defined properties, so coming up with more creative names is perfectly possible. However, the blog example uses the following naming convention:

  • [blogs,User,N] to identify a blog
  • [ba,User,BlogN,ArticleN] to identify an article
  • [bc,User,Blog,ArticleN,CommentN] to identify a comment

The call, erlhive:with_user(User, Fun) starts a database transaction, verifies that User is a known erlhive user, and creates an “access record” in the form of a parameterized module M. The user-provided fun is called with Fun(M), and through the module M, the whole erlhive API is available. Any function called through M (e.g. using M:apply(Mod,Func,Args)) is subject to erlhive’s access control. Of course, anything else in Fun/1 is still ordinary Erlang, and can be as “dirty” as you like. M is the entry point to erlhive, and erlhive:with_user/2 creates the transaction context.

The first call, to erlhive.blog.flexiblog:string_to_id(“ba/user1/1/1”), simply translates a web-friendly identifier to the internal form, [ba,<<“user1”>>,1,1]. The second call, to erlhive.blog.flexiblog:read_article(Id), performs the following steps:

  • Checks that the blog, [blogs,<<“user1”>>,1] exists and that the current user (<<“user1”>> in this case) has read access to it.
  • Reads the properties of the article, and verifies that the current user is authorized to perform the requested operation.
  • Returns the property list associated with the article. The actual article content is also a property, tagged ‘content’.

The blog example is reasonably clever for a blog module. It allows users to be categorized as ‘admin’, ‘author’, ‘reviewer’ and ‘reader’. A reviewer can read and comment on an article before it has been published. You can list blogs and articles by property – all properties are automatically indexed, and you can also clone an article, as a form of revision handling. It is also possible to view previous/next in a revision succession.

All this in less than 1000 lines of code. I do feel pretty comfortable with that.

There is also a short text file that illustrates the blog interface through the interactive erlhive shell. Not exactly stellar documentation, but if I get some indication that there are potential users out there, I promise that it will improve.

BTW, in the course of this experiment, I noticed that the interactive shell was broken, and that the read_article/1 function actually didn’t exist. Bug fixes have been committed to the repository. I never did promise that it was production-quality, did I?