views:

595

answers:

6

What is the best compilable scripting language for Win32? I prefer .EXE's because I don't want to install the runtime on the servers first (my company administrates many via remote), but I need to be able to do things like NTFS permissions and (if possible) APIs over the network.

There was a small Perl which appeared to be able to do most of this, but it does not seem to have been updated/developed in quite a while. I have wondered about Lua, but I don't know if it has everything I need yet (and don't want to hunt through fifty library sites trying to find out). Any thoughts?

+4  A: 

Have you considered using an EXE maker? For example, you can code in Python and use py2exe to create a standalone EXE that runs anywhere (it actually packages Python into the exe, so you don't have to install the runtime).

Swaroop C H
py2exe is great...except when it comes to threading...
mmattax
+2  A: 

A scripting language is, almost by definition, not compiled into a standalone executable. So maybe you need to restate your intentions or give some indication about what kind of program you want to create.

C# is a powerful language that compiles to .EXE and allows you to interface with pretty much anything (through native p/invoke calls, if necessary). A basic but very usable Visual Studio for C# can be downloaded for free from the Microsoft website. The .NET runtime is installed on most systems nowadays.

Thomas
Actually `C#` compiles to `bytecode`, it just has a compiled stub. Which is a lot like py2exe or PAR (perl).
Brad Gilbert
I know, but it still compiles to .EXE. I never said that the .EXE contained only native code ;)
Thomas
+3  A: 

Ruby is my scripting language of choice.

Try RubyScript2Exe.

Antti Sykäri
That's interesting. Does Ruby do Win32 as thoroughly as Python?
Jonathan E. Brickman
A: 

That will do as my answer! I had investigated EXE generators for Python about two years ago, but the situation was rather different for the four or five relevant projects I found.

Jonathan E. Brickman
Add a comment to the relevant post instead of posting another answer. The order is defined by the votes not by the date posted so discussion doesn't work.
spoon16
You also won't risk being down voted.
Brad Gilbert
Before downvoting for posting instead of commenting, look at the poster's rep points. He only has 11 left (as of 7 hours after his post), which is a while yet before he has the necessary 50 rep points to post comments.
Chris OC
+1  A: 

Did you consider AutoIt ?

It is a scripting language, and you can quickly transform a script into an exe...

VonC
A: 

At OSCON 2005, I heard Damien Conway say "the only thing better than Perl is something that works well, even if it's not written in Perl."

It's good advice. Instead of looking for the best language that can be compiled to an .EXE, worry a lot more about writing it in a language that can be compiled to an .EXE. Use whatever works. Just remember that the quality of your programming matters infinitely more than what language you use.

That said, I like py2exe. YMMV. Good luck!

Rob Hansen