Javascript 和 C# 交叉编译和转换

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16434389/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-27 04:40:12  来源:igfitidea点击:

Javascript and C# Cross Compiling and Conversion

c#javascriptcompiler-construction

提问by TheFlash

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.

将 Javascript 交叉编译或转换为 C# 并返回的各种工具有哪些?以及如何在 C# 中执行 JS 或在 JS 中执行 C#?这是一个受欢迎的问题,我将提供答案。

回答by TheFlash

Compile C# to Javascript

将 C# 编译为 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
  • SharpKit(站点) - 编写和调试 C# 4.0,编译为 JS
  • Blade- 编写 C# 并编译为 JS,DOM、HTML、CSS 接口
  • ScriptSharp- 编写 C# 并编译为 JS,支持 jQuery
  • Saltarelle- 编写 C# 5.0 并编译为 JS、LINQ、jQuery、NodeJS 支持
  • JSIL- 将 CIL 字节码编译为人类可读的 JS
  • JSC- 将 CIL 字节码编译为 JS、ActionScript、Java、PHP

Run Javascript in C#

在 C# 中运行 JavaScript

  • 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 JScriptEngine - Legacy scripting Javascript engine
  • IronJS- CLR/DLR 运行时上的 Javascript,Ecmascript 3.0
  • Jint- Javascript VM,Ecmascript 3.0
  • Jurassic- 将 JS 编译成 .NET CIL、ECMAScript 3 和 ECMAScript 5
  • MS JScriptEngine - 传统脚本 Javascript 引擎

Run C# In Javascript

在 Javascript 中运行 C#

  • Edge.js- Run C# code alongside Node.js, in-process
  • Edge.js- 在进程内与 Node.js 一起运行 C# 代码

回答by Kevin Driedger

Compile C# code to Javascript in Visual Studio:

在 Visual Studio 中将 C# 代码编译为 Javascript:

  • DuoCode- Roslyn based compiler that transforms C# to javascript
  • DuoCode- 基于 Roslyn 的编译器,可将 C# 转换为 javascript

回答by user2252545

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

JScriptSuite- 将 MSIL(C# 或其他 .NET 语言)编译为 JavaScript。允许调试原始 .NET (C#) 代码,提供数据绑定模板、远程接口、控件