<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>IronJS Blog</title>
	<atom:link href="http://ironjs.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ironjs.wordpress.com</link>
	<description>All things IronJS and F#</description>
	<lastBuildDate>Wed, 20 Jul 2011 09:34:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='ironjs.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>IronJS Blog</title>
		<link>http://ironjs.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://ironjs.wordpress.com/osd.xml" title="IronJS Blog" />
	<atom:link rel='hub' href='http://ironjs.wordpress.com/?pushpress=hub'/>
		<item>
		<title>My gripes with JavaScript</title>
		<link>http://ironjs.wordpress.com/2011/06/22/my-gripes-with-javascript/</link>
		<comments>http://ironjs.wordpress.com/2011/06/22/my-gripes-with-javascript/#comments</comments>
		<pubDate>Wed, 22 Jun 2011 11:38:15 +0000</pubDate>
		<dc:creator>Fredrik Holmström</dc:creator>
				<category><![CDATA[IronJS]]></category>

		<guid isPermaLink="false">http://ironjs.wordpress.com/?p=71</guid>
		<description><![CDATA[Note: This post doesn&#8217;t mean I&#8217;ll stop working on IronJS, I love working on IronJS and will continue to do so to make it as fast and awesome as possible. Apparently my recent appearance on hanselminutes caused some stir on twitter. People think I was laying to heavily into JavaScript as a feasible platform for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ironjs.wordpress.com&amp;blog=21385172&amp;post=71&amp;subd=ironjs&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><em>Note: This post doesn&#8217;t mean I&#8217;ll stop working on IronJS, I love working on IronJS and will continue to do so to make it as fast and awesome as possible.</em></p>
<p>Apparently my recent <a href="http://www.hanselminutes.com/default.aspx?showID=291">appearance</a> on <a href="http://www.hanselminutes.com">hanselminutes</a> caused some stir on twitter. People think I was laying to heavily into JavaScript as a feasible platform for server side development (<a href="http://nodejs.org/">node.js</a>, etc.).</p>
<p>This might sound odd coming from someone that has built a JavaScript runtime, but my point of view after having developed <a href="https://github.com/fholm/IronJS">IronJS</a> is that there are a couple of critical problems with JavaScript that prevents it from ever being a viable alternative as development platform for server application development.</p>
<h3>Lack of language defined modules and namespaces</h3>
<p>The language doesn&#8217;t define the concept of a module or namespaces, several work-arounds exist like <a href="http://nodejs.org/docs/v0.4.8/api/globals.html#require">require</a> in node.js but there are several problems with using something with require.</p>
<ul>
<li>It&#8217;s implementation dependent, which means it&#8217;s not standardized and you can&#8217;t count on it existing in every javascript implementation.</li>
<li>You can re-write anything in any namespace at will, some people like this since it allows for something called <a href="http://en.wikipedia.org/wiki/Monkey_patch">monkey-patching</a>. However this just leads to a <a href="http://en.wikipedia.org/wiki/Monkey_patch#Pitfalls">whole new can of problems</a>.</li>
<li>You can replace the require function, or any other function for that matter, at a whim or by mistake leading to very hard to track bugs.</li>
</ul>
<h3>ECMA specification doesn&#8217;t define how to organize code over several files</h3>
<p>This ties into the previous modules and namespaces, but it&#8217;s such a major thing thing it has to be mentioned separately. The specification does not define how to load code from a file, this might seem like a minor issue as node &#8220;solved&#8221; it with <em>require</em>. But in reality the possible issues that can arise here are many.</p>
<p>For example, as already mentioned, require is specific to node.js and doesn&#8217;t exist on any other major platforms. There are major problems with having non-standardized and implementation specific behavior that effect such crucial parts of a language as loading code.</p>
<p>The most obvious one is how the code actually is loaded, for example:</p>
<pre class="brush: jscript;">
require(&quot;foo&quot;);
require(&quot;foo&quot;);
</pre>
<p>Is the &#8220;foo&#8221; module/file loaded/executed once or twice?</p>
<p>There&#8217;s also more subtle problems, such as: When you use require to load a piece of code, is the code executed in the global environment or the loading context?</p>
<pre class="brush: jscript;">
(function foo(bar) {
    require(&quot;foo&quot;);
}({x: 1}));
</pre>
<p>Is the code inside the &#8220;foo&#8221; module/file executed in the global scope or in the context of the foo function with &#8220;foo&#8221; and &#8220;bar&#8221; already bound? Most people will probably say &#8220;in the global scope&#8221;, but the designers of the PHP <a title="php include" href="http://www.php.net/manual/en/function.include.php" target="_blank">include</a> probably won&#8217;t agree.</p>
<p>And before you mention CommonJS: It is what <em>some</em> people think is <em>correct</em> and does in no way represent some type of standard</p>
<h3>Very small standard library</h3>
<p>The standard library, as defined by the specification is incredibly small (compared to the Python standard library, or the .NET BCL, etc.) and only gives you access to the most basic operations, not even I/O is included. Sure you can build your own library for a specific implementation, but it&#8217;s not going to be universal and it will tie the code that relies on it to that specific implementation.</p>
<h3>Language problems</h3>
<p>If you&#8217;ve ever written any moderate amount of JavaScript code you&#8217;ll know that there are several problems with the language itself, things like <em>with</em>, <em>eval</em> or the inner quirks of how JavaScript applies the concept of equality. The <a href="http://wtfjs.com/">http://wtfjs.com/</a> is a good read for some more WTF? moments.</p>
<h3>Null vs. undefined</h3>
<p>JavaScript has two &#8220;this is not here/doesn&#8217;t exist&#8221; values, they&#8217;re subtly different and <em>undefined</em> is the one that is most common. But why would you even have two different types of &#8216;nil&#8217; to begin with? I know of no other language in existence that does this (I&#8217;m sure someone reading this is going to dig up another language that has this).</p>
<h3>Context sensitive function keyword</h3>
<p>In case you didn&#8217;t know, these two functions are not identical:</p>
<p><a href="http://wtfjs.com/">http://wtfjs.com/</a></p>
<pre class="brush: jscript;">
(function bar() { })
function foo() { }
</pre>
<p>Finding out the difference I&#8217;ll leave as an exercise to the reader.</p>
<h3>Limited set of data types</h3>
<ul>
<li>Only 8 byte float numbers, how would you even interface to a database schema that has a 64bit integer column?</li>
<li>No fast (as in native) arrays</li>
<li>No int, byte, etc. number types</li>
</ul>
<h3>Fragmented runtimes</h3>
<p>While pretty much every single one of these problems could be fixed by either extending the specific runtime you&#8217;re using or by ECMA releasing a new standard, it&#8217;s just not that simple. Assuming you extend the runtime you&#8217;re using to allow for things like native/fast arrays and you define a module/namespace solution like node.js has done, now any code you write will only run on that specific runtime with your extensions which punches a big hole in the &#8220;same language everywhere&#8221;-argument that you hear every day on twitter (and it really is server-side JavaScript&#8217;s only claim to fame).</p>
<p>So what if ECMA releases a new standard that fixes every single problem I&#8217;ve listed above (this is no way an exhaustive list)? I can currently count to about six different runtimes in use today (JScript, JeagerMonkey, TraceMonkey, V8, Chakra, Carakan, Rhino). And that&#8217;s not even counting the small emerging ones like IronJS, Jurassic, Jint, etc. that are platform specific implementations for embedding. A lot of these runtimes are available in different versions in different browsers and will never be upgraded, so you&#8217;ll have to exclude all those new features in our new utopia-style ECMA specification if you wan&#8217;t to be &#8220;cross-runtime&#8221; compatible (which you need for web development at least).</p>
<h3>But what about node.js?</h3>
<p><em>First I want to make clear that IronJS is in no way a competitor to node.js, IronJS is a runtime &#8211; node.js is an application server that uses another runtime (V8).</em></p>
<p>Node is decently fast, sure. But it&#8217;s nowhere near as breathtakingly fast as it&#8217;s zealots want you to believe. Nor are any of the ideas it employs new or groundbreaking. It also comes with several warts that have been inherited from JavaScript which forces you to do manual <a href="http://en.wikipedia.org/wiki/Continuation-passing_style">continuation-passing style</a>. I just can&#8217;t see the reasoning behind using a language that wasn&#8217;t designed to be used in this context, it just feels like one big hack (albeit a pretty well preforming hack).</p>
<p>Assuming you want to run an asynchronous SQL query in node, it&#8217;d go something like this:</p>
<pre class="brush: jscript;">
db.query(&quot;select * from person&quot;, function(result) {
    print(result);
});
</pre>
<p>Now compare this to a language that actually was <em>designed </em>(F#):</p>
<pre class="brush: fsharp;">
async {
    let! result = db.query &quot;select * from person&quot;
    print result
}
</pre>
<h3>Conclusion</h3>
<p>The way I see it is that JavaScript has dug itself into a hole that is impossible to get out of, at least if you wan&#8217;t to keep &#8220;same language/code everywhere&#8221; idea alive. And if you&#8217;re not, then why would you use JavaScript when so <a href="http://en.wikipedia.org/wiki/List_of_programming_languages_by_category">many</a> <a href="http://en.wikipedia.org/wiki/F_Sharp_(programming_language)">better</a> (and <a href="http://luajit.org/">faster</a>) alternatives exist? There are so many problems with the language, I&#8217;ll list a couple more that I haven&#8217;t touched on but I think this image illustrates my point of view better then any words could:</p>
<p><a href="http://ironjs.files.wordpress.com/2011/06/31723_700b.jpg"><img class="aligncenter size-medium wp-image-108" title="31723_700b" src="http://ironjs.files.wordpress.com/2011/06/31723_700b.jpg?w=300&#038;h=242" alt="" width="300" height="242" /></a></p>
<ul>
<li>The scoping of the <em>this</em> keyword</li>
<li>Switch <em>case</em> fall through</li>
<li>Automatic semicolon insertion</li>
<li>Bitwise operators that work on doubles</li>
<li>Type wrappers and type conversions, <em>new String(&#8220;foo&#8221;)</em> vs. <em>&#8220;foo&#8221;</em></li>
<li>The<em> new </em>keyword makes function behavior dependent on the context they&#8217;re called from</li>
<li><em>with </em>and <em>eval </em>(it doesn&#8217;t hurt to mention these again)</li>
<li>The <em>arguments</em> object which is an array, almost. Except it&#8217;s not. And it&#8217;s also magically bound to the parameter variables</li>
<li>The <em>typeof </em>operator</li>
<li>The <em>global </em>object</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ironjs.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ironjs.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ironjs.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ironjs.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ironjs.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ironjs.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ironjs.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ironjs.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ironjs.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ironjs.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ironjs.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ironjs.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ironjs.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ironjs.wordpress.com/71/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ironjs.wordpress.com&amp;blog=21385172&amp;post=71&amp;subd=ironjs&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ironjs.wordpress.com/2011/06/22/my-gripes-with-javascript/feed/</wfw:commentRss>
		<slash:comments>74</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a6ff6e0849ad33a8e11d9ddf5367a72b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ironjs</media:title>
		</media:content>

		<media:content url="http://ironjs.files.wordpress.com/2011/06/31723_700b.jpg?w=300" medium="image">
			<media:title type="html">31723_700b</media:title>
		</media:content>
	</item>
		<item>
		<title>IronJS is now faster than IE8</title>
		<link>http://ironjs.wordpress.com/2011/04/25/ironjs-faster-than-ie8/</link>
		<comments>http://ironjs.wordpress.com/2011/04/25/ironjs-faster-than-ie8/#comments</comments>
		<pubDate>Sun, 24 Apr 2011 23:42:33 +0000</pubDate>
		<dc:creator>Fredrik Holmström</dc:creator>
				<category><![CDATA[IronJS]]></category>

		<guid isPermaLink="false">http://ironjs.wordpress.com/?p=51</guid>
		<description><![CDATA[We just hit a pretty major milestone in the dev branch of IronJS: We&#8217;ve surpassed IE8 in performance. I&#8217;ll try to keep this short and get straight to the point (the benchmarks), here is IronJS side-by-side to IE8, Jurassic and Jint (two other .NET based JavaScript runtimes). Note the Jint failed on several tests and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ironjs.wordpress.com&amp;blog=21385172&amp;post=51&amp;subd=ironjs&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We just hit a pretty major milestone in the dev branch of IronJS: We&#8217;ve surpassed IE8 in performance. I&#8217;ll try to keep this short and get straight to the point (the benchmarks), here is IronJS side-by-side to IE8, Jurassic and Jint (two other .NET based JavaScript runtimes).</p>
<p>Note the Jint failed on several tests and those have a zero as result. Click on the image for full size.</p>
<p><a href="http://ironjs.files.wordpress.com/2011/04/sunspider.png"><img class="aligncenter size-medium wp-image-53" title="Sunspider 0.9.1" src="http://ironjs.files.wordpress.com/2011/04/sunspider.png?w=600&#038;h=330" alt="Sunspider 0.9.1" width="600" height="330" /></a></p>
<p>We&#8217;ve still got a long way to go until we reach our goal (within 300% of V8), but it&#8217;s looking good so far!</p>
<p>Update: Here&#8217;s the total test score also</p>
<p><a href="http://ironjs.files.wordpress.com/2011/04/sunspider-total.png"><img class="aligncenter size-full wp-image-65" title="sunspider-total" src="http://ironjs.files.wordpress.com/2011/04/sunspider-total.png?w=600&#038;h=365" alt="" width="600" height="365" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ironjs.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ironjs.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ironjs.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ironjs.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ironjs.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ironjs.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ironjs.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ironjs.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ironjs.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ironjs.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ironjs.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ironjs.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ironjs.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ironjs.wordpress.com/51/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ironjs.wordpress.com&amp;blog=21385172&amp;post=51&amp;subd=ironjs&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ironjs.wordpress.com/2011/04/25/ironjs-faster-than-ie8/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a6ff6e0849ad33a8e11d9ddf5367a72b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ironjs</media:title>
		</media:content>

		<media:content url="http://ironjs.files.wordpress.com/2011/04/sunspider.png?w=600" medium="image">
			<media:title type="html">Sunspider 0.9.1</media:title>
		</media:content>

		<media:content url="http://ironjs.files.wordpress.com/2011/04/sunspider-total.png" medium="image">
			<media:title type="html">sunspider-total</media:title>
		</media:content>
	</item>
		<item>
		<title>IronJS 0.2 is out</title>
		<link>http://ironjs.wordpress.com/2011/04/19/ironjs-0-2-is-out/</link>
		<comments>http://ironjs.wordpress.com/2011/04/19/ironjs-0-2-is-out/#comments</comments>
		<pubDate>Tue, 19 Apr 2011 20:56:00 +0000</pubDate>
		<dc:creator>Fredrik Holmström</dc:creator>
				<category><![CDATA[IronJS]]></category>

		<guid isPermaLink="false">http://ironjs.wordpress.com/?p=48</guid>
		<description><![CDATA[IronJS 0.2 IronJS is an ECMAScript 3.0 implementation built on top of the Dynamic Language Runtime from Microsoft which allows you to embed a javascript runtime into your .NET applications. Thanks to John Gietzen for all his work on ECMA3 conformance whom without this would not have been possible Christian Knutsson for the awesome logo [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ironjs.wordpress.com&amp;blog=21385172&amp;post=48&amp;subd=ironjs&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1>IronJS 0.2</h1>
<p>IronJS is an ECMAScript 3.0 implementation built on top of the Dynamic Language Runtime from Microsoft which allows you to embed a javascript runtime into your .NET applications.</p>
<h2>Thanks to</h2>
<ul>
<li>John Gietzen for all his work on ECMA3 conformance whom without this would not have been possible</li>
<li>Christian Knutsson for the awesome logo</li>
</ul>
<h2>Changelog</h2>
<ul>
<li>ECMA3 Conformance</li>
<li>Added 5,500 ECMA3 conformance tests with over 30,000 assertions</li>
<li>Major API refactoring moving all Module/Functions located in Api.fs to their appropiate classes in Core.fs instead</li>
<li>Re-implemented the AST analyzer to make it single pass</li>
<li>Re-implemented variable handling allowing for faster and easier compilation</li>
<li>Removed the dependancy of Microsoft.Dynamic.dll for CLR4 projects</li>
<li>Removed dependancy on FSKit</li>
<li>Implemented the Date object</li>
<li>Implemented the RegExp object</li>
<li>Implemented missing functionality on String.prototype (match, split, search, replace)</li>
<li>Implemented F# operators ? and ?</li>
<li>Implemented F# operators for all common binary DLR expressions</li>
<li>Implemented a Sputnik test suite runner, courtesy of John Gietzen</li>
<li>Implemented a proper REPL console, available in the aptly named &#8220;REPL&#8221; project.</li>
<li>Implemented dynamic invoke operators for calling IronJS functions with an unknown amount of arguments</li>
<li>Implemented a new F# based lexer and parser which allows IronJS to drop the dependencies on Xebic.ES3.dll and Antlr.Runtime.dll</li>
<li>Cleaned up and removed a lot of old/redundant code</li>
<li>Renamed ObjectClass to &#8220;Schema&#8221; and split out the dynamic functionallity into it&#8217;s own DynamicSchema class</li>
<li>Replaced the FunctionCompiler class with an F# function with the signature IronJS.FunctionObject -&gt; System.Type -&gt; #Delegate</li>
<li>A lot of smaller improvements to code stability and readability</li>
<li>Added debug constructs in big parts of the codebase that only gets compiled when the DEBUG flag is set</li>
<li>Refactored several constructors in the IronJS.Ast.Tree union to be more obvious</li>
<li>Unified error handling, so it all passes through IronJS.Error and its members</li>
</ul>
<h2>Binary</h2>
<ul>
<li><a href="http://github.com/downloads/fholm/IronJS/ironjs-0.2-clr4-x64.zip">CLR4 x64</a></li>
<li><a href="http://github.com/downloads/fholm/IronJS/ironjs-0.2-clr4-x86.zip">CLR4 x86</a></li>
<li><a href="http://github.com/downloads/fholm/IronJS/ironjs-0.2-clr2-x64.zip">CLR2 x64</a></li>
<li><a href="http://github.com/downloads/fholm/IronJS/ironjs-0.2-clr2-x86.zip">CLR2 x86</a></li>
<li><a href="http://github.com/downloads/fholm/IronJS/ironjs-0.2-mono2.10-x64.tar.gz">Mono 2.10 x64</a></li>
<li><a href="http://github.com/downloads/fholm/IronJS/ironjs-0.2-mono2.10-x86.tar.gz">Mono 2.10 x86</a></li>
</ul>
<h2>Source</h2>
<ul>
<li><a href="http://github.com/fholm/IronJS/commits/0.2">0.2 tag on github</a></li>
<li><a href="http://github.com/fholm/IronJS">master branch on github</a></li>
</ul>
<h2>Information</h2>
<ul>
<li><a href="http://ironjs.wordpress.com">IronJS Blog</a></li>
<li>IRC: #ironjs @ irc.freenode.net</li>
<li>Twitter: <a href="http://twitter.com/ironjs">@ironjs</a></li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ironjs.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ironjs.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ironjs.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ironjs.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ironjs.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ironjs.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ironjs.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ironjs.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ironjs.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ironjs.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ironjs.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ironjs.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ironjs.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ironjs.wordpress.com/48/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ironjs.wordpress.com&amp;blog=21385172&amp;post=48&amp;subd=ironjs&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ironjs.wordpress.com/2011/04/19/ironjs-0-2-is-out/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a6ff6e0849ad33a8e11d9ddf5367a72b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ironjs</media:title>
		</media:content>
	</item>
		<item>
		<title>JavaScript Quotations</title>
		<link>http://ironjs.wordpress.com/2011/03/26/javascript-quotations/</link>
		<comments>http://ironjs.wordpress.com/2011/03/26/javascript-quotations/#comments</comments>
		<pubDate>Sat, 26 Mar 2011 09:24:46 +0000</pubDate>
		<dc:creator>Fredrik Holmström</dc:creator>
				<category><![CDATA[IronJS]]></category>

		<guid isPermaLink="false">http://ironjs.wordpress.com/?p=33</guid>
		<description><![CDATA[Lately I&#8217;ve been working on the ECMA3 conformance in IronJS, but last night I did a small side-tour into something completely different: JavaScript Quotations. The ideal is similar to the one found in F# code quotations or Lisp macros, not as evolved as any of them though &#8211; but still pretty nice. I wanna say right now that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ironjs.wordpress.com&amp;blog=21385172&amp;post=33&amp;subd=ironjs&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Lately I&#8217;ve been working on the ECMA3 conformance in IronJS, but last night I did a small side-tour into something completely different: JavaScript Quotations. The ideal is similar to the one found in <a title="F#" href="http://msdn.microsoft.com/en-us/fsharp/default">F#</a> <a title="Code Quotations" href="http://msdn.microsoft.com/en-us/library/dd233212.aspx">code quotations</a> or <a title="Lisp macros" href="http://www.apl.jhu.edu/~hall/Lisp-Notes/Macros.html">Lisp macros</a>, not as evolved as any of them though &#8211; but still pretty nice. I wanna say right now that this is my own extension to the JavaScript language and it&#8217;s not something you can do in any browser or other implementation (that I know of).</p>
<p>What it does is it introduces a new symbol, @ &#8211; stolen from <a title="F#" href="http://msdn.microsoft.com/en-us/fsharp/default">F#</a>, which gives you access to the syntax tree of a function during runtime and allows you to modify it as you see fit and then compile it to a regular JavaScript function. While it could be abused to no end it allows for some pretty interesting possibilities. The example I&#8217;m going to show creates a function which reads a property out of an object, and optionally compiles a console.log statement into the function body.</p>
<pre class="brush: jscript;">
function makeLoggedPropertyReader(includeLog, propertyName) {
    // Note the @ symbol infront of the function keyword
    var quoted = @function (x) {
        if(x) {
            console.log(x);
        }

        return x._;
    };

    // This is how the quoted structure looks like,
    // it's basically a syntax tree that you can
    // traverse, modify as you see fit and then compile

    /*
    quoted = {
        type: 19, // function
        body: [
            {
                type: 18, // if statement
                test: {
                    type: 5, // identifier
                    value: &quot;x&quot;
                },
                trueBranch: [
                    {
                        type: 9, // method call
                        target: {
                            type: 5, // identifier
                            value: &quot;console&quot;
                        },
                        member: {
                            type: 5, // identifier
                            value: &quot;log&quot;
                        },
                        arguments: [
                            {
                                type: 5, // identifier
                                value: &quot;x&quot;
                            }
                        ]
                    }
                ],
                elseBranch: {
                    type: 0 // void node
                }
            },
            {
                type: 25, // return
                value: {
                    type: 43, // property accessor
                    object: {
                        type: 5, // identifier
                        value: &quot;x&quot;
                    },
                    name: {
                        type: 5, // identifier
                        value: &quot;_&quot; // the value we're going to replace
                    }
                }
            }
        ]
    }
    */

    // The first statement in the qouted body
    // is the ifStatement, which we will conditionally
    // remove depending on the boolean value of includeLog
    if(!includeLog) {
        quoted.body[0] = Quotations.voidStatement();
    }

    // Pull the second statement out of the function body
    var returnStmt = quoted.body[1];

    // Pull the value node out of the return statement
    var propertyAccessor = returnStmt.value;

    // Set the value of the &quot;name&quot; node of the property accessor
    // to the string value of the propertyName that is passed in
    propertyAccessor.name.value = propertyName.toString();

    // We've modified our qouted expression
    // and we can now compile it so it
    // becomes a
    return quoted.compile();
}

// And here we'll use it:

var logged = makeLoggedPropertyReader(true, &quot;myProp&quot;);
var notLogged = makeLoggedPropertyReader(false, &quot;myProp&quot;);

var myObj = {myProp: &quot;hello world&quot;}

var xValue = logged(myObj); // will return and print the value of myProp to console.log
var xValue = notLogged(myObj); // will only return the value of myProp
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ironjs.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ironjs.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ironjs.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ironjs.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ironjs.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ironjs.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ironjs.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ironjs.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ironjs.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ironjs.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ironjs.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ironjs.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ironjs.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ironjs.wordpress.com/33/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ironjs.wordpress.com&amp;blog=21385172&amp;post=33&amp;subd=ironjs&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ironjs.wordpress.com/2011/03/26/javascript-quotations/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a6ff6e0849ad33a8e11d9ddf5367a72b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ironjs</media:title>
		</media:content>
	</item>
		<item>
		<title>Analyzer: Single-Pass vs. Multi-Pass</title>
		<link>http://ironjs.wordpress.com/2011/03/21/analyzer-single-pass-vs-multi-pass/</link>
		<comments>http://ironjs.wordpress.com/2011/03/21/analyzer-single-pass-vs-multi-pass/#comments</comments>
		<pubDate>Mon, 21 Mar 2011 17:42:33 +0000</pubDate>
		<dc:creator>Fredrik Holmström</dc:creator>
				<category><![CDATA[IronJS]]></category>

		<guid isPermaLink="false">http://ironjs.wordpress.com/?p=17</guid>
		<description><![CDATA[I recently wrote about the new lexer and parser in IronJS, giving a 8x performance boost to parsing. Over the past two days I&#8217;ve been looking at the AST analyzer IronJS has been using, and how to improve it. The analyzer steps through the AST produced by the parser and figures out things like closures, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ironjs.wordpress.com&amp;blog=21385172&amp;post=17&amp;subd=ironjs&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently wrote about <a title="New lexer and parser in IronJS" href="http://ironjs.wordpress.com/2011/03/19/new-lexer-and-parser-in-ironjs/">the new lexer and parser</a> in IronJS, giving a 8x performance boost to parsing. Over the past two days I&#8217;ve been looking at the AST analyzer IronJS has been using, and how to improve it. The analyzer steps through the AST produced by the parser and figures out things like closures, static types, dynamic scopes, etc. Due to the non-mutable nature of <a title="Discriminated Unions" href="http://msdn.microsoft.com/en-us/library/dd233226.aspx">discriminated unions</a> in F# it has been forced to re-build the syntax tree to resolve everything it needs to, since it sometimes required changes to, it has also been a doing several passes over the syntax tree.</p>
<p>I&#8217;m glad to announce that with some clever use of <a title="Reference Cells" href="http://msdn.microsoft.com/en-us/library/dd233186.aspx">reference cells</a> I&#8217;ve been able to both eliminate the need to re-build the AST and also, due to having access to the internals of the new <a title="Top Down Operator Precedence" href="http://javascript.crockford.com/tdop/index.html">TDOP</a>-based parser, manged to make it require only a single pass over the syntax tree, the performance difference is pretty staggering.</p>
<p style="text-align:center;"><img class="aligncenter size-full wp-image-19" title="Milliseconds to parse and analyze jQuery 1.5.1" src="http://ironjs.files.wordpress.com/2011/03/milliseconds-to-parse-and-analyze-jquery.png?w=624&#038;h=328" alt="Milliseconds to parse and analyze jQuery 1.5.1" width="624" height="328" /></p>
<p style="text-align:left;">As you can see with both the new parser and analyzer it&#8217;s a whopping ~13x faster then the old ANTLR based parser and multi-pass analyzer. It&#8217;s also ~4x faster then the new parser with the old multi-pass analyzer.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ironjs.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ironjs.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ironjs.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ironjs.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ironjs.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ironjs.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ironjs.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ironjs.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ironjs.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ironjs.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ironjs.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ironjs.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ironjs.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ironjs.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ironjs.wordpress.com&amp;blog=21385172&amp;post=17&amp;subd=ironjs&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ironjs.wordpress.com/2011/03/21/analyzer-single-pass-vs-multi-pass/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a6ff6e0849ad33a8e11d9ddf5367a72b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ironjs</media:title>
		</media:content>

		<media:content url="http://ironjs.files.wordpress.com/2011/03/milliseconds-to-parse-and-analyze-jquery.png" medium="image">
			<media:title type="html">Milliseconds to parse and analyze jQuery 1.5.1</media:title>
		</media:content>
	</item>
		<item>
		<title>New lexer and parser in IronJS</title>
		<link>http://ironjs.wordpress.com/2011/03/19/new-lexer-and-parser-in-ironjs/</link>
		<comments>http://ironjs.wordpress.com/2011/03/19/new-lexer-and-parser-in-ironjs/#comments</comments>
		<pubDate>Sat, 19 Mar 2011 19:46:39 +0000</pubDate>
		<dc:creator>Fredrik Holmström</dc:creator>
				<category><![CDATA[F#]]></category>
		<category><![CDATA[IronJS]]></category>

		<guid isPermaLink="false">http://ironjs.wordpress.com/?p=10</guid>
		<description><![CDATA[I&#8217;ve been thinking about replacing the lexer and parser IronJS has been using for a year now, which is an ANTLR generated LL(*) parser. The main drive behind this is that I&#8217;ve been wanting to shed the two DLL dependencies the parser caused, first the runtime for ANTLR (Antlr3.Runtime.dll) and then the parser itself (Xebic.ES3.dll) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ironjs.wordpress.com&amp;blog=21385172&amp;post=10&amp;subd=ironjs&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been thinking about replacing the lexer and parser IronJS has been using for a year now, which is an ANTLR generated LL(*) parser. The main drive behind this is that I&#8217;ve been wanting to shed the two DLL dependencies the parser caused, first the runtime for ANTLR (Antlr3.Runtime.dll) and then the parser itself (Xebic.ES3.dll) &#8211; since it was C# it wasn&#8217;t possible to integrate the code into the IronJS F# code base and it had to be linked as a separate assembly.</p>
<p>I&#8217;m glad to announce that I&#8217;ve finally gotten around to do this and that the new F# based lexer and parser were pushed to the master branch on github earlier today. I also decided to remove the dependency on Microsoft.Dynamic.dll which I only did about ten calls into. This means IronJS now only requires FSKit other then itself, the plan is to merge the FSKit functionality that IronJS requires into the IronJS project itself so it will only be one DLL.</p>
<p>Another great benefit of rewriting the parser in F# is a pretty nice speed boost, if I can direct your attention to the chart below you will see that the new lexer and parser is about eight times faster on the jQuery 1.5.1 (uncompressed) source code. This of course means that IronJS i getting even faster then it was.</p>
<p><img class="aligncenter size-full wp-image-8" title="Lexing and parsing speed" src="http://ironjs.files.wordpress.com/2011/03/lexing-parsing-speed.png?w=625&#038;h=329" alt="Lexing and parsing speed" width="625" height="329" /></p>
<p>Also, keep your eyes open for the first 0.2 beta that will arrive shortly.</p>
<p><strong>Update:</strong></p>
<p>I got a question on IRC on how the profiling was done, so here&#8217;s a description of it.</p>
<ul>
<li>System.Threading.Thread.CurrentThread.Priority was set to System.Threading.ThreadPriority.Highest</li>
<li>Timing was done with the System.Diagnostics.Stopwatch class</li>
<li>The source code was loaded into memory before lexing and parsing so no disk penalty would occur</li>
<li>The machine, which is a i7 Quad Core with 8Gb of ram, was restarted between each test and as many processes as possible were killed when Windows was done booting</li>
<li>The projects were compiled in release mode with full optimizations and no debug info</li>
<li>Each test was ran ten times before timing started to make sure all assemblies were loaded in memory and there would be no JIT overhead</li>
<li>After the ten warm-up runs the test was ran 100 times, the ten fastest were picked and averaged</li>
</ul>
<p>If there are any flaws in the above process please do point them out and I will re-do the test and post new results.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ironjs.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ironjs.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ironjs.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ironjs.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ironjs.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ironjs.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ironjs.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ironjs.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ironjs.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ironjs.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ironjs.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ironjs.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ironjs.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ironjs.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ironjs.wordpress.com&amp;blog=21385172&amp;post=10&amp;subd=ironjs&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ironjs.wordpress.com/2011/03/19/new-lexer-and-parser-in-ironjs/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a6ff6e0849ad33a8e11d9ddf5367a72b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ironjs</media:title>
		</media:content>

		<media:content url="http://ironjs.files.wordpress.com/2011/03/lexing-parsing-speed.png" medium="image">
			<media:title type="html">Lexing and parsing speed</media:title>
		</media:content>
	</item>
	</channel>
</rss>
