Potion - a little fast OO language by _why
github.com
github.com
It has a bunch of novel ideas* (e.g. the register-based VM, the table optimizations) that have paid off big, it's very portable (due to being written in strict ANSI C), and it has a surprisingly small code base. It's pretty readable (http://www.lua.org/source/5.1/), full of examples of simple-but-efficient garbage collectors, string handling optimizations, etc. The designers have worked hard to keep it small and simple.
* See "The Implementation of Lua 5.0" (http://www.tecgraf.puc-rio.br/~lhf/ftp/doc/jucs05.pdf). It's 16 pages, and is a quick - but quite thought-provoking - read.
I would instead list their one-pass-compiler implementation of flat closures and their approach to continuations, and especially integrating continuations with C code calling back into Lua.
I second the recommendation of the paper. I also think their paper on LPEG is worth reading for anyone who is considering using regular expressions or yacc or ANTLR for anything: http://www.inf.puc-rio.br/~roberto/docs/peg.pdf
By "table optimizations", I meant the way it behaves as both a dict and a table, depending on how it is used, and how much they get out of using those throughout the language. (I wrote the above in a hurry before catching the bus, and knew I had missed better examples, but it came to mind from the _Implementation_ paper.)
I'm glad you've enjoyed the various links.
I meant the way it behaves as both a dict and a table
You mean, a dict and an array?
I'm not sure I agree with their decision to unify those structures, but it does seem not to have cost them much implementation complexity or performance.
Also, Lua had a stack-based VM until Lua 5.0.
concerning register based vm architectures you might find the following a good read: "virtual machine showdown: stack vs. registers" (https://www.usenix.org/events/vee05/full_papers/p153-yunhe.p...). aside from lua and parrot, google's dalvik also uses a register architecture (afaik).
i also had a look at the lua implementation a month or so ago, and i found some other details very interesting: it uses very few instructions (<40), and it uses a very neat trick to "unify" floating point and integer numbers: by using double as the default numerical type. (compare for example to the jvm, {i, f} x {add, mult, div, .etc.})
I still love it :-)
(Also, should be "simple-but-efficient garbage collection" above.)
I'd like to do that with a Forth or a Lisp one of these days, time permitting.
It's an infectious virus that works rather brilliantly with the presentation, and quality of work this guy puts together.
The language partisans will have slavish devotion.
I admit, I'm a Romantic at heart.
You can swap out mixins for the span of a single source file. Example: you could give all strings a "backwards" method. But just for the code inside your test.pn script.
This would let you monkey patch in a safer fashion.
You can re-mix for the span of a single closure.
I wish there was an example in the docs I could post of this in action, because I'm curious about how this works.
Yay to that.
If you think about it, very few programming languages had legibility (readability) of the code as one of their design goals. Not through the natural language verbosity, but rather by reducing or eliminating the code needed to please the compiler and otherwise not related to the actual application logic.
D makes a good step forward in this direction (compared to C++), and so does Python. Java is close, but still pretty "noisy". Petrovich is the best there is, but it's not very practical.
This is an interesting subject, so if anyone has any thoughts on the matter, please post below.
I think at the end of the day, what is noise for one application domain is signal for another.
Have you heard of Concept programming? http://mozart-dev.sourceforge.net/cp.html I think the basic idea is that it somehow separates the domain-specific code from the code that pleases the compiler.
a.equals(b) vs a == b
The antithesis of readability is APL, which is nothing but line noise. When it came out, you had to get a special printhead just to type it. You could make some unbelievable one-liners though.As I understand it, javascript objects are like this, except you only add in methods one at a time, instead of mixing in and out modules.
It doesn't look like there are inheritance trees. I'm not sure what you'd do to prevent namespace clashes when mixing in different modules or if/how modules share and work on object attribute data, but so far in Ruby, that hasn't been too much of a problem.
Read the traits paper: http://www.iam.unibe.ch/~scg/Research/Traits/
Also looks like it will do the fastest fib benchmark around !
Would it be fun?
Someone like _why is a real inspiration to me personally.
A developer and Ruby advocate who's written one of the earlier and more popular guides.
...you don't know how much restraint it took to avoid the Abbot and Costello routine there.