The goal for the core Urlang language is to be almost 1-to-1 with JavaScript.
Therefore I haven't used any JavaScript libraries. As Dan's examples
shows (see urlang/urlang-examples) it is straightforward to use existing
JavaScript libraries.
There are a few predefined macros that one can optionally use:
cond, case, for etc which are Urlang macros that expand into
core Urlang (think JavaScript) constructs. The ability to extend JavaScript
with a sane macro system was what I wanted to achieve.
The source code for Space Invaders is a port of an HtDP-style program.
The attempt was to match the original HtDP-style and I think it turned out pretty well.
It contains an ad-hoc implementation of structs in Urlang (JavaScript), so when
you want to access the x-coordinate of a player p, you will see (player-x p)
in the code. If the program was written from scratch I would have used p.x
which is the standard JavaScript notation of access x in an object (or array) p.
If anyone wonders why I chose (var [x 42] [y 43]) rather than adding
an internal define to Urlang - it is due to the scoping rules. The
var-form follows the scoping rules of JavaScript - which means it
has block-scope.
If normal local scope is needed one can use the the let-macro (or letrec*)
from urlang/extra.
/Jens Axel