The Soda Languages #
Whoa, get ready to spend your whole afternoon tooling around with a small pile of little languages and compilers. I am completely hooked on Idst, a compiler for a hybrid prototype-based Smalltalk-plus-C language by Ian Piumarta. And atop the bedrock of Idst: the soda languages.
I first heard about Ian’s stuff in a #camping discussion where Pepsi (the Smalltalk/C hybrid) was brought up. Well, it turns out Idst also comes with a Lisp-like soda language called Jolt (see examples/jolt.) Other examples are just great and include a teensy Squeak VM (examples/sqvm) and some X11 samples (examples/x11.)
He explains the Pepsi syntax in an interview a few days ago on the Weekly Squeak:
You can mix C-code and “Id” code in a very simple way. So it is easy to integrate with O.S. services. The idea is quite the opposite of Objective-C: you think in terms of objects all the time (as in SmallTalk). Then you “come back” to C-Language for the dirty part of your work.
The syntax is suprisingly terse. You use curly braces to break out into a method written in C. Square brackets for Smalltalk-style.
X11Display newWindow [ ^X11Window withDisplay: self ] X11Display _createSimpleWindow_: _x _: _y _: _w _: _h _: _bw _: _b _: _bg { return (oop)XCreateSimpleWindow((Display *)self->v__dpy, DefaultRootWindow((Display *)self->v__dpy), (int)v__x, (int)v__y, (int)v__w, (int)v__h, (int)v__bw, (int)v__b, (int)v__bg); } X11Display createWindow: bounds borderWidth: borderWidth border: border background: background [ ^self newWindow _win_: (self _createSimpleWindow_: (bounds _x) _: (bounds _y) _: (bounds _w) _: (bounds _h) _: borderWidth _integerValue _: border _integerValue _: background _integerValue) ]
Can you get over that?
Update: Some of the above interview appears to be taken from a post on the Smalltalk newsgroup, which goes into greater detail concerning Coke and Jolt, as well as the other literal man-decades of work Ian has assigned himself.
It’s often said that Smalltalk and Lisp suffer because they are systems that eat all of their young. If COLA succeeds it might be called the system that ate its parents.
Danno
I guess so, but what’s the deal with the funky variable names?
dizm
Where’s info on Id itself? (sadly, in these dark ages, we still search by undifferentiated symbol, of which “Id” is a rather common example)
why
Literally, that open directory is it. But, if you unpack the distro and look around, there’s a bunch of 00_README files around and INSTALL works like it says.
dizm
, redFaced, ‘ta’
<|:{
isn’t this kind of like using RubyInline?
Evan
The Haskell FFI is one of the most sensible I’ve seen (Ruby’s is quite nice, though).
Unfortunately, it’s only documented as a Report.
But you can basically declare, from within Haskell code, that a given Haskell function is actually a C function underneath:
foreign import ccall “getpid” getpid :: IO Int
and then use it like any other function you would in normal code:
(PS: your markup is hella annoying for including code—after playing with it a bit I still couldn’t get this to format right in the preview.)olleolleolle
There goes another “whole afternoon”...
Thanks for “cettes pointers invaluables”. The blogosphere isn’t exactly bristling with information on programming language exotica.
(And, know that people out here are keen on Syck for Io. Go, go!)
gokr
You might have missed this which explains the concepts in much more detail: http://piumarta.com/papers/colas-whitepaper.pdf
...and yes, I have been hooked for a few weeks. This sure can get really exciting if all turns out as planned.
ozten
No, no, no more timesinks.