The Artima Developer Community
Sponsored Link

Let's Reconsider That
Just for Fun
by Michael Feathers
July 26, 2005
I like little programming languages. The sad thing about designing one is that people expect you to have a purpose.


On another thread recently, someone here spoke about a language he is working on called Atom. Chris Diggins has his work on Heron. In spare moments, while procrastinating on other things, I've been working on a language called Grot. I haven't mentioned it before because its level of ambition is incredibly low. It isn't designed to break any new ground, and in fact, I expect it to be useless.. which is fine by me. I like to "charge up" by working on little projects in my spare time.. things that I can keep immune from creeping seriousness.

Grot is named after a shop in an extremely funny 1970s BBC TV series called 'The Rise and Fall of Reginald Perrin'. Grot, the programming language, may not be completely useless once the interpreter is done, but I am doing it just for fun.

In a nutshell, Grot is a prototype based OO language that uses Python style indentation to end up with a syntax simpler than Smalltalk.

I'm using this code, essentially an xUnit written in Grot, to guide my implementation. There are many design choices yet to be made but implementation is underway in an emergent fashion. If you think it might be good for anything aside from fun, please let me know. I can't guarantee that I won't sabotage it and make it less useful in response, but I probably won't. It would be nice if it ended up somewhat useful, as long as developing it remains less than serious.

false ifTrue: aBlock

false ifFalse: aBlock
    aBlock value

true ifTrue: aBlock
    aBlock value

true ifFalse: aBlock
test setUp

test tearDown

test runTest
test should: aBool
    aBool ifFalse:
        self hurl: "assertion failed"

test run: aResult
    self do:
        self setUp
        self runTest
        self tearDown
        e | aResult addFailure: e
testSuite tests := list clone
testSuite add: test
    self tests add: test

testSuite run: aResult
    self tests do:
        aTest | aTest run: aResult

result failures := list clone
result addFailure: failure
    self failures add: failure

result show
    self failures do:
        failure | sout print: failure

divTest := test clone

divTest runTest
    self should: 6 / 2 = 3

aSuite := testSuite clone

aSuite add: divTest

aResult := result clone

aSuite run: aResult

aResult show

Talk Back!

Have an opinion? Readers have already posted 3 comments about this weblog entry. Why not add yours?

RSS Feed

If you'd like to be notified whenever Michael Feathers adds a new entry to his weblog, subscribe to his RSS feed.

About the Blogger

Michael has been active in the XP community for the past five years, balancing his time between working with, training, and coaching various teams around the world. Prior to joining Object Mentor, Michael designed a proprietary programming language and wrote a compiler for it, he also designed a large multi-platform class library and a framework for instrumentation control. When he isn't engaged with a team, he spends most of this time investigating ways of altering design over time in codebases.

This weblog entry is Copyright © 2005 Michael Feathers. All rights reserved.

Sponsored Links


Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use