Wednesday, February 25, 2009

The FONC project & potion

While messing around looking if anyone did anything with potion language, that I wrote about a few days ago, found this interesting link:

http://wiki.ruby-lang.nl/amsterdamrbwiki/show/The+FONC+project - The Fundamentals OF New Computing. Has some interesting reading on research in programming languages.

Potion itself is rather fun, though of course my microbenchmark was a bit of an over-joyous :)

Yeah, while it looks to be pretty damn fast, LuaJIT is only about 1.7 times slower. Nonetheless, I'll play with it more, it is an interesting thing to mess around with - at least the internals. Syntax I am not so sure...


Foo = Object delegated
Foo def("xx", (x): "foo\n".)

Bar = Foo delegated
Bar def("yy", (x): "123\n".)

a = Foo allocate
b = Bar allocate

a xx print
b xx print
b yy print


Running this with potion will give you three lines "foo", "foo", and "123" - the middle one being the method of "Bar", "inherited" from "Foo". Did not dig on how to glue multiple mixins - _why wrote that it's incomplete, I'll see maybe some other day.

No comments: