Author Topic: zPocketScript  (Read 4331 times)

cwaig

  • Full Member
  • ***
  • Posts: 153
    • View Profile
zPocketScript
« on: May 05, 2004, 09:44:22 am »
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: [Select]
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?
SL5500+Origo WIFI+Pocketop Keyboard+BlueMonkey Bluetooth+IBM Microdrive+SL6000+iRiver USB host+PackardBell USB RF mini-mouse+Cheapo Kingmax USB laptop Keyboard+Dynamode USB Ethernet Adaptor
Wrote a couple of things....
IRK, SubApplet, QMode2, NetActive, SimpleEdit, zPocketScript.

DrWowe

  • Hero Member
  • *****
  • Posts: 696
    • View Profile
    • http://
zPocketScript
« Reply #1 on: May 05, 2004, 10:11:36 am »
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.  

cwaig

  • Full Member
  • ***
  • Posts: 153
    • View Profile
zPocketScript
« Reply #2 on: May 05, 2004, 10:33:24 am »
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: [Select]
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...).
SL5500+Origo WIFI+Pocketop Keyboard+BlueMonkey Bluetooth+IBM Microdrive+SL6000+iRiver USB host+PackardBell USB RF mini-mouse+Cheapo Kingmax USB laptop Keyboard+Dynamode USB Ethernet Adaptor
Wrote a couple of things....
IRK, SubApplet, QMode2, NetActive, SimpleEdit, zPocketScript.

cwaig

  • Full Member
  • ***
  • Posts: 153
    • View Profile
zPocketScript
« Reply #3 on: May 21, 2004, 10:04:20 am »
In case anyone\'s interested, an initial version of zPS was released a day or two ago.....
SL5500+Origo WIFI+Pocketop Keyboard+BlueMonkey Bluetooth+IBM Microdrive+SL6000+iRiver USB host+PackardBell USB RF mini-mouse+Cheapo Kingmax USB laptop Keyboard+Dynamode USB Ethernet Adaptor
Wrote a couple of things....
IRK, SubApplet, QMode2, NetActive, SimpleEdit, zPocketScript.

fpp

  • Full Member
  • ***
  • Posts: 187
    • View Profile
    • http://
zPocketScript
« Reply #4 on: May 21, 2004, 11:00:21 am »
How would this compare to, say, Python + pyQt as ported to the Zaurus/Qtopia platform by Riverbank ?

DrWowe

  • Hero Member
  • *****
  • Posts: 696
    • View Profile
    • http://
zPocketScript
« Reply #5 on: May 21, 2004, 11:30:24 am »
Cool!  Are you going to release the source too?

cwaig

  • Full Member
  • ***
  • Posts: 153
    • View Profile
zPocketScript
« Reply #6 on: May 21, 2004, 11:39:16 am »
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.
SL5500+Origo WIFI+Pocketop Keyboard+BlueMonkey Bluetooth+IBM Microdrive+SL6000+iRiver USB host+PackardBell USB RF mini-mouse+Cheapo Kingmax USB laptop Keyboard+Dynamode USB Ethernet Adaptor
Wrote a couple of things....
IRK, SubApplet, QMode2, NetActive, SimpleEdit, zPocketScript.

cwaig

  • Full Member
  • ***
  • Posts: 153
    • View Profile
zPocketScript
« Reply #7 on: May 21, 2004, 11:40:08 am »
Quote
Cool!  Are you going to release the source too?


Eventually. But not whilst it\'s still under heavy initial development.....
SL5500+Origo WIFI+Pocketop Keyboard+BlueMonkey Bluetooth+IBM Microdrive+SL6000+iRiver USB host+PackardBell USB RF mini-mouse+Cheapo Kingmax USB laptop Keyboard+Dynamode USB Ethernet Adaptor
Wrote a couple of things....
IRK, SubApplet, QMode2, NetActive, SimpleEdit, zPocketScript.

piotr

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
    • http://
zPocketScript
« Reply #8 on: May 23, 2004, 01:52:30 am »
GreaT!
Please dont forget about X(pdaXrom) users :-)
piotr

cwaig

  • Full Member
  • ***
  • Posts: 153
    • View Profile
zPocketScript
« Reply #9 on: May 23, 2004, 05:26:19 am »
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...)
SL5500+Origo WIFI+Pocketop Keyboard+BlueMonkey Bluetooth+IBM Microdrive+SL6000+iRiver USB host+PackardBell USB RF mini-mouse+Cheapo Kingmax USB laptop Keyboard+Dynamode USB Ethernet Adaptor
Wrote a couple of things....
IRK, SubApplet, QMode2, NetActive, SimpleEdit, zPocketScript.

DrWowe

  • Hero Member
  • *****
  • Posts: 696
    • View Profile
    • http://
zPocketScript
« Reply #10 on: May 23, 2004, 10:04:58 am »
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.  

cwaig

  • Full Member
  • ***
  • Posts: 153
    • View Profile
zPocketScript
« Reply #11 on: June 08, 2004, 08:00:30 pm »
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).
SL5500+Origo WIFI+Pocketop Keyboard+BlueMonkey Bluetooth+IBM Microdrive+SL6000+iRiver USB host+PackardBell USB RF mini-mouse+Cheapo Kingmax USB laptop Keyboard+Dynamode USB Ethernet Adaptor
Wrote a couple of things....
IRK, SubApplet, QMode2, NetActive, SimpleEdit, zPocketScript.