CommonTalk is (supposed to be) a highly object-oriented scripting language. It is mostly a research topic of mine (i'm a sucker for languages) to try and combine the extreme object oriented'ness of SmallTalk and the beauty of Python.
Syntax
The current idea for the syntax of the language is to try and remove as many non-alphanumeric characters from the syntax as possible something like:
import Gtk window = Gtk Window new title: "pretty window" window setSize size: 600, 400 window show
I even plan to make the ':' character optional, tuples (as in the 600, 400 part) should also be parseable, a tuple is just any number of objects concatenated together with a comma in between.
All method calls should be done using a dictionary, this means that all parameters are specified using named arguments. Not for any particular reason, but just because it is neat to look at, and hopefully makes the code more easily readable. Maybe it should be able to define one parameter as the "default" parameter, which doesn't require to be named, so the code above can be reduced to:
import Gtk window = Gtk Window new: "pretty window" window setSize: 600, 400 # Another way to call it while retaining the "everything is named" rule could be: windows setSize height: 600 width: 400 window show
Scope/dictonary is king
The idea of CommonTalk is to have the dicionary be the most fundamental type, eveything is a dictionary - a class is a dictionary and so is a scope. If you think about it, that is easy to understand.
Consider a class called A - to instantiate that class, what you really want is that you want a new class where the members of A is also available in your subclass. In other words, CommonTalk does not differentiate between classes and instances of classes - eveything is just an object.
What this means is that all objects has a "super" object that takes over when something in an object is not found.
So all objects are dictionaries, with a super dictionary.
Even more so, scopes are also dictionaries, and the super dictionary is just the scope around the current scope.
So every time a new scope is created, a new dictionary is created, actually a scope is a dictionary.
What this all ends up with, is that everything is a dictionary - and dictionaries just happens to be the same as an object. Or rather, an object is a dictionary from strings to other objects.
Now the bells should start to tingle, actually this is really simple: everying is an object - and i really mean everything - even plain ol' data types like int's, boolean's and string's are objects. This will probably mean quite a bit of overhead, but then again, this is more research than producing a genereal purpose language.
So i'm hoping for code like this, the inheritance operator is paranthesis for now - but i'm really looking for something with less non-alphanumeric signs:
Class
test ( Function )
execute
return 42
main ( Function )
execute
a = 23
b = 23
c = a + b
d = (c equals 46)
d ifTrue:
System println: "test"
Maybe a more prettier syntax for defining functions should be devised, but just to emphasize the coolness of this. Maybe return could even be a method on the base Object class of the system - which is a native method that pops a scope and pushes the argument onto the stack.
Current Progress
Right now my focus is on trying to create a virtual machine and accompanying runtime environment for support the language.
The design is changing fast, i try to keep of development on this page.