[removed] Standalone compiler or interpreter for Windows?

前端 未结 9 736
半阙折子戏
半阙折子戏 2021-02-05 18:19

What are the JavaScript compilers or interpreters available for Windows?

I read the book Eloquent JavaScript recently.

相关标签:
9条回答
  • 2021-02-05 18:53

    Nobody has mentioned yet, window's own javascript compiler: 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'
    

    There are usually a couple of copies lying around on any windows install, but they are not usually in the path, so you have to find them.

    The compiler is capable of compiling javascript files into executables that can run on any windows machine with .NET installed.

    0 讨论(0)
  • 2021-02-05 18:56

    Have you tried Mozilla XUL & XULRunner? It is quite more complex than being just an interpreter but it runs also on MacOsX & Linux, not only Windows. Firefox and Thunderbird are written using it (yes, Firefox is written in Javascript!). There will be XUL workshop on FalsyValues conference in Warsaw next month - link.

    0 讨论(0)
  • 2021-02-05 18:57

    I also had the same need but eventually found an app called DeskJS (https://deskjs.wordpress.com). It's a free and portable Windows console application that lets you run pure JavaScript code and even load any existing JS files. It supports the basic JS popup boxes implemented in browsers. You can save your commands as JS files that can be run on startup or by dragging-and-dropping them on the app. Plus there's so much more to it like you can create a build system for Sublime Text that can run JS files via cmd, it supports themes for customizing the entire console and snippets which let you save short snippets of JavaScript code for later use. Improvements are still being made on the app together with other native APIs being included.

    0 讨论(0)
提交回复
热议问题