Revisiting Smalltalk language
As Java gets more and more complicated with generics, closures, etc... I keep looking for simplicity. I have the Mantra prototype, but even that subset is kind of complicated. I decided to look at Smalltalk again. Coincidentally, Nik Boyd, who built Bistro years ago contacted me; he's moved to SF Bay area, which means we can chat in person. He had lots of similar ideas to what I'm thinking about: a slightly improved Smalltalk.
Couple of issues with Smalltalk:
no flat file format really for humans
dev happens within Smalltalk environment, which is nice, but harder to integrate with other systems
no access modifiers; hard to say what public interface is
no direct field access; can't say "o x" to get o's x field
no a[i] array access operator; have to say "a elementAt: i" or whatever
no types on variables, methods
metaclasses confuse everybody
commercial versions added namespaces (packages)
I wonder if we need arrays vs lists? Is #(a b c) the right list syntax?
Is $a decent char literal syntax?
should have trees as default data structure
var scoping rules seemed odd to me; will have to look at that again
The Java VM is still the right target but might be fun to start out having an interpreter written in Java.
Hmm...what would it look like?
Animal subclass: Dog
const int w = 3.
String name = 'Rex'.
float weight = 0.0.
speak [ sys println: 'woof' ]
feed: int food [ weight += food * w ]
walk: Point to from: Point here [
...
]
float howMuchFood [ ^weight / w ]
boolean equals: other [ ^self name == other name ]
'.' is separator not terminator
'=' not ':='
hmm...maybe it's ok to have keywords for var, method, types. Nah. You know it's better to use java-style syntax except maybe methods. I like having smalltalk style methods so youcan essentially add keywords at will. The problem is that people will expect Java semantics then. Hm...