Fixes for JSR-223

12 messages Options
Embed this post
Permalink
Alessio Stalla

Fixes for JSR-223

Reply Threaded More More options
Print post
Permalink
I have committed a little set of modifications to the JSR-223 code. I
had left a big, stupid bug in the compilation through the Compilable
interface. The rest is basically minor fixes and refactoring.
There are still some things I'd like to improve, but it seems the
feature is not used that much (nobody complained for the compilation
not working!), so I guess it's not high on the priority list.

On a different subject, I have a preliminary working version of my
Swing DSL. The core is working and should remain quite stable. The
number of widgets, properties, events etc. supported is ridiculously
small, and there are many missing features to add, but I think it's
usable for simple things now. So, Erik and others, if it's ok to you I
can try using it for a simple GUI for invoking restarts. In that
eventuality, we'll have to decide if and how to package the thing with
ABCL; I'd go for an optional module but I don't know if there's the
infrastructure for something like that.

That's all for now.

Bye,
Alessio

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
armedbear-j-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/armedbear-j-devel
Peter Tsenter

Re: Fixes for JSR-223

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
> I guess it's not high on the priority list.
 
That's not true. The only reason I turned to abcl that this is the most (best) ANSI compliant implementation of Common Lisp running on JVM. And your implementation of JSR-223 is a big step in the right direction. The next would be to make a message associated with a thrown exception (much) more informative.
I don't care about standalone application, but as a scripting language, abcl was the easiest to incorporate into my application. And I did try JavaCC and ANTLR.
Regarding the bug: I did what was necessary to make it work.
And one more thing: if you substituted a line
 
        ScriptEngine lispEngine = new ScriptEngineManager().getEngineByExtension("lisp");
 
with the following three

        ScriptEngineManager scriptManager = new ScriptEngineManager();
        scriptManager.registerEngineExtension("lisp", new AbclScriptEngineFactory());
        ScriptEngine lispEngine = scriptManager.getEngineByExtension("lisp");
 
(or similar) it would make your example self-contained.



Hotmail® goes with you. Get it on your BlackBerry or iPhone.
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
armedbear-j-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/armedbear-j-devel
Ville Voutilainen

Re: Fixes for JSR-223

Reply Threaded More More options
Print post
Permalink
In reply to this post by Alessio Stalla
On Fri, May 8, 2009 at 12:36 AM, Alessio Stalla <[hidden email]> wrote:
> There are still some things I'd like to improve, but it seems the
> feature is not used that much (nobody complained for the compilation
> not working!), so I guess it's not high on the priority list.

Well, I do plan to write examples (if needed) for various features that the
current scripting implementation supports, but I keep finding new things to
fix in the mean time. Thus my work on scripting gets postponed all the
time. I have plans to use our scripting support for some applications, but
as that is outside my work-life, there's a very limited amount of time I
have for it.

I've been a vocal proponent of having JSR-223 in abcl from the very beginning
of my participation in this project, and I believe it to be an
immensely important
feature for us.

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
armedbear-j-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/armedbear-j-devel
Alessio Stalla

Re: Fixes for JSR-223

Reply Threaded More More options
Print post
Permalink
In reply to this post by Peter Tsenter
On Fri, May 8, 2009 at 7:31 PM, Peter Tsenter <[hidden email]> wrote:
>> I guess it's not high on the priority list.
>
> That's not true. The only reason I turned to abcl that this is the most
> (best) ANSI compliant implementation of Common Lisp running on JVM. And your
> implementation of JSR-223 is a big step in the right direction.

Well, thanks! (to Ville too :) However, don't be afraid, I wasn't
saying I would stop working on JSR-223; just that I'm focusing on
other things now, but from time to time I manage to work a bit on it
too. That's how I discovered the silly bug in compileScript - prin1
instead of princ! How n00b of me. The funny thing is that in theory I
have unit tests to check these things, gotta remember running them
before SVN commit!

> The next would be to make a message associated with a thrown exception (much)
> more informative.

