The place where random ideas get written down and lost in time.
2014-07-04 - Language design
Category DEVI'd like to do a parallel research document on language design.
Right now I have some ideas for Hint, which is still very vague and not well formalized. It's a bit of a catch-all. So instead I did a subset with NovaScript, whose version NS1 is really limited -- the main purpose is to remember how to implement a language and interpreter, then have a more useful NS2 version. This isn't Hint at all, although hopefully some things could be reused.
Hint discussion suffered from being both a language discussion and a platform discussion but I believe I cleared that one out, or did I?
Anyhow, the point of this snippet is to remember that, in an ideal version, Hint would have elements of:
- Actor model: each "class" or module is independent and calls are considered RPCs.
- Distributed vs non-distributed and "mobile" actors. There can be several VMs distributed on different hosts and then freeze/move runtime modules around.
- Behavior Driven Development -- in the very very early Hint discussion one of the ideas was to make it trivial to add testing.
- One way is the classic unit test where each function has its associated test, but in practice this is seldom useful and unit tests quickly turn into larger behavior tests that encompass a set of functions.
- Small functions can be treated as mathematical functions, with some inputs and output automatically compared.
- More often what needs to be described is the behavior of a whole or part of a system, but it gets tricky with side effects and generally the test itself is costly and confusing to write. Not to mention that all corner cases are hard to predict and test.
- Still the idea is that this is highly valuable and ideally would be part of the source and not an on-the-side after-thought.
- Continuations built into the language, either like a call/cc.
- Coroutines, iterators and generators.
- Various levels of implementation using extensions to a unified language. That's the point of the hint levels (0=assembly, 1=C/java like, 2=interpreted). Similarly some of the concepts like distributed actors are not mandatory.
Whenever possible I should look up definitions in c2 and match their name patterns.
So part of this impacts both the platform and the language (e.g. BDD, mobile/distributed actors.)
Some of these are things I have absolutely no idea about them except they seem like good ideas.
I've never used call/cc -- although goroutines and closures are familiar. I certainly have no idea how to implement them, which makes it much more interesting to even think about.
BDD and testing are in a slightly different category -- there are many languages that have support for unit tests and such. The question is whether I can make it attractive and efficient for me to use a-priori rather than a-posteriori. My current attempts at using UT are more hindering my development style than enhancing it.