Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2006

Tip: Looking for answers? Try searching our database.

Interoperatability with Java in a scripting language

Thread view: 
moop™ - 22 Feb 2006 06:35 GMT
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!
Chris Uppal - 22 Feb 2006 11:13 GMT
moopT wrote:

> 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
David N. Welton - 22 Feb 2006 20:46 GMT
> moopT wrote:
>
>>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
[quoted text clipped - 4 lines]
>     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.

Signature

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

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



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.