Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 292
Robin Rodricks Avatar asked May 08 '13 06:05

Robin Rodricks


People also ask

Can I use JavaScript with C?

js is written in low-level languages like C and C++, it can talk to other programs that are written in C and C++ and vice-versa.

Which is better C or JavaScript?

If you want to start a simple web application, then learning Javascript instead of C is a fine approach. If you want to learn to write a desktop app, then Javascript is absolutely the wrong way to go about this.

Is C or JavaScript harder?

Even despite readability, ultimately C++ is also harder than JavaScript to learn because there are many more aspects of the language that you need to master. The syntax needs to be more precise, you have to write more code, you need to understand static type systems, garbage collection, and much more.


1 Answers

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
like image 146
Robin Rodricks Avatar answered Oct 13 '22 23:10

Robin Rodricks