Yes, that's one of the things I'd like to improve. Another important
one is that the debugger-hook that throws Java exceptions, instead of
dropping you in the interactive Lisp debugger, has still some issues -
it doesn't appear to work in all cases. I'd also like more Java
integration in general, I was thinking of offering an easy Lisp
interface to e.g. collections, URLs, streams... (I'm working on Swing
right now).

> I don't care about standalone application, but as a scripting language, abcl
> was the easiest to incorporate into my application. And I did try JavaCC and
> ANTLR.

Heh, I guess having a built-in parser, interpreter and compiler is quite nice :)

> Regarding the bug: I did what was necessary to make it work.

Ok, now my fix is on SVN, too. If you have other bug fixes,
improvements, or ideas please let me know. For example, one design
decision I'm not very sure about is the default package of code
executed under JSR-223 being abcl-script-user instead of cl-user.
abcl-script-user USEs cl, abcl-script and java, so it's probably nicer
to use, but has its issues too (mainly, you have to remember you are
not in cl-user).

> And one more thing: if you substituted a line
>
>         ScriptEngine lispEngine = new
> ScriptEngineManager().getEngineByExtension("lisp");
>
> with the following three
>
>         ScriptEngineManager scriptManager = new ScriptEngineManager();
>         scriptManager.registerEngineExtension("lisp", new
> AbclScriptEngineFactory());
>         ScriptEngine lispEngine =
> scriptManager.getEngineByExtension("lisp");
>
> (or similar) it would make your example self-contained.

Hmm, I thought my example was already self-contained, because of the
ServiceProvider machinery that should automatically register
ScriptEngineFactories looking at a file in META-INF, inside abcl.jar.
Doesn't this work for you? In any case, I should add a comment to the
example explaining this, and the manual registration of the factory,
just to be sure.

Bye,
Alessio

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
armedbear-j-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/armedbear-j-devel
Erik Huelsmann

Re: Fixes for JSR-223

Reply Threaded More More options
Print post
Permalink
In reply to this post by Peter Tsenter
Hi Peter,

On Fri, May 8, 2009 at 7:31 PM, Peter Tsenter <[hidden email]> wrote:
>> I guess it's not high on the priority list.
>
> That's not true. The only reason I turned to abcl that this is the most
> (best) ANSI compliant implementation of Common Lisp running on JVM. And your
> implementation of JSR-223 is a big step in the right direction.

You really made us (the developers) really proud and happy with that
statement, at least, that's what happened to Ville and me, I presume
the same happened to Alessio.

We have a testimonials page which would be a great place to put a
statement like this. Things to include would be what you use ABCL for
(including the type of application in which it's embedded) and whether
you use ABCL commercially or not.

> The next would be to make a message associated with a thrown exception (much)
> more informative.

We have a lot of improvement to go, but really intend to make it happen too.

If there's anything specific that you like/need to get handled, please
report so that we can try to do something about it.

Bye,


Erik.

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
armedbear-j-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/armedbear-j-devel
Alessio Stalla

Re: Fixes for JSR-223

Reply Threaded More More options
Print post
Permalink
On Mon, May 11, 2009 at 4:24 PM, Erik Huelsmann <[hidden email]> wrote:

> Hi Peter,
>
> On Fri, May 8, 2009 at 7:31 PM, Peter Tsenter <[hidden email]> wrote:
>>> I guess it's not high on the priority list.
>>
>> That's not true. The only reason I turned to abcl that this is the most
>> (best) ANSI compliant implementation of Common Lisp running on JVM. And your
>> implementation of JSR-223 is a big step in the right direction.
>
> You really made us (the developers) really proud and happy with that
> statement, at least, that's what happened to Ville and me, I presume
> the same happened to Alessio.

Yes, you're right, it's the first time something I do "for fun" gets
used by someone else, and it's flattering to know it's actually
useful. Of course, my work is just a tiny addition to a great system,
it doesn't add much functionality but perhaps makes the existing ones
more accessible to Java developers (or Lisp developers forced to work
in Java :).

Ale

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
armedbear-j-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/armedbear-j-devel
Ville Voutilainen

Re: Fixes for JSR-223

Reply Threaded More More options
Print post
Permalink
On Mon, May 11, 2009 at 6:42 PM, Alessio Stalla <[hidden email]> wrote:
> Yes, you're right, it's the first time something I do "for fun" gets
> used by someone else, and it's flattering to know it's actually
> useful. Of course, my work is just a tiny addition to a great system,
> it doesn't add much functionality but perhaps makes the existing ones

I strongly disagree, you're giving JSR-223 support much too less credit. :)
It makes lisp a first-class javax.script citizen, for which abcl is the only
known implementation, which gives abcl lots of new potential
uses/users, and gives it positive
publicity. In contrast to other languages, I believe lisp can be used
for extending
java in ways not possible (or tedious) with java itself, some examples being

1) being able to emulate multiple inheritance
2) being able to write call delegation in a concise manner
3) being able to generate full object hierarchies from lisp code, parameterized
by user-provided data
4) injecting aspects on top of existing java classes
5) I'm sure there's more..

