Robin Rodricks
Robin Rodricks

Reputation: 113956

Javascript and C# Cross Compiling and Conversion

What are the various tools to cross-compile or convert Javascript to C# and back? And how to execute JS in C# or C# in JS? This is a popular question, and I will provide answers for it.

Upvotes: 21

Views: 19469

Answers (3)

Robin Rodricks
Robin Rodricks

Reputation: 113956

Compile C# to Javascript

  • SharpKit (site) - Write and debug C# 4.0, compile to JS
  • Blade - Write C# and compile to JS, Interfaces for DOM, HTML, CSS
  • ScriptSharp - Write C# and compile to JS, jQuery supported
  • Saltarelle - Write C# 5.0 and compile to JS, LINQ, jQuery, NodeJS supported
  • JSIL - Compile CIL bytecode to human-readable JS
  • JSC - Compile CIL bytecode to JS, ActionScript, Java, PHP

Run Javascript in C#

  • IronJS - Javascript on CLR/DLR Runtime, Ecmascript 3.0
  • Jint - Javascript VM, Ecmascript 3.0
  • Jurassic - Compiles JS into .NET CIL, ECMAScript 3 and ECMAScript 5
  • MS JScript Engine - Legacy scripting Javascript engine

Run C# In Javascript

  • Edge.js - Run C# code alongside Node.js, in-process

Upvotes: 27

user2252545
user2252545

Reputation: 21

JScriptSuite - compiles MSIL (C# or another .NET language) to JavaScript. Allows debug original .NET (C#) code, provides databind templates, remoting interfaces, controls

Upvotes: 2

Kevin Driedger
Kevin Driedger

Reputation: 54192

Compile C# code to Javascript in Visual Studio:

  • DuoCode - Roslyn based compiler that transforms C# to javascript

Upvotes: 5

Related Questions