[racket] cool things in Whalesong, part 2

From: John Clements (clements at brinckerhoff.org)
Date: Tue Mar 6 14:07:47 EST 2012

On Mar 6, 2012, at 11:01 AM, Danny Yoo wrote:

> On Tue, Mar 6, 2012 at 1:22 PM, John Clements <clements at brinckerhoff.org> wrote:
>> On Mar 5, 2012, at 1:17 PM, Danny Yoo wrote:
>>> Here's another example that's starting to work, though it isn't flashy yet.
>>>    http://hashcollision.org/tmp/js-get-message/js-get-message-parent.html
>> Can you be more explicit about what's cool here? I have a sense that it has to do with JS interacting with compiled racket, and I agree that that's very cool, but I could use a bit more hand-holding :).
> Yes; of course.  I'm sorry, I get so caught up sometimes!
> The example is demonstrating JS interacting with Racket, particularly
> to interact between JS and World programs.  I will be making the world
> APIs in Whalesong extensible, so that the set of handlers like on-key,
> on-tick, ... etc can be extended by library developers.  The key point
> is that I don't (and can't) know all event types out there in the
> browser. With the appropriate FFI, I should allow library developers
> to add in `on-tilt`, `on-touch`, or any of the other events that the
> browser is providing, and without needing to touch the core of the
> world implementation.
> This means I can (and probably should) factor out behavior that used
> to be hardcoded in my world implementation (like on-key and on-mouse)
> and push these into libraries.  As a demonstration, I'm doing this in
> the context of my web-world library, with an example that listens on
> the `postMessage` event.

Very cool! I'm currently developing a tiny "dragon tamer" game with one of my three kids, and this is exactly the kind of thing we're looking for.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4624 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20120306/a13b8fc8/attachment.p7s>

Posted on the users mailing list.