Working through Concepts, Techniques, and Models of Computer Programming
I am working through the famous CTM book, which looks like it could be like SICP for grownups.
CTM uses a language and platform called Mozart/Oz, which is freely downloadable and easy to get started with.
The development environment includes an Emacs-based REPL. It’s very easy to get started.
15 minutes after installing the program, I was able to code up the classic tail-recursive factorial:
declare
fun {Fact N}
fun {FactIter N Acc}
if N == 0 then
Acc
else
{FactIter N-1 Acc*N}
end
end in {FactIter N 1}
end
{Browse {Fact 23}}
The first part defines our factorial function, and the second evaluates 23! and displays the result in the browser, which will be familiar to anyone who use has used Common Lisp.
(Yes, Oz has arbitary-precision integer arithmetic built in, like any sane modern programming language. Yes, Oz is apparently lexically scoped.)
All in all, it looks like the CTM book should be quite enjoyable. I’ve heard it’s readable and its coverage of different programming paradigms — object-oriented, concurrent, logic, functional, imperative, constraint-based, declarative — is nearly comprehensive.
Let the holiday language snobbery commence!