Languages that Windows supports out of the box

2019-06-28 04:27发布

问题:

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?

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?)

The only option I can think of so far is

  • c/c++ with MinGW cross-compiler.

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

回答1:

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.



回答2:

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

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

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

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



回答3:

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.

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).



回答4:

I don't think that Java comes pre-installed on 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.