Interoperatability with Java in a scripting language

  • Thread starter =?iso-8859-1?B?bW9vcJk=?=
  • Start date
?

=?iso-8859-1?B?bW9vcJk=?=

Hi,
I am building my own scripting language(or dynamic language, whatever)
in Java. I wish can user other Java library inside the language,
calling methods of Java objects.
In this language, only three types of primitive data types, which are
numeric, string and boolean. I can map these three kinds of data types
to those of Java. But dont know how to invoke Java method properly. I
am considering Reflection(and seems it is the only way to do so) to
call Java methods, but confused with handling class constructor and
array mapping questions. Any one can give me suggestion or recommend
some existed projects for reference? Thanks!
 
C

Chris Uppal

moopT said:
I am building my own scripting language(or dynamic language, whatever)
in Java. I wish can user other Java library inside the language,
calling methods of Java objects. [...]
Any one can give me suggestion or recommend
some existed projects for reference? Thanks!

There are lots of pre-existing projects that you can look at, implemented in
various ways, and with different degrees of sophistication. Some names for
Google:
Groovy
Nice
Jython
Hecl
There are lots more, but I can't think of them offhand.

-- chris
 
D

David N. Welton

Chris said:
moopT wrote:
There are lots of pre-existing projects that you can look at, implemented in
various ways, and with different degrees of sophistication. Some names for
Google:
Groovy
Nice
Jython
Hecl
There are lots more, but I can't think of them offhand.

We've been doing something right if you thought of Hecl:)

As for the question at hand, in normal, J2SE Java, the other poster
probably wants to look at how something like BeanShell or Groovy
utilizes/handles reflection to get at Java classes and methods.

Hecl, on the other hand, if I do say so myself, is a nice example
because it's very small and simple.

--
David N. Welton
- http://www.dedasys.com/davidw/

Linux, Open Source Consulting
- http://www.dedasys.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top