Sure, some of these require making runtime-class to work (and perhaps some
additional facilities for our scripting support, the additional
this-objects that
we discussed before), and are not necessarily specific to javax.script
on top of lisp
(many of these can be done with abcl directly), but having them accessible
through a common interface (javax.script) means that there are more potential
users for such java-extensions provided through scripts.

All in all, I think javax.script support opens a whole host of
interesting possibilities.
We haven't yet fully explored what is possible through it, which is
something that
I hope to have time to do in the future. We'll see when we write more examples.

-VJV-

P.S. I tried to contact some java people who maintain scripting
support, I asked if
they could add a mention of abcl on their list of javax.script
implementations (at
https://scripting.dev.java.net/), but unfortunately I haven't received
a response yet.

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
armedbear-j-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/armedbear-j-devel
Alessio Stalla

Re: Fixes for JSR-223

Reply Threaded More More options
Print post
Permalink
On Mon, May 11, 2009 at 6:58 PM, Ville Voutilainen
<[hidden email]> wrote:

> On Mon, May 11, 2009 at 6:42 PM, Alessio Stalla <[hidden email]> wrote:
>> Yes, you're right, it's the first time something I do "for fun" gets
>> used by someone else, and it's flattering to know it's actually
>> useful. Of course, my work is just a tiny addition to a great system,
>> it doesn't add much functionality but perhaps makes the existing ones
>
> I strongly disagree, you're giving JSR-223 support much too less credit. :)
> It makes lisp a first-class javax.script citizen, for which abcl is the only
> known implementation, which gives abcl lots of new potential
> uses/users, and gives it positive
> publicity. In contrast to other languages, I believe lisp can be used
> for extending
> java in ways not possible (or tedious) with java itself, some examples being
>
> 1) being able to emulate multiple inheritance
> 2) being able to write call delegation in a concise manner
> 3) being able to generate full object hierarchies from lisp code, parameterized
> by user-provided data
> 4) injecting aspects on top of existing java classes
> 5) I'm sure there's more..

Hehe, I hadn't even thought about those... originally I just thought,
I'd like my application to be scripted, and I'd like to script it in
Lisp but leave the door open for other languages too. The application
has been put on hiatus now, but the JSR-223 thing has luckily grown
more important :)

> Sure, some of these require making runtime-class to work (and perhaps some
> additional facilities for our scripting support, the additional
> this-objects that
> we discussed before),

yeah, that's another point I'd like to improve soon, support for it
exists in the Lisp-side but there's still no way to use it from Java
via AbclScriptEngine.

