|
Replies:
29
-
Last Post:
Mar 4, 2009 5:59 AM
by: morrisford
|
|
|
|
|
|
|
jsr223 scripting languages
Posted:
Dec 30, 2008 4:37 PM
|
|
|
I have been working on getting scripting languages that are supported by jsr223 to work with the ScriptingComponent that I am building for version 0.5. In this process I am working to get the least common requirements such that all the scripting languages work correctly.
The languages I have made work so far in terms of capable of performing the minimum set of operations are
Jython Javascript Sleep Jruby Groovy
Currently working on
Php
There are quite a few more scripting languages that jsr223 supports and I plan to try to get more of them running, at least the ones that make sense in a Wonderland scripting environment.
Do you have a favorite scripting language that you would like to see on this list? Is it on the list on the scripting page? https://scripting.dev.java.net/
|
|
|
|
|
|
|
Re: jsr223 scripting languages
Posted:
Jan 5, 2009 11:25 AM
in response to: morrisford
|
|
|
Got php running also.
|
|
|
|
|
|
|
|
Re: jsr223 scripting languages
Posted:
Jan 5, 2009 11:37 AM
in response to: morrisford
|
|
|
Just a quick note:
Not all JVM's come with the scripting engines. In fact, I've only tried Mac OSX and it comes with only AppleScript. It seems technically feasible to distribute the scripting engine with our Java WebStart setup, which is probably the approach we should take if the client does not have the scripting engine installed. I haven't installed scripting engines myself, but a quick glance at the docs suggest it is just putting a jar or two in the classpath.
If we are going to redistribute these scripting engines with WL, we may (if they are not Sun code) have to go through an internal legal approval process. (We go through this process for all 3rd party libraries we redistribute with WL). It isn't horribly lengthly, but it could possibly slow us down, which I don't want to happen. Is there an order of importance for scripting engines? As in, do we want to aim to support Javascript first, and then Jython, and then ...., etc? If we can prioritize scripting engine support, I can get this ball rolling. (Also note: there may be other reasons to prioritize scripting engine support other than the legal review process).
|
|
|
|
|
|
|
|
Re: jsr223 scripting languages
Posted:
Jan 5, 2009 11:46 AM
in response to: jslott
|
|
|
I would think there would be two paths to supporting the various engines, 1 - include the jars for desired languages in the WL distribution and 2 - set up a simple mechanism for the user to get the jar files and install them. There are two methods for getting the jars, 1 - get them from the website for the language and 2 - copy them over from the java scripting download file that is downloadable from the java scripting web site. In fact most of the ones I have worked with had the jar files in the jsr-223 download. I suppose someone at Sun has already dealt with the legal issues if they have downloads for those jars. The first languages supported could well be the ones with engines included in the java scripting download.
|
|
|
|
|
|
|
|
Re: jsr223 scripting languages
Posted:
Jan 5, 2009 11:57 AM
in response to: morrisford
|
|
|
I think we want scripting support to be seamless, that is, we don't want users to have to download something separately. Given that many end users won't be technically savvy, the separate download may pose a problem (especially since it likely involves editing CLASSPATH too). I'd vote for #1.
> I suppose someone at Sun has already dealt with the legal issues if they have downloads for > those jars.
We need to evaluate the licenses for each of the scripting engines with specific application to the licensing surrounding WL, regardless of whether it is available for download elsewhere on a Sun-sponsored site. I'm not saying this is a difficult process, but one that I'd like to start sooner rather than later.
|
|
|
|
|
|
|
|
Re: jsr223 scripting languages
Posted:
Jan 5, 2009 11:59 AM
in response to: jslott
|
|
|
What do you need from me then?
|
|
|
|
|
|
|
|
Re: jsr223 scripting languages
Posted:
Jan 5, 2009 12:04 PM
in response to: morrisford
|
|
|
Ah! Just an list of what scripting engines you'd like to support, in order of preference. Start with JavaScript? Or another one?
|
|
|
|
|
|
|
|
Re: jsr223 scripting languages
Posted:
Jan 5, 2009 12:19 PM
in response to: jslott
|
|
|
I would think that javascript and applescript should be first because they are the two languages shipped with the respective versions of java. I will have to get the jsr223 engine files for applescript to see if I can figure it out enough to make it work. rdk that just posted, the first person to give any feedback about languages, asked for javafx and scala, neither of which do I have any experience with. If I or someone can get those to two to work well enough I would think they would be next since someone has asked for them. Next, of the languages I have worked with, jython, jruby, sleep, groovy, php in whatever order. That would make
javascript applescript javafx scala jython jruby sleep groovy php
|
|
|
|
|
|
|
|
Re: jsr223 scripting languages
Posted:
Jan 5, 2009 12:40 PM
in response to: morrisford
|
|
|
Hi Morris, Thanks for the priority but in all good conscience, I wouldn't put Scala high on the list, merely on the list.
My priorities would thus go: - JavaScript (due to presence and support) - AppleScript (per Jordan's comment re. Macs default) - Groovy (most Java-like yet slightly functional) - JavaFX (if we get EmbeddedFX, we'll want this ready to make amazing apps! Has neat binding capabilities that will work well for eventing) (the rest... - Jython - JRuby - Scala - Sleep - PHP )
R.
|
|
|
|
|
|
|
|
Re: jsr223 scripting languages
Posted:
Jan 5, 2009 3:20 PM
in response to: morrisford
|
|
|
I'm not sure I understand why there is a need to support so many scripting languages. Is this necessary? Not trying to be contentious... just curious what the rationale is.
My top three are:
Javascript JavaFX Jython
|
|
|
|
|
|
|
|
Re: jsr223 scripting languages
Posted:
Jan 6, 2009 12:39 AM
in response to: kaplanj
|
|
|
I fully agree with you Jonathan. -michel
|
|
|
|
|
|
|
|
Re: jsr223 scripting languages
Posted:
Jan 6, 2009 10:18 AM
in response to: kaplanj
|
|
|
wonderland@javadesktop.org wrote: > Good point! I think there is a question of philosophy here: I would much rather support 2 scripting languages with extensive integration into Wonderland than 10 with minimal integration. > I agree. I especially feel that the Javascript support must be rock solid, as it is the lingua franca of the internet.
|
|
|
|
|
|
|
|
Re: jsr223 scripting languages
Posted:
Jan 6, 2009 8:06 AM
in response to: matty_x
|
|
|
"I'm not sure I understand why there is a need to support so many scripting languages. Is this necessary? Not trying to be contentious... just curious what the rationale is."
First of all, it never hurt to showcase and demonstrate the versatility and endless power of the Java platform and JVM through support of myriad scripting languages. It will further advance the Java technology and community if there is greater interest and ongoing innovation surrounding Java. It will create a network effect of more interesting languages (eg clojure, scala) that built on top of the powerful Java JVM. Beside, the advancement and power of JVM might just provide the perfect experimental testbed for innovative language enhancement to the underlying language, eg JRuby's unique feature might just port back to Ruby.
Secondly, no one knows where this innovation leads to, and it may create business opportunity for for innovative products eg productivity tools and utilities, Java IDE for scripting language. Moreover, developers have wider choice of the scripting language to incorporate into their products for system automation eg built-in JRuby/JavaScript/JPython to automate Java application, just like VisualBasicForApplication exists for MS Office Suite.
|
|
|
|
|
|
|
|
Re: jsr223 scripting languages
Posted:
Jan 6, 2009 8:13 AM
in response to: geekycoder
|
|
|
Well, which means that developers get to choose their favourite scripting language that run on Java, and their boss wouldn't accuse them of not running anything that is not Java <:^} ... In some organizations, Java is still the standardizard language and platform of choice, and using scripting language that run on Java JVM means that everything is still Java, doesn't it ? Developer get to use their favourite language (python, ruby, php, groovy, javafx, javascript etc) and still conform to org's standard. So choice is good.
|
|
|
|
|
|
|
|
Re: jsr223 scripting languages
Posted:
Jan 6, 2009 10:23 AM
in response to: geekycoder
|
|
|
wonderland@javadesktop.org wrote: > "I'm not sure I understand why there is a need to support so many scripting languages. Is this necessary? Not trying to be contentious... just curious what the rationale is." > > First of all, it never hurt to showcase and demonstrate the versatility and endless power of the Java platform and JVM through support of myriad scripting languages. It will further advance the Java technology and community if there is greater interest and ongoing innovation surrounding Java. It will create a network effect of more interesting languages (eg clojure, scala) that built on top of the powerful Java JVM. > Beside, the advancement and power of JVM might just provide the perfect experimental testbed for innovative language enhancement to the underlying language, eg JRuby's unique feature might just port back to Ruby. > > Secondly, no one knows where this innovation leads to, and it may create business opportunity for for innovative products eg productivity tools and utilities, Java IDE for scripting language. > Moreover, developers have wider choice of the scripting language to incorporate into their products for system automation eg built-in JRuby/JavaScript/JPython to automate Java application, just like VisualBasicForApplication exists for MS Office Suite. > [Message sent by forum member 'geekycoder' (geekycoder)] > > http://forums.java.net/jive/thread.jspa?messageID=324298 > I generally agree with this, but given the extremely limited resources of the team it is best to focus on the maximum bang for the buck. Of the languages that we have been discussing, I believe that if we provide good Javascript and Python support we'll be meeting the needs of 80-90% of the people who are going to want to write Wonderland scripts. Javascript because it is one of the most popular languages out there and Python because it is one of the most popular scripting languages for gaming. In the future we may be able to provide virtual tower of babel of scripting languages but for now I would recommend concentrating our resources on the sweet spot.
|
|
|
|
|
|
|
|
Re: jsr223 scripting languages
Posted:
Jan 6, 2009 10:58 AM
in response to: Deron Johnson
|
|
|
I am really unclear where the idea came from about the amount of support necessary for supporting scripting languages. I have already done the work to support the list of languages that was posted at the start of this thread. Perhaps this misconception came from the idea that any language supported through the jsr223 mechanism will require massive changes to the scripting language itself in order to function with Wonderland. In reality, the structure I created allows ANY scripting language that is implemented for use with jsr223 and has the syntax for a few specific operations will work as is. If there are characteristics of interfacing to WL that require language specific changes I am unaware of them.
|
|
|
|
|
|
|
|
Re: jsr223 scripting languages
Posted:
Jan 5, 2009 12:03 PM
in response to: morrisford
|
|
|
- JavaFX - Scala (ok, it's a minority request but who isn't a fan!?) R. p.s. Back from hols and about to pull your scripting stuff and start playing! Thanks for creating & sharing!
|
|
|
|
|
|
|
|
Re: jsr223 scripting languages
Posted:
Jan 5, 2009 12:11 PM
in response to: rkd
|
|
|
Do you know where I can find the jsr223 engines for these two languages?
|
|
|
|
|
|
|
|
Re: jsr223 scripting languages
Posted:
Jan 5, 2009 12:56 PM
in response to: morrisford
|
|
|
My vote is: JavaScript as no.1 priority, as it is the ECMA(script) standard, and not so far from Java.
BTW if there are conflicts between number of scripting languages supported and amount of scripting functionality supported, then I'd vote for limiting the number of scripting languages to a couple of them (like JavaScript and Jython) while increasing the amount of scripting functionality supported.
Thanks .. michel
|
|
|
|
|
|
|
|
Re: jsr223 scripting languages
Posted:
Jan 5, 2009 1:08 PM
in response to: micheldenis
|
|
|
Based on the structure I have right now, the languages I listed as the ones I have working all have the same functionality in terms of interacting with the ScriptingComponent. This functionality amounts to passing data to and from the script and the script being able to call methods in the calling class. The ScriptingComponent takes care of getting control over to the script upon occurrance of an event thereby removing the need for any event handling capability in the script. Of course each scripting language has its own strengths and syntactic differences but the interface to WL should work.
|
|
|
|
|
|
|
|
Re: jsr223 scripting languages
Posted:
Jan 5, 2009 1:12 PM
in response to: morrisford
|
|
|
I am going to have to get the scripting engines and scripting libraries for javafx, scala and applescript in order to verify that they will work properly and what the syntax is that allows the interface to work. Any assistance would be greatly appreciated with finding the files. I have a Mac but it is a 32bit system which precludes using the Apple 1.6 java. Anyone know if the applescript jars are downloadable from somewhere so I can give 'em a try on my Ubuntu system?
|
|
|
|
|
|
|
|
Re: jsr223 scripting languages
Posted:
Jan 5, 2009 1:24 PM
in response to: morrisford
|
|
|
wonderland@javadesktop.org wrote: > I am going to have to get the scripting engines and scripting libraries for javafx, scala and applescript in order to verify that they will work properly and what the syntax is that allows the interface to work. Any assistance would be greatly appreciated with finding the files. I have a Mac but it is a 32bit system which precludes using the Apple 1.6 java. Anyone know if the applescript jars are downloadable from somewhere so I can give 'em a try on my Ubuntu system? > [Message sent by forum member 'morrisford' (morrisford)] > > http://forums.java.net/jive/thread.jspa?messageID=324164 > It sounds like there is no disagreement that Javascript is number 1. After that, I would suggest that Jython be #2 or #3.
|
|
|
|
|
|
|
|
Re: jsr223 scripting languages
Posted:
Jan 5, 2009 1:40 PM
in response to: Deron Johnson
|
|
|
Any indication of the time lag between getting legal approval for languages? If the time is short, many of these could be done by the time a scripting environment is ready.
|
|
|
|
|
|
|
|
Re: jsr223 scripting languages
Posted:
Jan 5, 2009 1:47 PM
in response to: morrisford
|
|
|
In general, a few weeks (but each language can be done in parallel).
|
|
|
|
|
|
|
|
Re: jsr223 scripting languages
Posted:
Jan 5, 2009 1:48 PM
in response to: Deron Johnson
|
|
|
Python/Jython is very popular with gaming engines .. it could attract that community to Wonderland. Maybe it could be good to have it as #2
-michel
|
|
|
|
|
|
|
|
Re: jsr223 scripting languages
Posted:
Feb 26, 2009 5:16 PM
in response to: rkd
|
|
|
It would be really great to support JavaFX for a number of reasons. It is timely with WL -- both are new. Co-maturity strengthens both products. And both are gaining popularity very fast. Another reason is that the concept of one application multiple platforms is a perfect concept for 3-D building and scripting. Imagine writing a JavaFX applet, dragging it from the browser to your desktop, and then dropping it into WL! (Now all we have to do is implement it!) Sounded cool, didn't it?
|
|
|
|
|
|
|
|
Re: jsr223 scripting languages
Posted:
Feb 26, 2009 8:24 PM
in response to: nnjones
|
|
|
There's no question that this is a good idea. We have been in talks with the JavaFX team and are considering options for how to do an integration. This is definitely a project for after v0.5 however.
Nicole.
|
|
|
|
|
|
|
|
Re: jsr223 scripting languages
Posted:
Feb 27, 2009 3:14 AM
in response to: nnjones
|
|
|
Hi,
I think support for Javafx and jsr223 would be great. Not only in the context of dragging jfx applets from the browser, but also jfx portlets from a portal and having it work off your desktop. Check out the video here http://blogs.sun.com/pdblog/entry/amphibious_portlets .
two thumbs up for the idea  Cheers su./hail
wonderland@javadesktop.org wrote: > It would be really great to support JavaFX for a number of reasons. It is timely with WL -- both are new. Co-maturity strengthens both products. And both are gaining popularity very fast. Another reason is that the concept of one application multiple platforms is a perfect concept for 3-D building and scripting. Imagine writing a JavaFX applet, dragging it from the browser to your desktop, and then dropping it into WL! (Now all we have to do is implement it!) Sounded cool, didn't it? > [Message sent by forum member 'nnjones' (nnjones)] > > http://forums.java.net/jive/thread.jspa?messageID=334116 > >
|
|
|
|
|
|
|
|
Re: jsr223 scripting languages
Posted:
Mar 4, 2009 5:59 AM
in response to: Suhail Manzoor
|
|
|
JavaFX will run as a jsr223 language. I have done very preliminary tests just to ensure that the interface will work. As I get time I will run some more tests and try to write a few simple scripts to see what happens. After that I should be able to say that JavaFX is a usable scripting language in WL.
|
|
|
|
|