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




2016-03-23 12:42 GMT+01:00 Daniel Prager <daniel.a.pra...@gmail.com>:

> On Sun, Mar 20, 2016 at 9:44 AM, Matthew Butterick <m...@mbtype.com> wrote:
>
>> When you put it that way, subjectively it still sounds good. I'd use it.
>> But objectively I can't foresee that it would be a wise investment of
>> anyone's Racket time. Let's face it: any web framework is lucky to live 5
>> yrs before developers tire of it and move onto the next thing, or browser
>> changes make it obsolete.
>>
>
> The shifting of the underlying platform is inevitable -- perhaps
> eventually it will settle down -- and empirically your point about
> web-frameworks checks out, suggesting that it would be unwise to bake in
> reliance on any particular framework.
>
> That said, I reckon that there are gains to be made via making use of
> existing JavaScript frameworks and libraries.
>
> OTOH: Here's a new example from Jens that has zero dependencies on
> external JS - a simple Space Invaders game in Urlang:
> http://soegaard.github.io/urlang/space-invaders.html
>
> Dan
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
-- 
Jens Axel Søgaard

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to