gpt4 book ai didi

JavaScript:适用于 Windows 的独立编译器或解释器?

转载 作者:可可西里 更新时间:2023-11-01 12:33:36 26 4
gpt4 key购买 nike

可用于 WindowsJavaScript 编译器或解释器有哪些?

我读了这本书 Eloquent JavaScript 最近。本书向读者介绍使用 JavaScript 作为第一语言进行编程。遗憾的是,这些程序仅限于在嵌入 HTML 的浏览器中运行。所以,我想知道是否可以编写可以独立执行的 JavaScript 程序。

编译器或解释器应该作为预编译的二进制文件很容易获得,初学者可以下载和安装。他应该能够编写使用此编译器编译的简单的独立 JavaScript 程序。额外的 JavaScript 库、框架、IDE 和调试支持可与此编译器配合使用。

最佳答案

还没有人提到,window自带的javascript编译器:http://msdn.microsoft.com/en-us/library/vstudio/7435xtz6(v=vs.100).aspx

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 机器上运行的可执行文件。

关于JavaScript:适用于 Windows 的独立编译器或解释器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5742128/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com