(picture)

December 18, 2003

Stack languages

Ned writes recently about PostScript's stack-based language model (like Forth, too). I was fascinated by PostScript a long while back, when we had a LaserWriter in the Dublin office; it's a great little language, but "difficult".

In a related vein, here's a sanitised version of a JavaScript stack calculator language I've been working on recently. This is deliberately not a real programming language; it's an extension for the configuration file syntax I talked about a while back. Funny how these things grow, huh? Anyway, the principles are simple enough to make readable code, and yet nicely powerful. The syntax will be familiar enough: @functions. Of course the Notes @function compute engine uses a full-scale parse tree these days, not just a teeny little stack.

To be a proper language, what more would I need? Just @def. (Oh, and maybe some datatypes. Or just one).