Archive for June, 2007

Perfection is achieved not when you have nothing more to add, but when you have nothing left to take away. - Antoine de Saint-Exupery

Friday, June 29th, 2007

’super fly’ code …

Friday, June 29th, 2007

It’s not often that I see some code out there especially in a javascript library where I sit back and think ‘wow, that’s not only neat in a functional way, but also in the aesthetic’. jQuery / flyDOM is one of the occasions.

flyDOM uses various javascript shorthand declarations (like {} for maps) to provide some very flexible functions that modify the DOM. The use of this approach makes the code layout very readable.

Take a look and see if you find the code as aesthetically pleasing. It’s also a very handy library too.

groovy: It feels like ‘home’ …

Thursday, June 28th, 2007

I have long been a big fan of Lisp and Smalltalk but the world has gone Java, which was disappointing until I discovered Groovy. Groovy is a small step back in time but a giant leap forward for Java kind !

It’s a small step back in time towards the languages that started it all, Lisp and Smalltalk but a giant leap forward by bringing some of the power of those languages to the Java Virtual Machine and Java. It’s such a great language that it feels like ‘home’ for me.

“What makes builders special is their descriptive nature while still being ordinary executable code. Together with Groovy’s feature of executing code dynamically, this combination comes close to the ambition of Lisp: working as an executable specification.”  - Chapter 8.7 Summary, Groovy In Action, Dierk Koenig with Andrew Glover, Paul King, Guillaume LaForge and Jon Skeet.

Now that’s power and that’s my kind of language !

Melbourne now has a groovy / grails user group …

Wednesday, June 27th, 2007

A user group has been setup to explore and expand the use of groovy and grails. It’s held in Melbourne Australia.

“Gee, your laptop is so small. I don’t trust it.” - John Sherwood.

Tuesday, June 26th, 2007

Functional programming in groovy and java …

Monday, June 25th, 2007

These are two very good resources on functional programming, one for groovy and one for java.

Functional programming is very powerful but takes quite a mind shift, similar to going from procedural thinking to object oriented thinking; possibly a bigger mind shift.

Like the shift from procedural thinking to object oriented thinking, once you make the transition you will never go back and you will wonder why you didn’t make the transition sooner.

groovy / grails books …

Monday, June 25th, 2007

Recently I’ve been looking into groovy and grails as possible tools we can use at work for getting things done faster for our clients, whilst remaining close to Java so both we and they are comfortable. The following are some books I have read so far that I suggest are a great starting point for those interested in groovy and grails.

I’ll be doing some performance benchmarking between the two to get a feel for what to expect or cater for in using groovy / grails. So check back soon if your interested in the results.

Groovy in Action by Dierk Konig, Manning

grails-getting-started by Jason Rudolph You can download the eBook from http://infoq.com/minibooks/grails

The Definitive Guide to Grails by Graeme Keith Rocher, Apress.

G/localization: When Global Information and Local Interaction Collide …

Monday, June 25th, 2007

This is fantastic read and I’d say a must read for anyone in the Web 2.0 or Agile delivery arenas.

Citation: boyd, danah. 2006. “G/localization: When Global Information and Local Interaction Collide.” O’Reilly Emerging Technology Conference, San Diego, CA. March 6.

bootstrapping …

Sunday, June 24th, 2007

Attached is some code I was doing yesterday (I spent an hour on it). The thing that I hope you will find interesting and of use is the approach I am taking and hence why I’m blogging about it.

I have a vision of the future and Lisp is a fundamental part of that vision so I am creating ‘hyperlisp’ which is a version of Lisp that runs on every platform, in the browser all the way to through to the back end database. So there is only one syntax for anything you want to do and only one protocol.

The implementation is to run on as many platforms as possible and be written in assembler. This presents a challenge. How do you write for every platform at once and how do you make sure you can get the assembler syntax right, especially when you have never coded for a particular chip before?

The answer is to write to an abstract machine and when the algorithm works, translate the instructions into a specific assembler. This allows you to concentrate on what you have to do in a basic and abstract way and get specific at the last moment.

So when faced with the challenge of the unknown, think about what you do know and if it would be possible to make some progress on that basis and then at a later stage, translate that into something else. I guess this goes along the lines of doing the simplest thing that could possibly work.

In my case this approach works very well since writing in assembler is something I can do but it would take me a lot longer to get from A - B because my knowledge and tooling is not as advanced in assembler as it is in Java. So using Java is a lot faster. Quite ironically Lisp is awesome for this sort of thing since it’s macro system allows you to write a Domain Specific Language very fast and it is often used for this sort of situation. So why not use Lisp, because I know Java better right now.

This approach isn’t something I have invented but something called “bootstrapping” and it has been used by compiler writers and those porting from one operating system to another for years.

The attached code is ‘early days’ and only a handful of instructions are implemented, but it should give you the idea of how things work.

lisp-machine-spike

Pascal Costanza’s Highly Opinionated Guide to Lisp …

Saturday, June 23rd, 2007

Finally, a guide to Lisp, the language and the history that I can point to as “mandatory” reading for those interested in Lisp.

Pascal Costanza’s Highly Opinionated Guide to Lisp

This should wet your taste buds  …

The most important thing is that Lisp is a highly efficient programming language. Common Lisp vendors have worked very hard over the years to provide excellent performance.

(Please note that modern IDEs for Java, like JBuilder, NetBeans, Eclipse and the like are steadily progressing towards the same level of interactivity as that of Lisp and Smalltalk - so obviously this is considered valuable even by the communities of Algol- and C-like languages.)