IronJS - In Conversation with Fredrik Holmström
Written by Nikos Vaggalis   
Wednesday, 11 July 2012
Article Index
IronJS - In Conversation with Fredrik Holmström
Why choose .NET?

NV: How is the AST transformed into the DLR tree?

FH: You walk over the AST with a function that has the signature "IronJS.Ast -> System.Linq.Expressions.Expression". It basically transforms the internal AST nodes into the equivalent DLR ones.

NV: Is System.Linq.Expressions a subset of DRL expressions?

FH: It's a superset, or rather an evolution, of the 3.5 version.

NV: So they can represent a full fledged language with statement lambdas?

FH: Yes

NV: I thought that this could happen only with .NET 4?

FH: If you run IronJS on a pre-4.0 version then you need to include the proper assemblies which can be downloaded and compiled from and all the same types will exist as in 4.0, just under a different namespace.

NV: I see. So what can a developer do with IronJS? Use the Windows GUI libraries, manipulate the XML DOM easier?

FH: IronJS itself doesn’t really come with a pre-defined use-case, I would say that anywhere you would like users of your application to be able to do their own scripting.

I know of a few people that have used it together with ASP.NET/MVC to both create view templates and some sort of ".net-nodejs-hybrid".

NV: Very interesting. Can you also control the browser through Silverlight ?

FH: Currently, no, there are a few low level things IronJS does which are not allowed in SL.

NV: Will IronJS for the browser be more safe since it would load on top of Silverlight which acts as a sandbox virtual environment and has the same restriction as the .NET VM? Would it make XSS attacks a thing of the past?

FH: It would not help against XSS, as this has nothing to do with the runtime itself, and with the quality of today's JavaScript runtimes I don't think there would be a huge benefit to run IronJS in the browser.

NV: Is the JavaScript GC model that lives in the browser different from the GC of IronJs? Have you plugged into the CRL one?

FH: IronJS uses the .NET GC.

NV: Can LINQ be used from IronJS? And what doors would such a possibility open? Like IronJStoSQL?

FH: It cannot, sadly.

NV: But if it could,what would that mean?

FH: There is nothing stopping you from exposing LINQ to IronJS manually, but it's not supported out of the box. Also, what it would mean to have Linq in IronJS? Not that much I think. Maybe I sound negative but JavaScript as a language is not very concise when using lambdas, etc.

NV: Performance wise are the static CLR languages faster than their DL counterparts?

FH: Yes they are faster, no doubt.

NV: The initial parsing was through F#, but now you've changed to C#,why is that?

FH: The parsing is still in F#, it's the core runtime classes that represent the JS environment that has been moved to C#. This was done by John Gietzen who contributed a lot of code and it was done because it's easier for other people to inter-op with them.

NV: So last question......are you aware of Parrot VM?

FH: Yes, I am.

NV: What made you choose to port JavaScript to DLR and not to that one?

FH: Honestly my contact with Microsoft and the trust in the quality of the code the DLR team put out. Also the DLR had been proven with IronRuby and IronPython. Nothing bad against Parrot though, as I have never even spoken to them.




More Information

IronJS on github

IronJS Blog

Parrot virtual machine

Related Articles

Homes found for Iron languages

Microsoft lets go of Iron languages

Microsoft's Dynamic languages are dying






or email your comment to:


To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, Facebook, Google+ or Linkedin,  or sign up for our weekly newsletter.



Last Updated ( Wednesday, 31 October 2012 )