Search code examples
javascript.netvisual-studioprogramming-languagesextensibility

Javascript as a managed dynamic .net language


Visual Studio language extensibility

Does anybody know whether there's an open source (or paid) project that extends Visual Studio with managed Javascript as a server side .net language so it gets compiled to IL and executed as an everyday .net application?

We got used to dynamic nature of Javascript and since C# 4.0 also supports dynamic I don't see any particular reason why Javascript couldn't be used as a server side .net language in Visual Studio. I'm sure many would be very happy to use it. Although it could get confusing in Asp.net applications because of the same language on both ends. But that could be resolved with file extensions by file extensions. Server-side files shouldn't use the *.js extension (Client-side JavaScript), but rather something like .ssjs (Server-side JavaScript).

It would actually make this like a node.js application but with less lines of code and full .net functionality at hand.

Wouldn't that be great?

What can be found on the internet

  • Managed JScript - this seems to be exactly what I am after, but several sources say it's a dead project; since it was an experiment on the DLR (Dynamic Language Runtime);
  • MyJScript - just a tutorial of how to write a DLR compiler, conicidentally using Javascript/JScript as a language
  • JScript.NET - this is not entirely like Javascript (it extends original syntax which I think is bad) and it also seems to be a long dead project anyway (as per @grapeot).

Solution

  • Are you aware of IronJS?

    And of JScript.NET?

    They may be attempts to do just that.

    On the other hand, one could ask why J#.NET didn't succeed. It was designed to make the transition to .NET easier for people who knew Java, but apparently they didn't want to. Maybe because c# was too similar, but that may apply to c# and Javascript as well, given the existence of dynamic which you mention.