Jump to content
  • Advertisement
Sign in to follow this  
HellCreator

[java] Scripting engine in Java - Do We Really Need Them?

This topic is 4868 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Question to Java Guru! Need some lightweidth script engine like lua to embed into java applet and app OR may be java have one ? I know about using javac via System at run time and then loadin via reflection but it is imposible in applet. Realy do I need this stuff ? Just because recompilation less - YES! Found this http://www.beanshell.org comments if any? [Edited by - HellCreator on February 15, 2005 2:33:47 AM]

Share this post


Link to post
Share on other sites
Advertisement
Well, you never really "need" a scripting engine because it's possible to do anything you can with a scripting engine, with precompiled code.

You might find it advantageous under some circumstances to use a scripting engine though.

Regarding using javac in an applet, no you can't, but you *can* run a server-side script which runs javac and returns the class file(s) (perhaps in a jar).

You should look at Rhino (javascript engine written in Java, uses reflection) to achieve what I think you're trying to.

Mark

Share this post


Link to post
Share on other sites
Having scriptable events/code makes the software development cycle easier. You can adjust a script without having to recompile the entire application. Once you have finalised the script you can either hard code it or leave it scripted. Scripting also allows for a lot of extensibility in a system as well.


The best scripting engine I have found for use in Java is Beanshell (which you already found), as it integrates seamlessly.

[edit] spelling

Share this post


Link to post
Share on other sites
Or you could just use XML. You can store anything you want in XML, so it would be a good replacement for a scripting engine. Plus Java provides an API for loading XML already.

Share this post


Link to post
Share on other sites
Thanks for all replays
I found verry interesting Rhino and Beanshell.
The mission is - do not force the end user to dowload and ah to install libraries required to app or applet and do not doing any server side action because engine may be oriented for runing on client mashine only without installing any servers localy.

Share this post


Link to post
Share on other sites
Quote:
Original post by CaptainJester
Or you could just use XML. You can store anything you want in XML, so it would be a good replacement for a scripting engine. Plus Java provides an API for loading XML already.

but - do java provide proccessing stored data as class object or class function
it is what the scripting do?

Share this post


Link to post
Share on other sites
Quote:
Original post by HellCreator
The mission is - do not force the end user to dowload and ah to install libraries required to app or applet and do not doing any server side action because engine may be oriented for runing on client mashine only without installing any servers localy.

In case you decided against jython because of those reasons you might want to reconsider. Jython doesn't put any prerequisies on client or server, you just have to pack a 700k library together with your app/applet.

Besides, python is an awesome language =)

Share this post


Link to post
Share on other sites
Quote:
Original post by HellCreator
but - do java provide proccessing stored data as class object or class function
it is what the scripting do?


I believe you can do that with reflection. However, I am not sure I understand what you are saying. Can you explain a bit more?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!