Hi,

I'm working with a proprietary dynamic scripting language which has quite some 
similarities with Ruby.
It is also based on a C-based executable which means that it isn't easy to use 
libraries written in Java.

Therefore I'd like to write an interpreter for this language that runs on the 
JVM, but I'm wondering how best to approach this?

Writing my own language framework from scratch is far more than I could ever do 
(in terms of time and skills).

Since my language is conceptually similar to Ruby I thought I could reuse a lot 
of JRuby code to do this.
I started to look at the JRuby code, but quickly realized that this isn't going 
to be straightforward either,
e.g. org.jruby.Ruby cannot be subclassed because it's declared final.
Looking a bit deeper I've seen other places that are equally difficult to 
change.

So, before I run too far into a wrong direction, I'd like to get a 
recommendation of how to best take off:

-       By branching JRuby and:

o    hack it so it can interpret my own language instead of Ruby (but in the 
code the classes will still be called Ruby, e.g. "RubyString" instead of 
"MylanguageString")?

o    modify all places that prevent subclassing, and write my language 
implementation as subclasses?

o    Modify/extend it in order to provide all necessary APIs, so that I can 
write my language implementation by delegating the hard stuff to JRuby?

-       By writing an interpreter for my language in Ruby and use APIs for 
creating JRuby AST, etc.?

-       May Rubinius help me?

-       Or any other idea?

An important aspect is that I do not want lose the ability to get updates on 
JRuby merged into my own language implementation.

I tried to look out for other language implementations that might have done 
that before, but couldn't find one.

Looking at this more visionary I could imagine that the core parts of JRuby 
could be the basis for a dynamic language framework.
It would be shipped with an implementation for Ruby (->JRuby), but it would 
allow for writing other implementations (e.g. for Python, PHP, JavaScript, ...) 
on top of it much more easily than from scratch.
Are there any thoughts into this direction?

Jürgen

Reply via email to