You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by sam ” <sk...@gmail.com> on 2011/08/08 20:45:53 UTC

scripting with proper module system?

Hey,

Is there a scripting support with proper module system (import modules from
repository somewhere)?

I know JSP can <%@page import="some.java.package"%> .

But, the "module" for JSP should be written in Java.. and deployed to felix
as an OSGi bundle  (or the jar could be added to CLASSPATH somewhere).

What I want is to develop entire application NOT using Java, in the
repository.
For example,  in Python, I want to:
      import some.module.foo

and it'll import  /var/pymodules/some/module/foo/__init__.py      or
something..

Looking at: http://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/
none of scripting support seems to have that capability.

Has anyone used/developed proper scripting support sling  (for any
language.. groovy, python, clojure.. etc), where you entirely ditched Java
development?
If so, what is your experience?  What is your development envirionment
like?  (step debugging, IDE..etc).  Is your scripting support open sourced?

Or, if I want to develop web application using scripting languages
(non-Java),  should I just use some other framework than Sling, and talk to
JCR through HTTP or something?

Re: scripting with proper module system?

Posted by sam ” <sk...@gmail.com>.
OSGi could be, for Java.
Whatever scala, python..etc provide is good enough for me.

On Mon, Aug 8, 2011 at 4:40 PM, Justin Edelson <ju...@justinedelson.com>wrote:

> On Mon, Aug 8, 2011 at 4:28 PM, sam ” <sk...@gmail.com> wrote:
> >>
> >> This is not true. It's certainly possible to write OSGi bundles which
> >> contain non-Java code. Not sure about Clojure or Jython, but you can
> >> definitely do this with Scala, Groovy, and JRuby without much drama.
> >>
> >>
> > Do you mean that Scala, Groovy, and JRuby can generate java classes that
> > sling JSPs can import?
> > But, don't you have to still create OSGi bundle from Scala, Groovy, or
> JRuby
> > and deploy to it felix  or put it in CLASSPATH?
>
> Yes. This is what I meant.
>
> >
> >
> > My goal is to avoid OSGi and Java as much as possible.
> >
>
> Then I don't understand. Your original email and subject line are
> looking for a "proper module system". OSGi is a "proper module
> system", no?
>

Re: scripting with proper module system?

Posted by Justin Edelson <ju...@justinedelson.com>.
On Mon, Aug 8, 2011 at 4:28 PM, sam ” <sk...@gmail.com> wrote:
>>
>> This is not true. It's certainly possible to write OSGi bundles which
>> contain non-Java code. Not sure about Clojure or Jython, but you can
>> definitely do this with Scala, Groovy, and JRuby without much drama.
>>
>>
> Do you mean that Scala, Groovy, and JRuby can generate java classes that
> sling JSPs can import?
> But, don't you have to still create OSGi bundle from Scala, Groovy, or JRuby
> and deploy to it felix  or put it in CLASSPATH?

Yes. This is what I meant.

>
>
> My goal is to avoid OSGi and Java as much as possible.
>

Then I don't understand. Your original email and subject line are
looking for a "proper module system". OSGi is a "proper module
system", no?

Re: scripting with proper module system?

Posted by sam ” <sk...@gmail.com>.
>
> This is not true. It's certainly possible to write OSGi bundles which
> contain non-Java code. Not sure about Clojure or Jython, but you can
> definitely do this with Scala, Groovy, and JRuby without much drama.
>
>
Do you mean that Scala, Groovy, and JRuby can generate java classes that
sling JSPs can import?
But, don't you have to still create OSGi bundle from Scala, Groovy, or JRuby
and deploy to it felix  or put it in CLASSPATH?


My goal is to avoid OSGi and Java as much as possible.

Re: scripting with proper module system?

Posted by Justin Edelson <ju...@justinedelson.com>.
On Mon, Aug 8, 2011 at 2:45 PM, sam ” <sk...@gmail.com> wrote:
> Hey,
>
> Is there a scripting support with proper module system (import modules from
> repository somewhere)?
>
> I know JSP can <%@page import="some.java.package"%> .
>
> But, the "module" for JSP should be written in Java.. and deployed to felix
> as an OSGi bundle  (or the jar could be added to CLASSPATH somewhere).

This is not true. It's certainly possible to write OSGi bundles which
contain non-Java code. Not sure about Clojure or Jython, but you can
definitely do this with Scala, Groovy, and JRuby without much drama.

>
> What I want is to develop entire application NOT using Java, in the
> repository.
> For example,  in Python, I want to:
>      import some.module.foo
>
> and it'll import  /var/pymodules/some/module/foo/__init__.py      or
> something..

I don't follow Jython, so I can't say how feasible it is to get the
runtime to load files from the repository rather than the file system.
I tried to get the JRuby team to add better support for loading
RubyGems from other bundles, but they weren't interested.

>
> Looking at: http://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/
> none of scripting support seems to have that capability.
>
> Has anyone used/developed proper scripting support sling  (for any
> language.. groovy, python, clojure.. etc), where you entirely ditched Java
> development?
> If so, what is your experience?  What is your development envirionment
> like?  (step debugging, IDE..etc).  Is your scripting support open sourced?
>
> Or, if I want to develop web application using scripting languages
> (non-Java),  should I just use some other framework than Sling, and talk to
> JCR through HTTP or something?
>