Summary
I like little programming languages. The sad thing about designing one is that people expect you to have a purpose.
Advertisement
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
pass
false ifFalse: aBlock
aBlock value
true ifTrue: aBlock
aBlock value
true ifFalse: aBlock
pass
test setUp
pass
test tearDown
pass
test runTest
pass
test should: aBool
aBool ifFalse:
self hurl: "assertion failed"
test run: aResult
self do:
self setUp
self runTest
self tearDown
ifUnable:
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
> > self hurl: "assertion failed" > > Whether or not you someday sabotage Grot, keep the word > 'hurl'. Hurl is a fun word. It will remind you (and other > programmers) not to be too serious.
Thanks. :) It's a homage to Ron Jeffries. He doesn't like exceptions and he often talks about methods that hurl. Thanks as well for the reply. I was just about to mark interest in inconsequential programming languages as zero :)
> Thanks as well for the reply. I was just about to > mark interest in inconsequential programming languages as > zero :)
Wow. How sad in these days of "instant" electronic communications to think that no reply within a few days means zero interest. As you can probably see, I'm seldom in a rush to communicate. :->