Friday, January 6, 2012

RPT: .NET as a webpage language.

Stumbled on:

 Github link:

From their site:


IL2JS is .NET Framework, which allows to use any .NET language (for example C#) instead of JavaScript on your HTML page
It generates JavaScript, CSS and HTML files from .NET DLL files. It also allows for simple use of synchronous and asynchronous calls of .NET server-side methods, making AJAX and Comet style applications easier. All code before transformation to JavaScript is statically verified and optimized by .NET compiler, and then optimized to use features specific to JavaScript.
  • The main emphasis of project is to make generated JavaScript code as small as possible and allow for aggressive caching of files and data by browsers and proxy servers.
  • Second point of project is to make Web development easier in single environment (instead of mix of CSS, JavaScript, HTML, and server side scripts) and to remove manually added glue layers (automatic serializations, double form validation, error handling(partial)).
Generated JavaScript code uses prototype.js library. You can easily use other libraries in your code.
We are supporting both MS .NET 3.0 environment, as well Mono 2.4, and newer versions.



IL2JS framework supports multitude of basic features, which will drastically simplify common tasks of a webdeveloper. To list few most important:
  • dom - easily use standard HTML DOM interfaces to dynamically (and actually also statically) operate on Web Page, and interact with it in real time.
  • dotnet_methods - Many class/methods from System.* are available, and their usage is converted to equivalent JavaScript code. This can be easily and flexibly be extended by user.
  • ajax - automatically perform AJAX queries in multiple ways, ranging from just calling method to asynchronous events and error handling.
  • syntax - use all cool things and syntactic sugars from C#, or other .NET languages.
  • threads - write simple multi-threaded application which will run in the browser using standard Thread methods. Locking mechanisms are implemented.
  • exceptions - simplifies error handling. It even handles situations when exception was thrown on the Server side of AJAX call!
  • jsnative - allows for using JavaScript code directly in .NET. It also helps user in creating bindings to JavaScript interfaces and libraries, so they can be used transparently.
Now this is interesting.
Quite a bit of potential if you know .net but not javascript.  But I'm sure there is a penalty on speed/memory/etc.  This might be a great tool as a transitional element, for people moving from .NET to javascript, as I'm sure quite a few people are doing.  I remember learning C#/VB.NET sometime around 2002/2003 writing gdi+/bitblt/dx games trying to wrap/port all of my old stuff to .net, it was fun, it was long ago.  I don't know if I still have the chops to dive into .net, or the want really.  Javascript is my current future of hobby programming for the short term future.

No comments:

Post a Comment