<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Web 2.1 &#187; JASPA</title>
	<atom:link href="http://web.2point1.com/tag/jaspa/feed/" rel="self" type="application/rss+xml" />
	<link>http://web.2point1.com</link>
	<description>Tim Whitlock's home in the Blogohedron</description>
	<lastBuildDate>Sun, 21 Feb 2010 15:46:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using ASDoc with JASPA</title>
		<link>http://web.2point1.com/2009/03/28/using-asdoc-with-jaspa/</link>
		<comments>http://web.2point1.com/2009/03/28/using-asdoc-with-jaspa/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 17:44:34 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[ASDoc]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[JASPA]]></category>

		<guid isPermaLink="false">http://web.2point1.com/2009/03/28/using-asdoc-with-jaspa/</guid>
		<description><![CDATA[I've spent this morning trying to get ASDoc to generate code documentation for the JASPA APIs, with mixed results.

I encountered problems straight away with the extended globals that JASPA uses. For example The DOM API defines a native Window class which extends the ECMAScript global. Of course in AS3 you cannot extend the global.
Eventually I [...]]]></description>
			<content:encoded><![CDATA[<p>I've spent this morning trying to get <a href="http://livedocs.adobe.com/flex/3/html/asdoc_9.html" target="_blank">ASDoc</a> to generate code documentation for the <a href="http://jaspa.org.uk/">JASPA</a> APIs, with mixed results.<br />
<span id="more-116"></span><br />
I encountered problems straight away with the extended globals that JASPA uses. For example The <a href="http://jaspa.org.uk/wiki/JASPA.DOM" target="_blank">DOM API</a> defines a native <a href="http://jaspa.org.uk/wiki/Jaspa.dom.Window" target="_blank">Window</a> class which extends the <a href="http://jaspa.org.uk/wiki/Global_class" target="_blank">ECMAScript global</a>. Of course in AS3 you cannot extend the global.</p>
<p>Eventually I managed to trick ASDoc into completing, but it has opened up further cans of worms. There are a whole bunch of practices in the JASPA code base that the AS3 compiler really doesn't like. I've tried to be strict, but apparently not strict enough. In some cases I feel that AS3 is just being unreasonable, for example, you cannot have private constructors in AS3. A common practice for singleton classes is many OOP languages.</p>
<p>Here's another example, where an extended event class provides access to an extended target -</p>
<pre class="code">public class EventTarget {
}

public class Event {
    public function get target():EventTarget;
}

public class SpecialEventTarget extends EventTarget {
}

public class SpecialEvent extends Event { 
    override public function get target():SpecialEventTarget;
}</pre>
<p>The overridden getter that returns a sub-type of the target is considered invalid. I don't see how this is bad practice. Surely a more specific type of event should be allowed to return a more specific type of target, especially as the extended target still has all the traits of the original target.</p>
<p>Of course you can always cast with the <code>as</code> operator:</p>
<pre class="code">mySpecialEvent.target as SpecialEventTarget;</pre>
<p>The question is, do I really want JASPA to be tied so closely to AS3? At the end of the day it is a separate language, and is designed for compiling into JavaScript not for emulating ActionScript.</p>
<p>I am not caught between two options.<br />
1. Alter the JASPA codebase to be even more like AS3<br />
2. Write a JAS documentor, jasdoc</p>
<p>What do you think?</p>
]]></content:encoded>
			<wfw:commentRss>http://web.2point1.com/2009/03/28/using-asdoc-with-jaspa/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JASPA on WebDevGeekly podcast</title>
		<link>http://web.2point1.com/2009/03/14/jaspa-on-webdevgeekly-podcast/</link>
		<comments>http://web.2point1.com/2009/03/14/jaspa-on-webdevgeekly-podcast/#comments</comments>
		<pubDate>Sat, 14 Mar 2009 15:01:38 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[JASPA]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[media]]></category>
		<category><![CDATA[pr]]></category>

		<guid isPermaLink="false">http://web.2point1.com/2009/03/14/jaspas-first-media-coverage/</guid>
		<description><![CDATA[After a brief exchange of tweets with @jsmag I discover this web development &#8216;podcast' : webdevgeekly.com, which appears to be run by the same people as jsmag.com. About 9 minutes into the following podcast there is a 2 minute discussion about JASPA. Conveniently just 24 hours after I rescued my site from a hardware crash.
&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>After a brief exchange of tweets with <a href="http://twitter.com/jsmag" target="_blank">@jsmag</a> I discover this web development &#8216;podcast' : <a href="http://webdevgeekly.com/" target="_blank">webdevgeekly.com</a>, which appears to be run by the same people as <a href="http://www.jsmag.com" target="_blank">jsmag.com</a>. About 9 minutes into the following podcast there is a 2 minute discussion about <a href="http://jaspa.org.uk/">JASPA</a>. Conveniently just 24 hours after I rescued my site from a hardware crash.</p>
<p><a href="http://www.webdevgeekly.com/r/www.webdevgeekly.com/mp3/geekly6.mp3" target="_blank">&gt; http://www.webdevgeekly.com/r/www.webdevgeekly.com/mp3/geekly6.mp3 </a></p>
<h4><span id="more-112"></span>I should clarify a few things for anyone listening:</h4>
<p>1. I did get a <em>rude</em> email from Douglas Crockford, but <em>not</em> nasty or in any way aggressive. When I very politely asked for his opinion on the project he responded: &quot;<em>I don't care for ActionScript</em>&quot;; No &quot;hello&quot;, no signature&#8230; Call me old fashioned, but I think that's unnecessarily rude.</p>
<p>2. &quot;<em>I wonder how they're doing parts of this</em>&quot; (<a href="http://www.ecmascript.org/" target="_blank">Harmony and ECMA4</a> gets mentioned)<br />
As any JS evangelist will tell you, Adobe went off and did pretty much their own thing with AS2/3; JAS syntax follows that path as opposed to the current path of ECMAScript. The &#8216;compiler' is implemented in pure PHP. You can <a href="http://timwhitlock.info/plug/examples/JASPA/Parser/JASParser.php" target="_blank">test the JAS Parser on its own here</a>, or test the full compiler at <a href="http://jaspa.org.uk/">jaspa.org.uk</a>. Rather than a JavaScript engine, or interpreter like <a href="http://www.mozilla.org/js/spidermonkey/" target="_blank">SpiderMonkey</a> that might run in a browser, the JASPA compiler is really a <em>converter</em> which allows you to deploy regular JavaScript to browsers that have no idea how to interpret JAS, or any other super-set of ECMAScript for that matter.</p>
<p>3. Providing libraries that ActionScript developers are used to &#8211; e.g. <code>jaspa.net.URLVariables</code><br />
I do attempt to follow AS conventions where possible. The <code>URLVariables</code> class is a good example, because it is API agnostic. That is to say that it is a rather abstract utility that could be used in DOM scripting, but equally in any other API, such as server side JavaScript for Flash Media Server for example. It is important to note that the JASPA compiler and JAS syntax are not in any may married to these libaries and APIs. It is platform for which anyone is free to develop their own such utilities.</p>
<p>4. Finally to anyone who wants to try out JASPA, please bear in mind that it is a non-commercial project with a single developer who has a full-time job. The &quot;they&quot; is really a &quot;he&quot;. The compiler itself is a <em>beta</em>, and some of the API classes I've been putting together are somewhat <em>alpha</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://web.2point1.com/2009/03/14/jaspa-on-webdevgeekly-podcast/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The JASPA KSP</title>
		<link>http://web.2point1.com/2009/02/01/the-jaspa-ksp/</link>
		<comments>http://web.2point1.com/2009/02/01/the-jaspa-ksp/#comments</comments>
		<pubDate>Sun, 01 Feb 2009 12:38:05 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[JASPA]]></category>
		<category><![CDATA[marketing]]></category>
		<category><![CDATA[pr]]></category>

		<guid isPermaLink="false">http://web.2point1.com/2009/02/01/the-jaspa-ksp/</guid>
		<description><![CDATA[Not being a marketeer or PR guru I've been struggling to get JASPA's raison d'être across succinctly enough. The elevator pitch is easy; give me a 100 words and your attention and I'll get the message across. Give me 10 words and I'm useless. 
There's too much ambiguity and room for misconception in a single [...]]]></description>
			<content:encoded><![CDATA[<p>Not being a marketeer or PR guru I've been struggling to get <a href="http://www.jaspa.org.uk/">JASPA</a>'s raison d'être across succinctly enough. The elevator pitch is easy; give me a 100 words and your attention and I'll get the message across. Give me 10 words and I'm useless. <span id="more-92"></span></p>
<p>There's too much ambiguity and room for misconception in a single headline. Online-reading habits being what they are, if you're not interested in the headline, you won't read what's under it. I suppose this is why people use rather abstract strap-lines like jQuery's &quot;<em>Write less, do more</em>&quot; and &quot;<em>jQuery is a new kind of JavaScript library</em>&quot;.</p>
<p>I don't think JASPA can get way with statements this abstract, so I'm currently running with:</p>
<blockquote><p>&quot;Write JavaScript with the expressive power of ActionScript&quot;</p></blockquote>
<p>Not catchy, I know; needs work. I've also put a real-time compiler demo on the <a href="http://www.jaspa.org.uk/">JASPA home page</a> to try and get the message across. I may regret this as the compiler uses a lot of juice. Good job it's not popular ;)</p>
]]></content:encoded>
			<wfw:commentRss>http://web.2point1.com/2009/02/01/the-jaspa-ksp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A response to jQuery</title>
		<link>http://web.2point1.com/2009/01/03/a-response-to-jquery/</link>
		<comments>http://web.2point1.com/2009/01/03/a-response-to-jquery/#comments</comments>
		<pubDate>Sat, 03 Jan 2009 20:23:25 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[JASPA]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Prototype]]></category>

		<guid isPermaLink="false">http://web.2point1.com/2009/01/03/a-response-to-jquery/</guid>
		<description><![CDATA[JavaScript language abstraction
I just read this blog article by John Resig, the author of jQuery. The article in general is a criticism of various projects like my very own &#34;JASPA&#34; &#8211; A criticism of frameworks that attempt to bring JavaScript into the 21st century by abstracting it into a different language.
I knew I wasn't alone [...]]]></description>
			<content:encoded><![CDATA[<h3>JavaScript language abstraction</h3>
<p>I just read this <a href="http://ejohn.org/blog/javascript-language-abstractions/" target="_blank">blog article by John Resig</a>, the author of <a href="http://jquery.com/" target="_blank">jQuery</a>. The article in general is a criticism of various projects like <a href="http://jaspa.org.uk/">my very own &quot;JASPA&quot;</a> &#8211; A criticism of frameworks that attempt to bring JavaScript into the 21st century by abstracting it into a different language.<span id="more-81"></span></p>
<p>I knew I wasn't alone with JASPA &#8211; There is <a href="http://code.google.com/webtoolkit/" target="_blank">GWT</a> and <a href="http://www.jangaroo.net/" target="_blank">Jangaroo</a> for Java, <a href="http://pyjs.org/" target="_blank">Pyjamas</a> for Python, and <a href="http://cappuccino.org/" target="_blank">Cappuccino</a> with its own syntax called Objective-J. These projects are all slightly different takes on one core principal &#8211; that to truly make JavaScript &quot;better&quot; you can't just write JavaScript, you have to introduce a more advanced syntax to leverage more advanced features.</p>
<p>Understandably JavaScript evangelists like John don't all like this idea, and I do understand why. John makes some good points; most of which I completely agree with, but also some that I feel apply equally to his own jQuery and libraries like it.</p>
<h4>Native JavaScript vs foreign language syntax</h4>
<p>Pure-JavaScript libraries like <a href="http://jquery.com/" target="_blank">jQuery</a>, <a href="http://www.prototypejs.org/" target="_blank">Prototype</a>, <a href="http://code.google.com/p/base2/" target="_blank">Base2,</a> (<a href="http://en.wikipedia.org/wiki/Comparison_of_JavaScript_frameworks" target="_blank">the list is endless</a>) all attempt to address the short-comings of JavaScript from the inside, so to speak. That is to say that they are implemented in JavaScript and can never escape JavaScript. John argues that this is preferable, but I argue that the way in which these kind of libraries attempt to bend the syntax of JavaScript make them guilty of most of the same charges. Furthermore I argue that these libraries stand in the way of someone new to JavaScript gaining any real understanding of it.</p>
<p>My main defence of JASPA is of course that the language syntax is that of ActionScript (AS3), which regardless of its rocky relationship with <a href="http://www.ecmascript.org" target="_blank">ECMAScript 4</a>, is still an evolution of JavaScript, and not a total departure from it, which is what John Resig seems to be most offended by.</p>
<h4>So naturally I posted a comment about my feelings..</h4>
<p>.. except not only did I manage to cock up the posting of the comment, but for all I know it will be taken down to punish me for my shameless self-promotion. So because of these reasons, and because I feel I made some good points, I thought I'd re-post my comment here with a tiny bit of editing.</p>
<p><code>--8&lt;-------</code><br />
I see your point when it comes to non-ECMAScript languages, but what about ActionScript? I chose AS3 to implement my &quot;abstraction&quot; called JASPA &#8211; <a href="http://jaspa.org.uk/">jaspa.org.uk</a></p>
<p>I know many JavaScript evangelists reject ActionScript, (especially due to its recent history with ES4), but it's like writing an extended version of JavaScript rather than a whole different language.</p>
<p>The OOP enhancements in ActionScript are intuitive and the syntax for procedural code remains largely the same. I would in fact argue that the OOP enhancements in ActionScript are much more intuitive than constructs like this:</p>
<pre>$(document).ready(function(){
   // ...
});</pre>
<p>- or sugaring approaches like this:</p>
<pre>Class.method('example', function(){
   // ...
});</pre>
<p>I appreciate what these kind of constructs achieve, but I cannot agree that they are particularly intuitive or respectful to the natural form of JavaScript. I would go further and suggest that people who aren't JavaScript experts may not see how these formations really relate to JavaScript syntax, particularly due to the use of whitespace.</p>
<p>There some libraries that convert functions to strings and overwrite them with altered versions &#8211; surely this approach is even less intuitive and has even less respect for JavaScript than an extended form which provides real OOP enhancements such as classes, packages, imports, and super; not to mention strict typing.</p>
<p>Anyhow, I would ask that anyone looking at JASPA realises that what I am doing is purely out of respect for what JavaScript is and what it isn't.</p>
]]></content:encoded>
			<wfw:commentRss>http://web.2point1.com/2009/01/03/a-response-to-jquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JASPA WIKI is launched</title>
		<link>http://web.2point1.com/2008/12/07/jaspa-wiki-is-launched/</link>
		<comments>http://web.2point1.com/2008/12/07/jaspa-wiki-is-launched/#comments</comments>
		<pubDate>Sun, 07 Dec 2008 21:06:37 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[JASPA]]></category>
		<category><![CDATA[mediawiki]]></category>
		<category><![CDATA[WIKI]]></category>

		<guid isPermaLink="false">http://web.2point1.com/2008/12/07/jaspa-wiki-is-launched/</guid>
		<description><![CDATA[I've set up a wiki on  jaspa.org.uk
I've been trying to find the time to sort out the official site for this project, and a wiki seems like a good format for organizing all the fragmented information that until now I've been posting on this blog. The wiki is likely to be the primary source of [...]]]></description>
			<content:encoded><![CDATA[<h3>I've set up a wiki on  <a href="http://www.jaspa.org.uk/">jaspa.org.uk</a></h3>
<p>I've been trying to find the time to sort out the official site for this project, and a wiki seems like a good format for organizing all the fragmented information that until now I've been posting on this blog. The wiki is likely to be the primary source of information and documentation on the JASPA project.</p>
<p>Check it out: <a href="http://www.jaspa.org.uk/wiki/JASPA">» <strong>jaspa.org.uk/wiki/JASPA </strong></a></p>
]]></content:encoded>
			<wfw:commentRss>http://web.2point1.com/2008/12/07/jaspa-wiki-is-launched/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JASPA example source code</title>
		<link>http://web.2point1.com/2008/11/29/jaspa-example-source-code/</link>
		<comments>http://web.2point1.com/2008/11/29/jaspa-example-source-code/#comments</comments>
		<pubDate>Sat, 29 Nov 2008 23:48:23 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[JASPA]]></category>

		<guid isPermaLink="false">http://web.2point1.com/2008/11/29/jaspa-example-source-code/</guid>
		<description><![CDATA[I've put together a repository of JASPA source code examples on jaspa.org.uk.
At jaspa.org.uk/examples you can view interactive examples and full, highlighted source code. These examples are going to grow, particularly those in the jaspa.dom package, as this is heavily under construction. When an API feature is enabled an example will be added to this repository [...]]]></description>
			<content:encoded><![CDATA[<h3>I've put together a repository of <a href="http://jaspa.org.uk/examples/jaspa/">JASPA source code examples</a> on jaspa.org.uk.</h3>
<p>At <a href="http://jaspa.org.uk/examples/jaspa/">jaspa.org.uk/examples</a> you can view interactive examples and full, highlighted source code. These examples are going to grow, particularly those in the <a href="http://web.2point1.com/2008/11/24/jaspadom-open-for-business/">jaspa.dom package</a>, as this is heavily under construction. When an API feature is enabled an example will be added to this repository to serve as both a reference and a test case.</p>
]]></content:encoded>
			<wfw:commentRss>http://web.2point1.com/2008/11/29/jaspa-example-source-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JASPA.DOM open for business</title>
		<link>http://web.2point1.com/2008/11/24/jaspadom-open-for-business/</link>
		<comments>http://web.2point1.com/2008/11/24/jaspadom-open-for-business/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 18:57:30 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[Event model]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[JASPA]]></category>
		<category><![CDATA[MSIE]]></category>

		<guid isPermaLink="false">http://web.2point1.com/2008/11/24/jaspadom-open-for-business/</guid>
		<description><![CDATA[JASPA.DOM is now an open source project on SourceForge
I've decided to set up an open source project for the jaspa.dom package; it is to be found on SourceForge.
http://sourceforge.net/projects/jaspa-dom. It's my first attempt at anything like this, so I'm bumbling around a bit, but the downloads are there and the CVS repository is also up and [...]]]></description>
			<content:encoded><![CDATA[<h4>JASPA.DOM is now an open source project on SourceForge</h4>
<p>I've decided to set up an open source project for the <code>jaspa.dom</code> package; it is to be found on SourceForge.<br />
<a href="http://sourceforge.net/projects/jaspa-dom/" target="_blank">http://sourceforge.net/projects/jaspa-dom</a>. It's my first attempt at anything like this, so I'm bumbling around a bit, but the downloads are there and the CVS repository is also up and running. Any developers who are serious about helping develop this API should put a request to join the project on SourceForge.</p>
<h4>What?</h4>
<p>The main <a href="http://web.2point1.com/2008/10/26/jaspa-faqs/">JASPA</a> project is a platform which allows you to write a grown up language (<a href="http://web.2point1.com/2008/10/29/jas-vs-actionscript/">practically identitcal to AS3</a>), and have it compiled into regular JavaScript. If you don't know why this is really cool, then you may as well stop reading now.</p>
<p><code>japsa.dom</code> is the name of the DOM scripting package which allows you to compile browser-based code with JASPA. It's a completely separate project, and is quite possibly larger and more complex. It is certainly less mature. The JASPA compiler is behaving pretty well, but the API code base is very much incomplete.<br />
<span id="more-76"></span></p>
<h4>Language vs API</h4>
<p>The thing about JavaScript is that it's pretty much an empty shell. You can't actually do anything without an API of some sort. Your web browser provides one such interface &#8211; it lets you access <code>window</code>, and <code>document</code> and generally lets you do stuff. Likewise the Flash Player provides <code>MovieClip</code> et al.</p>
<p>JASPA is API-neutral. That is to say that it just compiles code, but has no idea what <code>document</code> is until you tell it. This is actually quite easy, because JASPA supports native class definitions, so you can create a sort of class template and state that there's an object called <code>document</code> which has a property called <code>body</code>, and so on. In ActionScript these are known as intrinsic classes. In JASPA they are called native classes &#8211; (<code>native</code> is a reserved word in ECMAScript, so I thought I'd play ball).</p>
<p>Anyhow, this is all very well for Flash, because it knows there's going to be a MovieClip. In fact it's all very well for most environments that support JavaScript &#8211; except of course web browsers. You can't just call <code>document.addEventListener</code>, because our old friend MSIE doesn't have such a thing. It's known as <code>attachEvent</code> instead, and it's not just a naming issue either &#8211; the differences run deep, but that's another blog.</p>
<p>A poor solution would be to create a loosely typed global object. If the <code>Window</code> class was declared <em>dynamic </em>you could merrily type anything you wanted. The application would compile just fine, and if you're code is flawless your app would run fine too. But if you're going to do this then there's little point in using JASPA. You won't get code hints in your &quot;as&quot; editor, and you won't benefit from the compiler picking up your mistakes.</p>
<h4>Total abstraction</h4>
<p>A better solution would be to take this opportunity to build a complete abstraction layer. Wouldn't it be great if you only ever had to call the standard API functions, just like in ActionScript, and on any browser your code would just work. That, in a nutshell, is the purpose of the <code>jaspa.dom</code> package. To achieve this, the API consists of wrapper classes for practically every object in the browser environment. When writing your JAS code you will be largely unaware of this.</p>
<p>Some parts of the API go even further than just abstract the objects. due to the huge differences between the IE and the <em>standard</em> event model this is completely abstracted too. That is to say that event flow is emulated so the standard model works identically cross-browser.</p>
<p>As this article has become rather long, I'll go into some of the abstraction techniques in future posts.</p>
]]></content:encoded>
			<wfw:commentRss>http://web.2point1.com/2008/11/24/jaspadom-open-for-business/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JAS vs ActionScript</title>
		<link>http://web.2point1.com/2008/10/29/jas-vs-actionscript/</link>
		<comments>http://web.2point1.com/2008/10/29/jas-vs-actionscript/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 23:46:24 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[JASPA]]></category>

		<guid isPermaLink="false">http://web.2point1.com/2008/10/29/jas-vs-actionscript/</guid>
		<description><![CDATA[JAS is the language that the JASPA compiler converts to regular JavaScript; it is very similar to ActionScript 3.
The acronym JAS derives from JavaScript/ActionScript, but officially it means &#34;JavaScript; Advanced Syntax&#34;. This is partly due to potential trademark problems, and partly to make the distinction that it IS a separate language. The JASPA compiler contains [...]]]></description>
			<content:encoded><![CDATA[<p><strong>JAS is the language that the <a href="http://web.2point1.com/2008/10/26/jaspa-says-hello-world">JASPA compiler</a> converts to regular JavaScript; it is very similar to ActionScript 3</strong>.</p>
<p>The acronym <em>JAS</em> derives from JavaScript/ActionScript, but officially it means &quot;JavaScript; Advanced Syntax&quot;. This is partly due to potential trademark problems, and partly to make the distinction that it IS a separate language. The JASPA compiler contains absolutely no Adobe technology, or source code whatsoever.</p>
<p>The JAS syntax is designed to be as close to AS3 (ActionScript) as possible. When I say &quot;as possible&quot;, I mean that ideally I'd have made them identical, but for reasons too time-consuming to describe, certain things are in, certain things are out, and certain things behave a bit more like AS2. Ultimately JAS is an extension to the <a href="http://www.ecma-international.org/publications/standards/Ecma-262.htm" target="_blank">ECMAScript (ES3)</a> standard, proving the kind of OOP enhancements that ActionScript programmers will find very familiar.</p>
<p>I shall digress and describe the similarities and differences between JAS and both ActionScript languages, feature-by-feature.</p>
<p>[ UPDATE: See <a href="http://jaspa.org.uk/wiki/JAS_language">http://jaspa.org.uk/wiki/JAS_language</a> ]</p>
<p><span id="more-69"></span><strong>Strong typing</strong><br />
The same fundamental type-declaration principals of AS2 &amp; AS3 are in JAS. The AS3 <code>as</code> operator is supported as well as AS2-style type-casting.</p>
<p><strong>Untyped objects</strong><br />
The concept of an untyped object is supported, but AS3 wildcard syntax is not. i.e. <code>var Obj:*;</code> is invalid in JAS. To declare an object untyped, just don't declare any type at all. As per AS3, untyped objects are the only ones that may contain the special value <code>undefined</code>.</p>
<p><strong>Compile-time vs run-time</strong><br />
As per AS2, the JASPA compiler will not complete if there are type errors, or if illegal property access is attempted. However some runtime checks are also performed, particularly when AS2-style workarounds have been used to cheat the compiler.</p>
<p><strong>Packages &amp; Classes</strong><br />
AS3-style package and class declarations are supported, as are the folder/file naming conventions. Classes are imported with the <code>import</code> keyword. Package-level members are not supported, but there is an <code>internal</code> namespace. Unlike AS3, classes are not permitted outside a package declaration block. Private classes, (those available only within a class file), are defined inside the package block instead.</p>
<p><strong>Code hiding</strong><br />
<code>public</code>, <code>private</code>, <code>protected</code>, and <code>internal</code> namespaces are supported, but custom namespaces are not. Unlike AS2, cheating these namespaces at compile-time will result in run-time errors. The AS3 keywords <code>final</code> and <code>override</code> are also enforced.</p>
<p><strong>Interfaces &amp; abstract members</strong><br />
These are not currently supported, but rest assured they will be.</p>
<p><strong>Super calls</strong><br />
<code>super</code> is fully supported. Use of <code>super()</code> in class constructors is implemented as per AS3, which improves slightly on the AS2 implementation.</p>
<p><strong>Getters &amp; setters; property overloading</strong><br />
<code>get</code> and <code>set</code> function keywords are supported, and even enforced at runtime.</p>
<p><strong>Native XML (E4X)<br />
</strong>This is not implemented at all in the JAS syntax. There are no plans to support E4X.</p>
<p><strong>Meta data</strong><br />
Not supported at all. There is no plans and probably no reason to support such a thing.</p>
<p><strong>Closures</strong><br />
As per AS3, JAS supports <em>implicit</em> closures when passing, assigning or returning function objects. R.I.P Delegate.create!</p>
<p><strong>Constants</strong><br />
The <code>const</code> keyword is supported. At runtime constants are treated as read-only variables.</p>
<p><strong>Rest arguments operator</strong><br />
The <code>...</code> (RestArgs) operator is supported in function arguments as per AS3.</p>
<p><strong>Function parameter defaults</strong><br />
Default function parameters are supported;<br />
e.g. <code>function ( a:Number = 1 ){}</code></p>
<p><strong>int &amp; uint</strong><br />
After some experiments in implementing non-native integer classes, these have been omitted from JAS. They may be introduced in future, but as they will always be non-native there is little advantage of including them</p>
]]></content:encoded>
			<wfw:commentRss>http://web.2point1.com/2008/10/29/jas-vs-actionscript/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>JASPA FAQs</title>
		<link>http://web.2point1.com/2008/10/26/jaspa-faqs/</link>
		<comments>http://web.2point1.com/2008/10/26/jaspa-faqs/#comments</comments>
		<pubDate>Sun, 26 Oct 2008 19:42:37 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[JASPA]]></category>

		<guid isPermaLink="false">http://web.2point1.com/2008/10/26/jaspa-faqs/</guid>
		<description><![CDATA[Here are some answers to questions that I imagine would be frequently asked about JASPA if anyone was asking any.

I don't get it; what does it do?
It generates regular JavaScript from code written in a language called JAS, which is practically identical to AS3. You can write packages and classes, and take advantage of all [...]]]></description>
			<content:encoded><![CDATA[<h3>Here are some answers to questions that I imagine would be frequently asked about JASPA if anyone was asking any.</h3>
<p><span id="more-68"></span><br />
<strong>I don't get it; what does it do?</strong><br />
It generates regular JavaScript from code written in a language called <a href="http://web.2point1.com/2008/10/29/jas-vs-actionscript/">JAS</a>, which is practically identical to AS3. You can write packages and classes, and take advantage of all your favourite OOP features, and JASPA will convert this into code that will run perfectly in a web browser or any other environment that implements a compliant JavaScript engine.</p>
<p><strong>Can I convert my Flash projects into HTML sites?</strong><br />
No. JASPA really has nothing to do with Flash. The JAS language adopts the syntax of AS3; the relationship ends there.<br />
<strong><br />
Why doesn't JASPA compile my ActionScript successfully?</strong><br />
Firstly, the JAS language is not ActionScript &#8211; It is modelled very closely on it. <a href="http://web.2point1.com/2008/10/29/jas-vs-actionscript/">Full details of supported language features here</a>.<br />
Secondly, the API available in the Flash Player consists of objects that are unknown to JASPA. If you want to reference a class called MovieClip, you'll have to write one.<br />
<strong><br />
I love JQuery/Scriptaculous/etc.. Why should I use JASPA instead?</strong><br />
JASPA is not an effects library, and it is not designed to make your life easier. It is designed to empower you. If you think JQuery is the bees knees, then you should probably keep using it. However, if you want to write serious application logic that must run in JavaScript then JASPA is your man.</p>
<p><strong>Is JASPA free / open source?</strong><br />
The API code written in JavaScript and JAS is open source. It's released under the <a href="http://www.gnu.org/licenses/gpl.txt" target="_blank">GNU General Public License</a>, and the cross-browser API has even got its own <a href="https://sourceforge.net/projects/jaspa-dom/" target="_blank">Sourceforge project</a>. The compiler software written in PHP is free (as in <em>gratis</em>), but not strictly <a href="http://www.opensource.org/docs/osd" target="_blank">open source</a>. You can use the compilers free of charge as much as you like and generate JavaScript for any purpose you wish, but the PHP code is not distributed with a recognized free software license.</p>
<p><strong>What does JASPA stand for?</strong><br />
Offically: &quot;JavaScript; Advanced Syntax with PHP&quot;, but originally just a mish mash of JavaScript/ActionScript/PHP</p>
<p><strong>Does JASPA improve performance?</strong><br />
No. JASPA is a code generator, not a runtime engine. The code it generates cannot be any more efficient than whatever JavaScript engine executes it. Furthermore, JASPA is designed with robustness in mind, so you will probably find the code generated is quite long-winded and heavier than anything you would write from scratch.</p>
<p><strong>Why is the compiler written in PHP?<br />
</strong>The shortest answer is that I am a PHP developer. I'm sure if I was a Java developer it would be written in Java. It has some advantages being written in PHP. If you don't have access to a command line, the compiler can be run through the browser. Also there may be future development of JASPA that integrates more tightly with PHP.</p>
]]></content:encoded>
			<wfw:commentRss>http://web.2point1.com/2008/10/26/jaspa-faqs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JASPA says &#8220;Hello World&#8221;</title>
		<link>http://web.2point1.com/2008/10/26/jaspa-says-hello-world/</link>
		<comments>http://web.2point1.com/2008/10/26/jaspa-says-hello-world/#comments</comments>
		<pubDate>Sun, 26 Oct 2008 17:07:14 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[JASPA]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://web.2point1.com/2008/10/26/jaspa-says-hello-world/</guid>
		<description><![CDATA[JASPA is a JavaScript cross-compiler written in PHP.
Write robust object-orientated applications in a strongly-typed language (modelled on AS3) and compile it into regular JavaScript to run in a web page, or any other environment that implements a JavaScript engine.
Download JASPA from SourceForge
https://sourceforge.net/project/showfiles.php?group_id=243463


The JASPA project is split into two main components:

The compiler
The cross-browser abstraction API


1. The [...]]]></description>
			<content:encoded><![CDATA[<h3>JASPA is a JavaScript cross-compiler written in PHP.</h3>
<p>Write robust object-orientated applications in a strongly-typed language (<a href="http://web.2point1.com/2008/10/29/jas-vs-actionscript/">modelled on AS3</a>) and compile it into regular JavaScript to run in a web page, or any other environment that implements a JavaScript engine.</p>
<p><strong>Download JASPA from SourceForge<a href="/wp-content/uploads/jaspa-cli-compiler-0.2.3.tar.gz"><br />
</a></strong><a href="/wp-content/uploads/jaspa-cli-compiler-0.2.3.tar.gz"></a><a href="/jaspa-change-log/">https://sourceforge.net/project/showfiles.php?group_id=243463<br />
</a></p>
<p><span id="more-65"></span></p>
<h3>The JASPA project is split into two main components:</h3>
<ol>
<li><a href="#compiler">The compiler</a></li>
<li><a href="#dom">The cross-browser abstraction API</a></li>
</ol>
<p><a title="compiler" name="compiler"></a></p>
<h4>1. The compiler</h4>
<p>The compiler is API-neutral; Its job is to compile object-orientated code written in the <a href="http://web.2point1.com/2008/10/29/jas-vs-actionscript/">JAS syntax</a>, and convert it to regular, clean JavaScript suitable for running in any ECMAScript-compliant host program, such as a web browser. The compiler comes in two flavours: A command line compiler, which is the most useful; and also a web-based compiler which is handy in development and testing, or when a command line is not available.</p>
<p>The compiler is largely complete, but there is still some work to do to support some outstanding language features.<br />
<a title="dom" name="dom"></a></p>
<h4> 2. The cross-browser abstraction API</h4>
<p>If you want to build web applications with JASPA, the compiler needs to know about all the objects and methods exposed by the browser. This is easily achieved by writing native class interfaces, much like intrinsic classes in ActionScript. However, browser scripting today poses the same huge problem that it did 10 years ago; <em>Vendors don't all provide the same API</em>. Hence a comprehensive abstraction layer is required to provide a single, standardized interface that works across all modern browsers.</p>
<p>Although the JASPA compiler is largely complete and pretty stable, work on this API is still very much in progress.<br />
More about all of these topics will be organized into further blogs. In the mean time, please have a go with the compiler and let me know what you think of it.</p>
]]></content:encoded>
			<wfw:commentRss>http://web.2point1.com/2008/10/26/jaspa-says-hello-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
