From "Script_on_Java", I came to know about new release (1.16.6) of SISC - Java based interpreter for Scheme. I updated the JSR-223 engine for Scheme @ scripting.dev.java.net to use SISC version 1.16.6.
As I mentioned earlier, I spoke at Sun Tech Days 2007. About 10000 folks attended Sun Tech Days. Approximately about 2000 folks attended each talk (at least in the ones in the "main" room where key notes talks were given). Very nice to see so many developers at one place! I think over the years, Sun Tech Days is growing to become like JavaOne. Kannan and I traveled from Chennai to Hyderabad to attend this event.
This year I gave two talks. In the talk titled "Java SE Language Features - JDK 5.0, 6 and Future", I covered mostly the language features of JDK 5.0. Because there are no Java language features in JDK 6, I covered javac's APIs (JSR 199, JSR 269 and Tree API). For JDK 7, I gave few web references (on closures etc.). The scripting talk is the one we (Mike Grogan and I) gave many times
Good news - we won't be talking on scripting in JavaOne 2007
.
I didn't have time for Q&A after the scripting talk. We [Charles Nutter and I] answered few scripting questions outside the lecture hall. Summary of the Q & A:
The slides are usually posted at Sun Tech Days site few days after the event. But if you are impatient, you can download the slides for the talks that I gave
jsr-223 defines scripting API for the Java platform -- so that Java programs can execute scripts written in various scripting languages. As you'd probably know already, JDK 6 includes javax.script API and JavaScript engine in it. One of the facilities of javax.script API is script Bindings. Through the javax.script.Bindings interface, you can expose your application objects as global variables to your scripts. Ideally, you want to access global variables by the same name as key names in Bindings. But, there are some language specific complications in exposing global variables. Not every language has global scope - for example, Java. So, the script engine for Java looks for special setScriptContext static method to expose current context to the "script". In JRuby, global variables are always "$" prefixed - the prefixing is done by jsr-223 script engine for JRuby - so that your Bindings may have "foo" as key and your JRuby script may use "$foo". In addition, there are also some implementation specific complications in implementing JSR-223 Bindings. We will look at some specific cases below.
SISC implementation has been used to implement jsr-223 engine for Scheme. The way jsr-223 Bindings works in Scheme script engine is as follows:
Scheme user has to use "var" procedure to access/update the variables exposed by
jsr-223 bindings. To access variable "foo" from Scheme, you use (var 'foo). To
update variable "foo", you need to use (var 'foo <value>).
For example, you can use the following expression to print the current file name.
(display (var 'javax.script.filename))
The following expression
(var 'context)
can be used to access the current script context from Scheme.
TCL (Jacl) user has to use "var" procedure to access/update the variables exposed by jsr-223 bindings. To access variable "foo" from Tcl, you need to use [var "foo"]. To update variable "foo", you need to use
var "foo" <value>;
For example, you can use the following expression to print the current file name.
echo [var "javax.script.filename"]
Similarly, the following expression
var "context"
can be used to access the current script context from Tcl.
F3 is statically typed language. You may want to refer to F3 and JSR-223 to check how jsr-223 Bindings is implemented in F3.
Have you registered for Sun Tech Days - Hyderabad - Feb 21-23? Meet you at Hyderabad....
Jython 2.2 beta1 has been released recently. I updated jsr-223 script engine for Jython @ scripting.dev.java.net to use Jython 2.2 beta1 version.
No, this is not about scratching head when your manager asks for status
I'm talking about the M.I.T Scratch programming language which is based on Squeak. I just downloaded Windows version and played with it for sometime. My son played with it too! They have a very nice Getting Started Guide!