Overview
Features
Download
Documentation
Community
Add-Ons & Services

PocoScript

Discussion of ideas for features and new projects based on POCO.

PocoScript

Postby alex » 19 Dec 2006, 16:07

I'd like to solicit some input on scripting language need/choice. I am motivated by a need for it in the Servlet project, but I think it would be generally useful to have one.

Here are the thoughts/ideas I have been playing with :

For the servlet project, rather than having "C++ server pages" equivalent of JSP, I thought of implementing it as JavaScript Pages, i.e. server-side JavaScript by leveraging the SpiderMonkey engine. JavaScript is already de-facto and de-iure client side scripting language, so why not have it on server side as well?

Some other ideas I though about:

I somewhat like Python, so maybe integration with it would be a good idea. This is mainly driven by me using ReportLab, which is written entirely in Python and does a very good job in generating nicely formatted PDF documents on the fly.

I don't know much about it, but Ruby is becoming increasingly popular.

Lua is reportedly very fast scripting language with some interesting features.

Is there a need for general-purpose PocoScript, at all? For web-related stuff, is a JSPServlet the proper and sufficient way to go? Or maybe PocoScript could be done as a common interface to any scripting language and then filled-in with plugins for other languages (and not only script - think JNI) in a similar fashion as was done in PocoData.

Thoughts, ideas, suggestions?

Alex
alex
 
Posts: 1130
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: PocoScript

Postby guenter » 20 Dec 2006, 17:21

> I'd like to solicit some input on scripting language need/choice. I am motivated by a need for it in the Servlet project, but I think it would be generally useful to have one.

I am a big fan of scripting languages, and I really would welcome having support for scripting in POCO.


> Here are the thoughts/ideas I have been playing with :
>
> For the servlet project, rather than having "C++ server pages" equivalent of JSP, I thought of implementing it as JavaScript Pages, i.e. server-side JavaScript by leveraging the SpiderMonkey engine. JavaScript is already de-facto and de-iure client side scripting language, so why not have it on server side as well?

This is really great for coming up quickly with web interfaces for existing applications.


>
> Some other ideas I though about:
>
> I somewhat like Python, so maybe integration with it would be a good idea. This is mainly driven by me using ReportLab, which is written entirely in Python and does a very good job in generating nicely formatted PDF documents on the fly.
>
> I don't know much about it, but Ruby is becoming increasingly popular.
>
> Lua is reportedly very fast scripting language with some interesting features.
>
> Is there a need for general-purpose PocoScript, at all?

definitely

>For web-related stuff, is a JSPServlet the proper and sufficient way to go? Or maybe >PocoScript could be done as a common interface to any scripting language and then >filled-in with plugins for other languages (and not only script - think JNI) in a similar >fashion as was done in PocoData.
>
> Thoughts, ideas, suggestions?

A common interface for the integration of different scripting engine would be great, too.
What we definitely need is some code generator that automatically generates scripting language interfaces for POCO classes. This is something that the CppParser (part of PocoDoc) in the Sandbox could be used for.
guenter
 
Posts: 1134
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: PocoScript

Postby marlowa » 21 Dec 2006, 12:22

> I'd like to solicit some input on scripting language need/choice.
> I somewhat like Python, so maybe integration with it would be a good idea.
> I don't know much about it, but Ruby is becoming increasingly popular.
> Lua is reportedly very fast scripting language

Python is my favourite from the above.

> Is there a need for general-purpose PocoScript, at all?

I am not sure what is being proposed here. There are lots of scripting languages already available. Python would be my choice from above. For web development extra stuff is sometimes created and several frameworks have resulted from this. Is that what is being talked about here? From what little I know about web development, servlets are a pain in the neck to develop but several frameworks can (possibly) come to the rescue. If this is what is wanted, why not take a look at Tapestry? The main web site is at http://tapestry.apache.org. There is also my book review of *the* book on Tapestry on the ACCU's web site (http://www.accu.org/bookreviews/public/reviews/t/t003861.htm).
marlowa
 
Posts: 36
Joined: 19 Jul 2006, 09:02
Location: United_Kingdom

Re: Re: PocoScript

Postby alex » 21 Dec 2006, 20:44

> > Is there a need for general-purpose PocoScript, at all?
>
> I am not sure what is being proposed here. There are lots of scripting languages already available. Python would be my choice from above.

Feedback on ideas about implementation of an interface between Poco and scripting language(s) is solicited here. As for proposals, there were several in the original post, but none elaborated, just few raw ideas thrown out.

>For web development extra stuff is sometimes created and several frameworks have resulted from this. Is that what is being talked about here?

Not really. This is a discussion about interfacing scripting languages from (and to) Poco.

>From what little I know about web development, servlets are a pain in the neck to develop but several frameworks can (possibly) come to the rescue. If this is what is wanted, why not take a look at Tapestry? The main web site is at http://tapestry.apache.org. There is also my book review of *the* book on Tapestry on the ACCU's web site (http://www.accu.org/bookreviews/public/reviews/t/t003861.htm).

As for Tapestry, we may take some ideas from it for PocoServlet down the road. However, this is not a topic for this discusion thread. Servlet framework is in the [url=http://poco.svn.sourceforge.net/viewvc/poco/sandbox/Servlet/ | sandbox] and feedback thread is http://tinyurl.com/yx7zmk ] here[/url

My motivation for Javascript integration is because I plan to have a JSP equivalent for PocoServlet, only in JavaScript and by leveraging SpiderMonkey. I am also using ReportLab (written in Python), and I'd like to access it from a C++ servlet, so I'd like interface to Python, too. All that being said, if a scripting language (or two) is being interfaced, a natural question arises: is it feasible and worth trying implementing a unique interface for scripting languages with scripting interpreter plugins behind it? And the other side of the story is what Guenter proposed - scripting language Poco interfaces generated via CppParser.

So, the bottom line questions boil down to:

- do we need scripting languages interfaces in Poco?

- If we do, how do we go about implementing them?

Alex
alex
 
Posts: 1130
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: PocoScript

Postby lkereszt » 05 Feb 2008, 16:40

My two cents.. I wish a script language and API via which I can call some simple function(s) to give a flexible way for the user to interact with the decisions made in my POCO application.. of course without recompiling anything. Practically, I wish to pass an array of name=value pairs, parameters or better an XML (DOM object). The script then would modify values and return them. The requirement is that modifying the script instantly applied on the next call..

Hey, I've just found out... I can achive this by calling stored procedures! (:biggrin:)

Actually, I don't stick to any scripting language.. since my wish is so simple that any script would provide a simple syntax for it.

OTOH, it is a different approach if we want to write "the application" in script which then presented through POCO's infrastructure. There's Apache for the web.. or can be solved by returning a string/XML of the xhtml insert from the script. To use net, ssl, db, or io inside scripts there are bindings for the various script languages.. so this does not require POCO to be expressed or provide full bindings for a script.

In short, I think the practical way is to get POCO call script inserts and not the other direction. Or just provide a simple, registrable callback function to reach POCO. This can also be built for Java, via Java Native Interface (JNI) and the Java Reflection API calling Java object's functions with a list of params eg. passed in DynamicAnys which get properly bound to the Java variables (like already done in the ODBC library).
lkereszt
 
Posts: 1
Joined: 23 Jan 2008, 16:45
Location: Hungary


Return to Wishlist

Who is online

Users browsing this forum: No registered users and 1 guest