Help - Search - Members - Calendar
Full Version: zPocketScript
OESF Portables Forum > General Forums > General Discussion
cwaig
I've been developing a new scripting system for the Zaurus for a while now. I've called it zPocketScript,
and I'm kind of hoping that it'll be a bit more useable for on the move development and prototyping than some other languages...

I've got commandline versions of the interpreter for running scripts on the Zaurus or a desktop PC, a Qtopia GUI debugger version with all the usual stuff you'd expect of a debugger (stack trace, single step, breakpoints, variable inspections, etc) and also a remote mode, so you can debug scripts with the Zaurus that are actually running on another machine (another Zaurus or a desktop).

The language itself uses my own ECMAScript interpreter, with plugin object libraries extra functionality (the standard core object's are in there already for String's, regular expressions, Array's, etc). Don't laugh 'til you've tried it - ECMAScript/JavaScript is really a quite powerful OO language.

For example, a simple HTTP connection to my website can be coded up as:

CODE
craigsServer=new Host("angela1.data-uncertain.co.uk")

s=new Socket(Socket.PF_INET,Socket.SOCK_STREAM)

connected=s.connect(craigsServer,80)

if(connected)

{

    s.writeln("GET / HTTP/1.0");

    s.writeln("");

}


I've also got some simple interface Objects for using the ZSurface library from ECMAScript as well.

It's reaching the point where it's probably at least a little useful to people, so I'll hopefully release (at least an initial version) in the next couple of weeks, but I'd be interested to hear if anyone has some suggestions for useful object libraries.....the obvious one's I've already done are File (file io), Host (simplifies DNS lookups), Socket (for network stuff).

Comments?
DrWowe
Great stuff! I agree Javascript/ECMAscript is a really underrated language for quick programming tasks. I've used the Mozilla Rhino engine for years to script java programs. I'm looking forward to trying this.

Another good candidate for the library would be a Qt binding. Imagine being able to script a full GUI application. smile.gif
cwaig
I've kind of done a few bit's of a QT binding - but only the stuff that was needed to be able to script ZSurface app's. So:
CODE
app=new QPEApplication();

window=new QMainWindow();

app.showMainWidget( window );

window.enableFullscreen();

backbuffer=new ZSurface(240,320);

window.display(backbuffer);

works, but not a lot else.....it's a good idea though (it's on the list to do somewhere down the line...probably after I've written an automated interface generator to produce the zPS API wrapper's automaticly...).
cwaig
In case anyone's interested, an initial version of zPS was released a day or two ago.....
fpp
How would this compare to, say, Python + pyQt as ported to the Zaurus/Qtopia platform by Riverbank ?
DrWowe
Cool! Are you going to release the source too?
cwaig
QUOTE
How would this compare to, say, Python + pyQt as ported to the Zaurus/Qtopia platform by Riverbank ?


Well, it's a different language for starters...
I guess it depends what you're looking for. The GUI debugger is designed esp. for the Zaurus, so it'll probably wind up being a much easier system to work with on the move - which is the whole point of it. It's not intended for developing script's on your desktop then running 'em on the Zaurus (why bother? there's C++ for that), it's intended for developing small stuff comfortably on the Zaurus itself.
cwaig
QUOTE
Cool! Are you going to release the source too?


Eventually. But not whilst it's still under heavy initial development.....
piotr
GreaT!
Please dont forget about X(pdaXrom) users :-)
piotr
cwaig
QUOTE
GreaT!
Please dont forget about X(pdaXrom) users :-)
piotr


The console interpreter should already work under that ROM, but the GUI debugger won't as it was written specificly for Qtopia...I guess it could be patched to remove the Qtopia references and just use QT, but I've not done any work on that front so far (and there's probably not a lot of demand for it...)
DrWowe
QUOTE
GreaT!
Please dont forget about X(pdaXrom) users :-)
piotr


Piotr, when the source becomes available, you'll be able to add pdaXrom support yourself. Too many people on this forum don't understand the benefits of open source. You should read "the Cathedral and the Bazaar" sometime.

Craig, thanks for all your great contributions to the Zaurus community! Of course, I don't want to tell you what to do with your own work. But there's a "Release early, release often" philosophy that characterizes many successful open source projects. I just mention this politely as something to think about, I hope you won't take offense.

The Zaurus community is weird. Since the product is based on a mix of open source and closed software, it kind of straddles both words, with their very different and incompatible cultures. Most closed source platforms have a culture of "users" and "developers" as very distinct entities. Everything is released binary only, most programs only have 1 or 2 developers, and they usually expect monetary payment of some sort, and its a rare gift when you can see the source code (even when it's freeware and the author wouldn't mind, it usually just isn't done because it's not part of the culture and most of the "users" don't care). In the open source world, there's a huge blurring between users and developers, the most successful projects often have many thousands of contributors (like the Linux kernel itself, for instance), and the expected "payment" for the software is more code being added and contributed to make the software more useful than the original author could have done by himself. And the Zaurus is some strange hybrid. Weird, huh?

Anyway, this is all pretty OT, so I'll stop now. smile.gif
cwaig
I've just released zPocketScript 1.0.1. Changelog for the new release can be found here.

I guess the bigest improvements are in stability, error reporting (like, there actually is some now) and support for using zps script's as #! bang scripts from the command line.

Oh yeah - and there's some examples now as well (one is an SMTP mailer written in zPS).
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2019 Invision Power Services, Inc.