Hacker News new | past | comments | ask | show | jobs | submit login

I've been working on Ralph for a while now: https://github.com/turbolent/ralph

It compiles a major subset of Apple's Dylan (http://lispm.dyndns.org/documentation/prefix-dylan/book.anno...) to JavaScript, both for use on a CommonJS implementation and in the browser. A bootstrapping compiler is implemented in JS, but the same compiler is also available in Ralph itself and features define-macro (Cl-like). The whole runtime is defined in Ralph as well and provides a single-inheritance object system (including next-method): https://github.com/turbolent/ralph/blob/master/src/runtime/c...

Almost all of the features are shown in https://github.com/turbolent/ralph/blob/master/src/tests/run... and I'm using it a project now. To build HTML5 apps, there's a small toolbox: https://github.com/turbolent/toolbox

Maybe it's useful to someone else. Cheers




I notice that it doesn't support multiple inheritance or multimethods; out of curiosity, is that because of a principled objection to them, or more because it wouldn't be convenient to implement them?


At the beginning I tried implementing various object systems. The first one was indeed multiple inheritance with multimethods, based on C3 linearization (http://en.wikipedia.org/wiki/C3_linearization) and didn't use the prototype chain, but wasn't finished. The second one was similar to Clojure's protocols (define-protocol, extend-protocol, ...), but wasn't very handy.

The current one is single-inheritance, because it uses the prototype chain. It's a compromise between speed and usefulness. I'd prefer having multimethods (and maybe also multiple inheritance), but speed is a bit more important, as JavaScript is already quite slow.

So far I'm quite pleased with the single-inheritance and single dispatch solution, which basically works like that: https://gist.github.com/866506


How is it related to the Ralph described by Mikel Evins at http://lispm.dyndns.org/news?ID=NEWS-2004-08-14-1 ?


I like Dylan (http://www.opendylan.org/) and CL - and I wanted to write both server side and client side web applications in it, so I wrote a compiler for a Lisp that resembles the original prefix/sexp-style Dylan as much as possible, described in (http://lispm.dyndns.org/documentation/prefix-dylan/book.anno...).

As I needed a name, I just chose "Ralph" as that was the original code-name of Dylan (see http://en.wikipedia.org/wiki/History_of_the_Dylan_programmin...). I'm currently implementing a web-based IDE for the OpenDylan compiler (http://www.opendylan.org/), called "Hula" (original code-name of Apple's IDE, see http://wiki.opendylan.org/wiki/view.dsp?title=AppleDylanScre...). The work-in-progress is at https://github.com/turbolent/hula.

If you're interested in a demo, let me know.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: