Wednesday, September 26, 2007

Reading SICP in Erlang and Ruby



I’ve had a long standing goal to read SICP, but it keeps conflicting with other goals, like mastering Ruby or learning Erlang (to name a couple of geeky ones). Recently I learned of a project to ‘translate’ SICP into Erlang (and other languages).




“Great! I can use this to help with both learning Erlang and reading SICP”, I thought and went to take a look at it. It turns out they also have a Ruby translation underway, so I went to look at that first. It turns out that the first couple of examples make me think that they either don’t understand Ruby or don’t understand SICP.




Page 5 of SICP shows that you can start up a LISP or scheme interpreter and type in an expression and it will return that expression, like this:


> 486
486
>

The site recommends the following Ruby puts 486, which is not quite right:

irb(main):001:0> puts 486
486
=> nil
irb(main):002:0>

You see, this prints 486, but returns nil. A much better answer looks a lot more like scheme:

irb(main):002:0> 486
=> 486
irb(main):003:0>



With a problem like this early on, I’m not sure that I trust the Erlang or other translations. I do like the idea though, so I should probably stick with my idea of combining the goals, and just post my own translations into Erlang and Ruby (and let everyone else find my mistakes).

Wednesday, September 19, 2007

Long Time No Write

It’s been a while since I’ve written anything here, and (sadly) a long time since I’ve taken any time to focus on Erlang. I’d like to rectify both of these deficencies, so here’s a first stab.




First off, I’d like to drum up another Provo Erlounge for October 9th at 7PM (MST). We can meet at the Open Source Technology Center again (we’re supposed to have wireless access at that point). There are a couple of routes we can go, either hitting the Concurrent Programming and Distributed Programming chapters from Programming Erlang: Software for a Concurrent World or walking through some ‘real world’ Erlang code. Anyone have a request/suggestion for us?




Secondly (and more generally), I’ve recently been talking with a publisher about their entry into the Functional Programming world. They’re very interested in doing this, and seem to have a good plan. They haven’t settled on which language(s) they want to cover yet, but Erlang is on their list. They would like feedback on which languages, potential topics, and potential authors would be of interest. If you’d like to leave a comment here, I’d be happy to pass the information along. If you’re worried about other publishers mining the information (but, hey, that would just mean more potential books on Erlang and FP wouldn’t it?), feel free to email me directly.




And now, it’s off to spend a little time with Erlang.