Domanda

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).
È stato utile?

Soluzione

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.

Altri suggerimenti

You may be interested in Jscript.NET [MSDN] [Wiki]. Note it's first introduced around 2000. Some people claim Microsoft has an improved compiler in .NET 4, while some claim it's discontinued as this post discussed.

In Mono, an open source implementation of CLR, they support JavaScript as a working language, known as IronJS. [ref]

Microsoft has introduced TypeScript, which compiles to Javascript. But, Typescript or Javascript apps can not be deployed on the .NET runtime (yet). A key language feature of Javascript and Smalltalk are block closures (a flexible kind of anonymous function, defined inline in a method). .NET DLR can't support this feature. There are work-arounds but not a complete framework to deplay Javascript (or Amber Smalltalk, which compiles to Javascript) apps on .NET

Microsoft hired a Smalltalk virtual machine expert (D. Simmons) to work on their Javascript VM for IE. I hope that expertise trickles down to .NET

Somebody must be working on it? It would be awesome to have Amber Smalltalk apps deployed on .NET

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top