Windows 开箱即用支持的语言

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7657843/
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-09-15 18:12:06  来源:igfitidea点击:

Languages that Windows supports out of the box

windowsprogramming-languagesinstallationcross-compiling

提问by Tom

I have been asked to write a (very) simple program for a set of Windows machines (XP I think) - so simple that the choice of language isn't really an issue. However, I want to be able to distribute a binary/script that will run straight away on the Windows machine, without the need to pre-install any interpretor or virtual machine. I'm developing on a Linux machine and I have no idea what languages Windows supports 'out of the box'. Can anyone advise?

我被要求为一组 Windows 机器(我认为是 XP)编写一个(非常)简单的程序 - 如此简单以至于语言的选择并不是真正的问题。但是,我希望能够分发可以直接在 Windows 机器上运行的二进制文件/脚本,而无需预先安装任何解释器或虚拟机。我正在 Linux 机器上开发,我不知道 Windows 支持哪些语言“开箱即用”。任何人都可以建议吗?

For example

例如

  • Perl would be great but I don't believe windows machines come with Perl pre-installed? Asking the user to install Perl to use my script is not acceptable.
  • I believe Python has the same problem? (although maybe I can use the PyInstaller? -- as in this question)
  • Likewise Java? Is the virtual machine pre-installed on most Windows distributions? (I understand it got removed after a dispute with Sun Microsystems?)
  • Perl 会很棒,但我不相信 Windows 机器预装了 Perl?要求用户安装 Perl 以使用我的脚本是不可接受的。
  • 我相信 Python 也有同样的问题?(虽然也许我可以使用 PyInstaller? -就像在这个问题中一样
  • 同样是Java?大多数 Windows 发行版中是否预装了虚拟机?(我知道它在与 Sun Microsystems 发生争执后被删除了?)

The only option I can think of so far is

到目前为止我能想到的唯一选择是

  • c/c++ with MinGW cross-compiler.
  • c/c++ 与 MinGW 交叉编译器。

While I'm happy to write the code in c++, I wanted to check my language options first.

虽然我很高兴用 C++ 编写代码,但我想先检查我的语言选项。

采纳答案by David Heffernan

The only scripting languages supported out of the box are the batch interpreter, vbscript and jscript. Other than that you are into compiled languages. A good option could be C# but make sure you target the .net version that shipped with XP.

唯一支持的脚本语言是批处理解释器、vbscript 和 jscript。除此之外,您正在使用编译语言。一个不错的选择可能是 C#,但请确保您的目标是 XP 附带的 .net 版本。

回答by Marco van de Voort

Delphi and Lazarus/FreePascal generate native applications that don't even need on MSVCRT

Delphi 和 Lazarus/FreePascal 生成甚至不需要在 MSVCRT 上的本机应用程序

Some of the other systems have requirements on relatively new MSVCRT versions that might be a burden on older windows versions.

其他一些系统对相对较新的 MSVCRT 版本有要求,这可能是旧 Windows 版本的负担。

However recent Lazarus and Delphi versions stop supporting windows NT4 and Win9x, with win2000 in a gray area (not supported but works afaik)

然而最近的 Lazarus 和 Delphi 版本停止支持 windows NT4 和 Win9x,win2000 处于灰色区域(不支持但可以正常工作)

Having an internal win32/64 linker makes it also an excellent choice for crosscompiling from *nix to Windows.

拥有一个内部的 win32/64 链接器使它也是从 *nix 到 Windows 交叉编译的绝佳选择。

回答by Dragi

I don't think that Java comes pre-installed on Windows.

我不认为 Java 是预装在 Windows 上的。

I'm not using Windows for some years now, but if I correctly remember you can develop scripts with VBScript or JScript and deploy them without need for clients to install anything.

我已经有几年不使用 Windows 了,但如果我没记错的话,您可以使用 VBScript 或 JScript 开发脚本并部署它们,而无需客户端安装任何东西。

回答by Ramon Snir

Any language which compiled to pure native assembly (without special run-time dependencies) should be fine. For example: many C variations (but not all), Microsoft Visual C++, Microsoft Visual Basic 6, OCaml, Haskell and more.

任何编译为纯本机程序集(没有特殊运行时依赖项)的语言都应该没问题。例如:许多 C 变体(但不是全部)、Microsoft Visual C++、Microsoft Visual Basic 6、OCaml、Haskell 等等。

Requiring the .NET Framework (which gives you also C#, VB.NET and F#) is reasonable, and also JVM is pretty standard (and so you get Java, Closure and Scala).

需要 .NET Framework(它还为您提供 C#、VB.NET 和 F#)是合理的,而且 JVM 也是非常标准的(因此您可以获得 Java、Closure 和 Scala)。