> and are not necessarily specific to javax.script
> on top of lisp
> (many of these can be done with abcl directly), but having them accessible
> through a common interface (javax.script) means that there are more potential
> users for such java-extensions provided through scripts.
>
> All in all, I think javax.script support opens a whole host of
> interesting possibilities.
> We haven't yet fully explored what is possible through it, which is
> something that
> I hope to have time to do in the future. We'll see when we write more examples.
>
> -VJV-
>
> P.S. I tried to contact some java people who maintain scripting
> support, I asked if
> they could add a mention of abcl on their list of javax.script
> implementations (at
> https://scripting.dev.java.net/), but unfortunately I haven't received
> a response yet.

Yes, I've seen your mail, I haven't been contacted either.

Alessio

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
armedbear-j-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/armedbear-j-devel
Peter Tsenter

Re: Fixes for JSR-223

Reply Threaded More More options
Print post
Permalink
In reply to this post by Alessio Stalla
Some javascript/style in this post has been disabled (why?)
> Hmm, I thought my example was already self-contained, because of the
> ServiceProvider machinery that should automatically register
> ScriptEngineFactories looking at a file in META-INF, inside abcl.jar.
> Doesn't this work for you? In any case, I should add a comment to the
> example explaining this, and the manual registration of the factory,
> just to be sure.

Probably, there is a bug in Ant build (the only I use), which prevents file you mentioned to be placed in the jar.


Windows Live™: Keep your life in sync. Check it out.
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
armedbear-j-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/armedbear-j-devel
Alessio Stalla

Re: Fixes for JSR-223

Reply Threaded More More options
Print post
Permalink
On Mon, May 11, 2009 at 10:37 PM, Peter Tsenter <[hidden email]> wrote:

>> Hmm, I thought my example was already self-contained, because of the
>> ServiceProvider machinery that should automatically register
>> ScriptEngineFactories looking at a file in META-INF, inside abcl.jar.
>> Doesn't this work for you? In any case, I should add a comment to the
>> example explaining this, and the manual registration of the factory,
>> just to be sure.
>
> Probably, there is a bug in Ant build (the only I use), which prevents file
> you mentioned to be placed in the jar.
>

Strange, I use only the Ant build too (in fact, if there's a bug I'd
expect it to be in the Lisp build). I'll try to understand better what
Ant does, maybe in certain cases it doesn't work. Anyway, I have
updated the example as I said, it is now on trunk.

Bye,
Alessio

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
armedbear-j-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/armedbear-j-devel
Peter Tsenter

Re: Fixes for JSR-223

Reply Threaded More More options
Print post
Permalink
In reply to this post by Erik Huelsmann
Some javascript/style in this post has been disabled (why?)
I'd like to place some testimonial on your page, but haven't been able to find out how to do it.
 

> Date: Mon, 11 May 2009 16:24:03 +0200
> Subject: Re: [j-devel] Fixes for JSR-223
> From: [hidden email]
> To: [hidden email]
> CC: [hidden email]; [hidden email]
>
> Hi Peter,
>
> On Fri, May 8, 2009 at 7:31 PM, Peter Tsenter <[hidden email]> wrote:
> >> I guess it's not high on the priority list.
> >
> > That's not true. The only reason I turned to abcl that this is the most
> > (best) ANSI compliant implementation of Common Lisp running on JVM. And your
> > implementation of JSR-223 is a big step in the right direction.
>
> You really made us (the developers) really proud and happy with that
> statement, at least, that's what happened to Ville and me, I presume
> the same happened to Alessio.
>
> We have a testimonials page which would be a great place to put a
> statement like this. Things to include would be what you use ABCL for
> (including the type of application in which it's embedded) and whether
> you use ABCL commercially or not.
>
> > The next would be to make a message associated with a thrown exception (much)
> > more informative.
>
> We have a lot of improvement to go, but really intend to make it happen too.
>
> If there's anything specific that you like/need to get handled, please
> report so that we can try to do something about it.
>
> Bye,
>
>
> Erik.


Insert movie times and more without leaving Hotmail®. See how.
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables
unlimited royalty-free distribution of the report engine
for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
armedbear-j-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/armedbear-j-devel
Ville Voutilainen

Re: Fixes for JSR-223

Reply Threaded More More options
Print post
Permalink
On Tue, May 19, 2009 at 11:38 PM, Peter Tsenter <[hidden email]> wrote:
> I'd like to place some testimonial on your page, but haven't been able to
> find out how to do it.

Send a patch against the web page, or send the testimonial, one of our
committers (Erik or me or
Alessio) can commit the changes.

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables
unlimited royalty-free distribution of the report engine
for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
armedbear-j-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/armedbear-j-devel