What's GLUEscript?

GLUEscript (Glueing Libraries Using EcmaScript) is the successor of wxJavaScript. The new name covers the goal of this project: create a JavaScript engine which can be used as a general purpose language (like Perl for instance).

Read the history behind GLUEscript.

GLUEscript is developed by Franky Braem

SpiderMonkey

GLUEscript uses SpiderMonkey, the JavaScript engine used in FireFox.

SpiderMonkey

Portable Code

GLUEscript is written in portable C++ code. GLUEscript uses PoCo, a library for writing portable C++ code. And wxWidgets is used as GUI toolset. The GUI glue is optional.

Powered by POCO
Built with wxWidgets

GLUEscript uses Premake for generating makefiles for gcc, project files for Visual C++, CodeLite, Code::Blocks, ... Premake can be used on Windows, Linux and MacOS.

Poco SpiderMonkey framework ready

It's been more then 3 months that I'm working on the Poco JavaScript environment for SpiderMonkey. While I was converting some glues to the this new environment, I found a lot of bugs, enhancements, ... Today I think the SpiderMonkey framework is ready. The glues for cURL and SQLite are converted and they work. In the meantime I keep on converting the other glues to the Poco C++ Coding Style and to use the framework, so be patient for the next release ...

POCO SpiderMonkey framework

The design of the POCO SpiderMonkey framework is ready. Now I'm converting all the glues to this framework. This is alot of work, but this will be the best way to test the SpiderMonkey framework. In the meantime I change the code to follow the POCO C++ Coding Style Guide. When I feel it is ready, the framework will be contributed to POCO. You can follow everything in the Subversion repository.

GLUEscript contributes to POCO

The GLUEscript project will work on an JavaScript Environment for POCO. POCO already has an environment for LUA. This code is stored in the POCO sandbox, so it will not be available in the official POCO release in the near future.

How to configure Apache?

The apache module uses a modified version of the Apache Connector from the POCO framework. Configure this as follows:

LoadModule poco_module c:/glue/bin/mod_poco.dll
AddPocoRequestHandler GLUERequestHandlerFactory c:/glue/bin/glue_apache.dll <path>
AddHandler glue .js

All JavaScript files in path are handled by GLUEscript.

GLUEscript 0.0.1 released

Today the first release of GLUEscript is made public. This release contains glues for sqlite, mysql, curl, memcached, gd, ... With the apache connector it is possible to write server side webpages in JavaScript.

Let me know what you think. Please report bugs on the tracker system (you can find it on the website) and ask questions on the google group.

A sample: using cURL, e4x and wxWidgets to view an RSS feed

This sample will show the RSS feed of this website. For this we need:

  • cURL is used for retrieving the RSS feed
  • E4X is used to parse the XML retrieved from the RSS feed
  • wxWidgets is used for showing the RSS feed in a HTMLWindow

First we load the glues we need:

var curl = require("curl");
var wx = require("wx");

Then we initialize E4X:

XML.ignoreComments = true;
XML.ignoreWhitespace = true;
XML.prettyPrinting = false;
XML.prettyIndent = 0;

A function is created to load the RSS feed with cURL:

wubi

Today I discovered wubi. Wubi makes it possible to install Ubuntu without creating a partition on a hard-drive. Wubi keeps Windows as it is, it only adds an extra option to boot into Ubuntu. Thanks to Wubi, I can start testing and developing GLUEscript again for Linux.

First release of GLUEscript is almost ready ...

At the moment I'm testing all the sample scripts with GLUEscript 0.0.1. A lot has changed since wxJavaScript, so before I release the first version of GLUEscript I have to be sure that all the samples do work.

If you are impatient, you can get the source from Subversion and try to build GLUEscript yourself. When you find defects, you can enter them in the tracker. It can be a great help for me to get this version as good as possible.

Trac

The GLUEscript project will be using Trac for registering bugs, feature requests, ... The roadmap of GLUEscript is also available on the Trac site.

A new way of loading glues (a.k.a. modules)

A new method is introduced to GLUEscript: require. This method can be used to load glues. The method returns an object which contains all the classes and methods that are defined in the specific glue. The glue attaches this object also on the glue.modules object. require needs a URI to the glue. For a glue this must be a file URI. The object returned by require can be used to create shorter code. An example:

  var os = require("file:///c:/development/gluescript/bin/debug/glue_os.dll");

This example will load the glue_os glue. The object that contains all classes is stored in the os variable. This mean you can write something like this:

  var file = new os.File("test.txt");

Which is a shorthand for writing this:

  var file = new glue.modules.os.File("test.txt");

The object created by the glue is cached in the runtime. So calling require twice or more for the same glue, will not result in loading the glue again.

In the future it will also be possible to use require for loading modules written in JavaScript.

Syndicate content