Portable scripting language for a multi-server admin? Portable scripting language for a multi-server admin? windows windows

Portable scripting language for a multi-server admin?


I urge you to try Lua. Regarding your requirements:

  • Tiny footprint (56 source files, under 150K compiled)
  • Runs everywhere (uses only ANSI C)
  • No installer needed; you compile from source (there's also a "batteries included" package that I haven't explored
  • Doesn't need JVM and works with any ANSI C compiler, so you can compile with Visual Studio, not Cygwin
  • Works with external processes and files but only to the extent supported by ANSI C. If POSIX popen is provided then that is supported also.

And your bonus points:

  • Open source (MIT license)
  • FFI to C is brilliantly conceived and executed—not quite as simple as Tcl but loads more powerful. Much better integration with C than Python or Ruby.
  • GUI support is mixed but there are good bindings for wx widgets. QT support was there at one time but I don't know if it has been maintained.
  • Linux is supported
  • Language/compiler features:
    • Dynamic
    • Functional
    • Prototype-based objects and inheritance through metamethods (you'll want to see examples in the book below
    • Fastest bytecode compiler in the West
    • Interactive read-eval-print loop; load new code dynamically
  • Able to package scripts into executables; either use Luiz de Figueiredo's srlua, or I can send you a 120-line Lua script that converts Lua source to a .c file that you link in with your app and the interpreter to make an executable.

Additional bonus points:


There are a couple of options for Python that might fit your bill:

  • The first is IronPython, which can be run without an installer and will play nicely with .net APIs. This gives you access to anything with a .net API or a COM typelib that you could build a PIA for. I've used at as a scripting mechanism for precisely this reason - it could be dropped into a directory within the system and did not need to be explicitly installed..

    You will have to have an appropriate .Net runtime installed, but .Net 2.0 is installed with SQL Server 2005. SQL Server can be accessed through ADO.net and building GUIs with Winforms is fairly straightforward.

  • The second is Portable Python which is designed to be run off a USB key. Although I see you've already tried it, you might elaborate on what the shortcomings were. If something isn't available in the basic install you could always look into building a custom version with it included. TkInter (at least) is bundled.

    You can also use Py2EXE to generate standalone python applications with all superfluous junk stripped out. This will give you about 10 files or so (depending on the number of DLLs) that can be run from a single directory, possibly on a USB key.

Running local python installs on Unix-oid OS's is pretty straightforward, so that's pretty much a no brainer. Also, python comes with most linux distros and is available as 'contributed software' from most if not all trad unix vendors. IIRC it's also bundled with MacOS.


Tclkit is a single-file, self-contained Tcl/Tk system. The mac version I have is about 3.8 megs. You can get a version for just about any modern OS. I carry around a thumb drive that has mac, windows and linux binaries so I can run my scripts on any platform. No install is required, just copy one file wherever you want.

The only thing it's missing from your original spec is MS SQL Server / ODBC support out of the box. I know people use tcl for that but I think you'll have to add an extra library or something. See the Tcl'ers wiki entry on MS SQL Server for more information.