Friday, December 23, 2011

Redline Smalltalk: A Call to Arms

Redline Smalltalk is a file-base Smalltalk targetting the JVM. I've posted about it before.

Some of the goals are outlined here: Why Smalltalk on the JVM?

If you'd like to watch and listen a presentation about it: The journey So Far.

This is a call to passionate JVM programmers out there who would like to contribute to an exciting new project. Its compiler is ready and the core team is now tackling the many runtime classes. They need  YOUR help.

Now is an ideal time to contribute and be proud of having given a push at a critical moment. You can't go back in time and be an early Ruby or Clojure contributor no matter how much you wish. You either were or weren't. Now is the time to be an early Redline contributor.

Get started. Now. Go.
Adopt a class.

P.S. I've seen the expression "A call to arms" been described as "Stir to rebellion." Funnily enough, Stir is the name of the Redline Smalltalk interactive command line (REPL.)

Wednesday, October 26, 2011

Practical Clojure: Clojure distilled

I've been unable to go though my programming books lately; I can't find the energy to read it all or do the exercises.

I finally picked up Practical Clojure and it's a perfect guilt-free book: small and no exercises 8)

For some reason the first chapter did not flow very well for me, but every chapter after that is concise and readable. They really managed to boil down every important concept of the language without losing its essence. It's Clojure distilled!

Even though the information might seem cursory, it's not. The explanations are succinct but complete, and frequently include gotchas that have bitten me before. Information on how some features have changed between version 1.0, 1.1 & 1.2 was very welcomed.

I was dreading the namespace chapters because for some reason, grokking namespaces in Clojure is hard for me. To my surprise they took a really nice incremental approach to namespace that made me understand it at last.

The chapter on protocols is crystal clear. At last, protocols explained without the expression problem, which I was beginning to think was the only use of protocols ;)

The chapter on macros is also to the point with appropriate examples.

In short, if you want to have a clear understanding of Clojure before taking the plunge into writing programs or going through a more take-you-by-the-hand book, Practical Clojure is a great choice.

My only critique would be that errata to the book have still not been published on the Apress website more than a year after publication. Update: errata have begun to show up on the Apress website, so there are now officially no reason not to buy this book 8)


Thursday, September 8, 2011

A little syntax is nice

Ok, I was starting to comment on this blog post and it got ridiculously long:
What's wrong with Clojure syntax?

Clojure definitively has more syntax than Scheme and it is one of the reason I like it. A little syntax goes a long way. I guess we all have our own preference of how much syntax we like in a programming language.

In my case, Clojure is pretty near the sweet spot between too much or not enough. I love Ruby but too much syntax for me. Same goes for Scala. (I am not critiquing these languages. I am merely stating personal preferences.)

I tried to learn Common Lisp or Scheme, not enough syntax. Having a Lisp with almost no syntax is pretty hard (for me.) If there's no syntax, you have to remember arguments orders, keyword arguments, workflow if you're calling a macro. Was element the first arg or was it the collection in the "for" construct?

In contrast, "For each x in xs : do something" or its variant is pretty easy to remember or recognize in most popular non-Lisp languages.

On top of small visual clues to differentiate lists, vectors, sets and maps, Clojure has consistent destructuring conventions (which I would call syntax, but might not strictly be.)

Rich Hickey himself argues for using some syntax, and more clearly than I.
I assume quoting the article does not violate any copyrights.
"Since we were talking about syntax, let’s look at classic Lisp. It seems to be the simplest of syntax, everything is a parenthesized list of symbols, numbers, and a few other things. What could be simpler? But in reality, it is not the simplest, since to achieve that uniformity, there has to be substantial overloading of the meaning of lists. They might be function calls, grouping constructs, or data literals, etc. And determining which requires using context, increasing the cognitive load when scanning code to assess its meaning. Clojure adds a couple more composite data literals to lists, and uses them for syntax. In doing so, it means that lists are almost always call-like things, and vectors are used for grouping, and maps have their own literals. Moving from one data structure to three reduces the cognitive load substantially."
Taken from Rich Hickey Q&A, an interview by Michael Fogus, which appeared in Code Quarterly, the Hackademic Journal.

Thursday, April 28, 2011

Redline Smalltalk: A chance to be part of something great right from the start

What's that? Pffft!
If you're a bit like me, chances are you dismissed a great technology at its beginning. I remember reading about Python in some OO newsgroup, being really interested, and then reading about required indendation and losing interest immediately. Fast forward a few years later, Python is all the rage and I missed the chance of being there from the start.

Still not learning from my mistake, an excellent friend whose opinions I value talks to me about Ruby. "Why would I learn about yet another scripting language now that Python is so popular?" Only last year did I finally take the time to learn it and it turned out it was the most fun I've had with a programming language for a long time!

Slowly learning
Years after graduating, I'm opening up at last to new or different technologies. I've read with enthusiasm about Scala, with puzzled wonderment about Haskell and with astonishment about Clojure.

Why Smalltalk?
Despite (or because?) of functional programming resurgence and some recent back-lashing against OO, I've decided to learn a bit about the classical OO language: Smalltalk. Well to my utmost surprise, not only is Smalltalk more OO than Java (expected), it's also more in line with functional programming than Java : code blocks and there's also a line of thought towards immutability: ADDCasts episode 4. A lot of interesting ideas like unit testing started out in Smalltalk or were popularized by Smalltalkers.

Why Redline Smalltalk?
In a nutshell, Redline Smalltalk is a version of Smalltalk for the JVM aiming to be as compatible with Pharo Smalltalk as possible. The need for a language to target a virtual machine, be it the Java or .NET virtual machine is already well-established by now.

The stars are right!
Redline Smalltalk is an open-source project driven mainly by two enthusiastic committers on their own time and money. Now is an ideal to contribute. If you can't or won't contribute to the project itself, you can follow my example by making a donation to help Redline Smalltalk be presented at 2011 International Smalltalk Conference. If you've never donated to an open-source project before, why not this one?

Saturday, March 19, 2011

iPhone Games I like

Most of the games I like are puzzle-oriented, with a couple of action ones.

Let's start with the classical ones.

The Sudoku application from Mighty Mighty Good Games has the best interface of the ones I tried. I also actually thought I was pretty clever solving the expert level of the normal version until I bought the Expert Sudoku version and realized I sucked even at the easiest level. Their puzzles are hand crafted and often have a pleasing symmetrical quality.

Subway Shuffle is a classical no-fluff logic puzzle with a neat interface from an independent developer.

The Boxed-In series is a great rendition of the classical push boxes puzzle genre. They also sport a robot, what's not to like?

The first non-puzzle game I bought is Flight Control which I played countless hours. I'm eagerly waiting for a new airfield.

I'm an atypical iPhone game user. In fact, I have an iPod touch and I play on my daily commute, without an Internet connection. As such, global scoring system or social network options are uninteresting to me, and an hindrance if the application resolves around it.

For that reason (an others,) I prefer the excellent Train Conductor to its sequel Train Conductor 2, which does not present me with local stats anymore.

I'm also a firm believer in the least amount of clicks possible between the moment I click on a game and the time I actually start playing the game. The previous games minimizes the number of clicks between me and my fun, and I appreciate them even more now that I actually tried games who would be interesting otherwise, but have just too many clicks for me.

This next game is borderline for me on the number of clicks, but it's a nice retro-style space shooter and is really responsive: PewPew.

I'm going to end up with a game I really like for its clean fun factor, great interface and cute theme. It's an interesting action-puzzle called Cut the Rope by ZeptoLab.