JASPA
From JASPA
Contents |
The JASPA Project
In the simplest terms possible: JASPA allows developers to write regular JavaScript applications in ActionScript.
More precisely: JASPA allows developers to write robust, object-orientated applications in a strongly-typed language (modelled closely on AS3); then compile it into regular JavaScript to run in a web page, or any other environment that implements a JavaScript engine.
Although it consists of various parts, JASPA is the name of this project as a whole. Officially the acronym stands for "JavaScript; Advanced Syntax with PHP", but originally it was really just a mish mash of JavaScript, ActionScript & PHP.
The JAS Language
JAS is to JASPA what ActionScript is to Flash - it is the language which a JASPA compiler converts to JavaScript.
Modelled on AS3
JAS is modelled closely on ActionScript (AS3) to appeal to ActionScript developers who have come to enjoy an increasingly strict, object-orientated language during which time regular JavaScript has largely stood still. Although JAS is not identical to AS3, it is very similar indeed, and includes all the major OOP features you need for serious application development. Such features are either not present, or too fiddly to achieve in regular JavaScript. See the JAS language page for further information on the intricacies of the syntax and its relationship to ActionScript of term paper.
Not just another JS library
There are various libraries out there (such as Prototype) that attempt to extend the OOP features of JavaScript. However, as they tend to be implemented in JavaScript itself, they provide nothing more than simply syntactic sugaring. By providing an alternative syntax which truly extends the language, JASPA can offer much more power and a much better experience for developers, especially developers who like ActionScript. As the code is compiled before deployment it offers a much more robust environment for catching code errors.
The Compiler
There are two iterations of the compiler program; one runs from the command line which is the recommended method, and there is also a web-based compiler for developers who don't have access to a command line, or are not comfortable using one. The compiler converts a JAS script and its dependent JAS class files into a single, self-sufficient block of JavaScript code.
Written in PHP
The compiler software is written in PHP. At least version 5.2 is required, although [theoretically] this could be downgraded to reach a wider audience if it was deemed necessary.
Command line compiler
This is the recommended way to compile JAS to JavaScript. The jas program is a self-contained PHP script designed to be executed from the command line. It provides a very flexible way to test and compile a JASPA application into a flat js file.
See the cli compiler page for full information on the command line compiler.
Web compiler
Not all developers are familiar or comfortable on the command line and some may not have access to one at all. For this reason there is a version of the program designed to run in a web browser.
See the web compiler page for full information on the web based compiler.
The APIs
The JASPA compiler is a pure, API-neutral language compiler. That is to say that it will compile code for any JavaScript environment, not just web browser applications. It is not biased toward any particular use of JavaScript.
JASPA.DOM
The JASPA.DOM API project is an open source code base for developing cross-browser web applications with JASPA. It is less mature than the core JASPA project itself, and is arguably larger and more challenging due to the nature of what it attempts to achieve - Total abstraction and standardization of cross-browser DOM scripting.
See the main JASPA.DOM page for full details.
JASPA.CLI
A simple API is available for running command line JavaScript programs with the js shell program from Mozilla.
See the main JASPA.CLI page for full details.
Custom APIs
Anyone can develop an API for JASPA using an optional mix of intrinsic classes and native JavaScript code. See the introduction to JASPA API development for a full explanation.
Downloads
Please visit the downloads page for all JASPA downloads.

