可用于 Windows 的 JavaScript 编译器或解释器有哪些?
我最近读了书Eloquent JavaScript。本书向读者介绍了使用 JavaScript 作为第一语言进行编程。遗憾的是,这些程序仅限于在嵌入 HTML 的浏览器中运行。所以,我想知道是否可以编写可以独立执行的 JavaScript 程序。
编译器或解释器应该可以轻松地以“预编译的二进制文件”形式提供,可供初学者下载和安装。他应该能够编写使用该编译器编译的简单独立 JavaScript 程序。如果能与此编译器配合使用,额外的 JavaScript 库、框架、IDE 和调试支持将是一个优势。
Microsoft (R) JScript Compiler version 8.00.50727
for Microsoft (R) .NET Framework version 2.0.50727
Copyright (C) Microsoft Corporation 1996-2005. All rights reserved.
jsc [options] <source files> [[options] <source files>...]
JScript Compiler Options
- OUTPUT FILES -
/out:<file> Specify name of binary output file
/t[arget]:exe Create a console application (default)
/t[arget]:winexe Create a windows application
/t[arget]:library Create a library assembly
/platform:<platform> Limit which platforms this code can run on; must be x86, Itanium, x64, or anycpu, which is the default
- INPUT FILES -
/autoref[+|-] Automatically reference assemblies based on imported namespaces and fully-qualified names (on by default)
/lib:<path> Specify additional directories to search in for references
/r[eference]:<file list> Reference metadata from the specified assembly file
<file list>: <assembly name>[;<assembly name>...]
- RESOURCES -
/win32res:<file> Specifies Win32 resource file (.res)
/res[ource]:<info> Embeds the specified resource
<info>: <filename>[,<name>[,public|private]]
/linkres[ource]:<info> Links the specified resource to this assembly
<info>: <filename>[,<name>[,public|private]]
- CODE GENERATION -
/debug[+|-] Emit debugging information
/fast[+|-] Disable language features to allow better code generation
/warnaserror[+|-] Treat warnings as errors
/w[arn]:<level> Set warning level (0-4)
- MISCELLANEOUS -
@<filename> Read response file for more options
/? Display help
/help Display help
/d[efine]:<symbols> Define conditional compilation symbol(s)
/nologo Do not display compiler copyright banner
/print[+|-] Provide print() function
- ADVANCED -
/codepage:<id> Use the specified code page ID to open source files
/lcid:<id> Use the specified LCID for messages and default code page
/nostdlib[+|-] Do not import standard library (mscorlib.dll) and change autoref default to off
/utf8output[+|-] Emit compiler output in UTF-8 character encoding
/versionsafe[+|-] Specify default for members not marked 'override' or 'hide'
任何 Windows 安装上通常都会有几个副本,但它们通常不在路径中,因此您必须找到它们。
编译器能够将 javascript 文件编译为可执行文件,可以在任何安装了 .NET 的 Windows 计算机上运行。
可以很好地用作解释器,即使您不选择将其用于 Web 应用程序。它是一个运行在 V8 JavaScript 引擎上的框架。它有详细记录,有大量官方和第三方模块可供选择。 它确实需要 cygwin
才能在 Windows 上运行(或者您可以使用 MingW 编译它)。有预编译的二进制文件,包括所需的 cygwin 库,可在 node-js.prcn.co.cc. 获取。
有几个免费的独立 Javascript 解释器可用:editplus 中使用它,有时在 Aptana Studio 中使用它
好的,Windows Scripting Host 是使用 Microsoft 的http://msdn.microsoft.com/en-us/library/shzd7dy4(VS.85).aspx 忘记编译器
,顺便说一句,ECMAScript 是解释性语言(JIT 编译是另一个问题)另请注意,ECMAScript 标准没有定义任何标准 I/O,因此主机程序负责提供它。
在某些情况下
. 正如其他人所提到的,ECMAScript 的 JScript 实现在现代 Windows 安装中默认可用。扩展名为“.js”的文件可以双击执行或使用 cscript.exe 命令在命令行上运行。
https://deskjs.wordpress.com会议的 XUL 研讨会 - link。 总有
Nerd