Saltarelle: open source C # - JavaScript compiler

Good afternoon. Our team (without links, it does not matter) decided to try a new tool compiler Saltarelle in the development of the project and, as Habr often helped us with useful information, and decided to make a modest contribution to its treasury of knowledge and transfer the recording to the developer blog.

Transfer


I have been developing web applications for a long time. Somehow in the old days I was looking forward to the decision of my employer related to the transition IE3 -> IE4, so that I could finally use the new function of dynamically adding rows to the table, which was then called DHTML. Subsequently, Remote Scripting appeared, read Ajax (only 8 year old sourdough) built into IFRAMEs or Java applets. Over the years, I realized that Javascript is indispensable when creating small features like form validation or dynamic text management, but it is not suitable for developing complex systems. Of course, you can write an excellent and large system in Javascript, only with the same success can you start developing an analog computing device for controlling artillery fire ( Eng / Rus), and I am convinced that you should not use tools that have more suitable alternatives for solving the problem. In 2007 or so, I came across Script # , the project that generated Javascript based on C #. I often used it the last few years, the idea is great! After all, it allows you to use all the C # buns in web development: ReSharper, IntelliSense and you will never see the error “the object does not support this property”. However, unfortunately, the development of Script # was discontinued and it seems that not a single new feature has been added over the past 3 plus years.

When .net 3.5 appeared, it did not support implicitly typed variables or lambda expressions (actually a lot of other things), and although not bad, it’s already deprecated. Moreover, its use in programming on the client side is much more annoying than on the server side. But now it's in the past. About a month ago, I finished the Saltarelle compiler . It was conceived as a replacement for Script #, only with almost full support for C # 4. Why almost, see below:



Either by reference . If a feature is not specified, then it is almost certainly supported (unless some kind is not explicit). And also my open source library ! In recent weeks, I have finished it and now it is stable and can be used. Here is a link to the Getting started guide(Eng) for those who are new to the idea, and here is a link to guide for migrating (Eng) for those who want to migrate with Script #.
I don’t think the tool is universal, but if you are developing a “thick” HTML application (especially, but not necessarily, if you are writing the server side on .net), then it will greatly facilitate your life.

License


The project was published under the Apache License 2.0 , it is permissive (Eng), i.e. can be used without any problems in any projects, whether commercial or not. The reason this license is used is because I used a library whose author is Nikhil Kothari and not me.

Also popular now: