Posts tagged: scheme

Saturday Web Overview

During last week I’ve encountered some interesting links on the web. Here’s an overview.

  • Although I’ve read 10 chapters of LYAH and four chapters of RWH, I find learning Haskell difficult. Not that I don’t understand it. The problem is that I have a really hard time to create a fully working application. I was somewhat relieved to find out that I’m not the only one and that it’s typical for Haskell newbies.
  • In the 12th issue of The Monad Reader Neil Mitchell published an overview of Hoogle. I find this paper very helpful, since Neil gives also some useful tips about designing a Haskell project. I’ve been playing a bit with some Haskell code recently, hoping that perhaps it could be turned into something actually usable.
  • Speaking of which, Haskell wiki also provides a great guide how to start a new Haskell project. Also very useful, although it assumes usage of darcs, while I use git. That’s not a big problem, though.
  • There’s a book called The Architecture of Open Source Applications. It looks like there’s a lot of interesting reading. Volume 1 contains a chapter about LLVM and about Eclipse. Volume 2 has not yet been released, but there is a draft of chapter about the architecture of GHC.
  • Just a few months ago I didn’t know lots of programming concepts: lambdas, folds, currying, partial function applications, the Y-combinator to name a few. There are some more to learn: monads, which I’ll tackle soon, and continuations. I have a plan to read The Seasoned Schemer one day (that’s a sequel to The Little Schemer) to learn about continuations but in the meantime I’ve found a continuations tutorial on Scheme Wiki.
  • Constructing minimal PNG encoder in Haskell seems extremely easy.
  • I dug out an interesting thread on Stack Overflow. This time it’s about memoization in Haskell. I wasn’t yet able to wrap my head around edwardk’s solution but it looks impressive.

7 Languages in 7 Weeks. Book review

I already mentioned a couple of times that I’m new to functional programming. My fascination has a very precise starting point. It was thanks to a book “Seven languages in seven weeks” by Bruce A. Tate. I found out about the book somewhere in October 2011. It was yet another publication from Pragmatic Bookshelf series that I wanted to read. As the title suggests, it presents a guide to seven programming languages and I knew none of them: Ruby (“It’s something like Python, I guess”), Io (“WTF?”), Prolog (“How does programming in logic look like?”), Scala (“Oh, a friend uses it so it must be practical”), Erlang (“Oh, I heard it’s something like Haskell”), Clojure (“I think I heard something about this LISP thing…”) and Haskell (“Oh, I heard it’s something like Erlang”). So generally I had no clue what these languages are, but I knew I’d like to learn them, especially that I haven’t learned any new language for about 2,5 year. David Thomas and Andy Hunt in “Pragmatic Programmer”, that is a modern programmers bible – if you haven’t read it yet go grab a copy, I’ll wait – recommend that a programmer should learn new language every six months. Looks like I had a lot to catch up. And then somewhere in the beginning of December I found Polish edition of “Seven Languages in Seven Weeks” in a book store. I couldn’t miss such an occasion.

The idea of learning a programming language in one week is a bold one. Learning seven languages in seven weeks seems even bolder. Bruce Tate says it outright: reading the book will require a lot of work and assumes readers good knowledge of programming in general. And it really does. The first language, Ruby, was rather easy, mostly because it is similar to languages I already know. The second language, Io, was my personal failure. I could not grasp it. Despite it’s simplicity I had problems understanding the basic concepts of the language (mostly passing messages) and the official documentation offered little help. This discouraged me a lot, but luckily the next language, Prolog, turned out to be extremely fun. In fact I put down the book and started reading online tutorial on my own. From it I learned about tail recursion using accumulator. Language number four was Scala. I was looking forward to learn it, as I’ve already heard some stuff about functional programming. Unfortunately, Scala turned out to be disappointing to me. Not that it’s a bad language. I think it can be great, but I wanted to learn functional programming. Scala, being a hybrid language – both object oriented and functional – didn’t provide me with good clues where the object programming ends and the functional begins. I liked the concept of folds, though. Erlang was next. I liked it because of it’s similarity to Prolog, but honestly speaking I didn’t put much effort into learning it. Following Erlang was Clojure, a dialect of LISP for the JVM…. ops, I skipped that chapter of the book! Seriously, I did. I wanted to learn LISP and in some strange way I drifted away from Clojure to Scheme. I’ve read the R5RS language specification and The Little Schemer – I’ll definitely write about it on this blog. Finally came Haskell. I was anxious to learn it and I must say that the purity and logic of this language keeps me fascinated for the last three months

Ops, I strayed away from the book itself. Well, the book’s nice but I’ve certainly read better ones. In fact if I were to rely only on it I wouldn’t learn much. Many topics are covered very superficially (good luck understanding monads!) and to fully understand them I had to spend hours reading tutorials on the web. I realised that when I was learning Erlang I just started reading Learn You Some Erlang for Great Good and after completing eight chapters from it I read the book only to conclude that I already know all of that. But I think that’s irrelevant. I think that the most important thing about “Seven languages…” is the fact that it’s motivating. It made me learn languages on my own and that’s great, cause I haven’t done it for such a long time. It also exposed me to the basic concepts of functional programming and I am thankful to Bruce for that. To me it was one of the most influential books in my programming career, but honestly speaking you can do without it and learn these seven languages just as well, providing that you can keep yourself motivated.

P.S. While I was reading the book I found Ben Nadel’s blog to be very supportive.
P.S.2 This is not a concern for most of you, but I found the Polish edition of the book to be poor. Translation is sometimes wrong, unclear or hard to understand. Code listings contain lots of mistakes, including translating some of the language keywords.

Staypressed theme by Themocracy