Search code examples
windowsrubyprogramming-languagesscriptingportable-applications

Portable scripting language for a multi-server admin?


Please Note: Portable as in portableapps.com, not in the traditional sense of a language that can be used on multiple architectures or operating systems. Whoever coined this usage of the word portable should be whacked. :)

I'm a DBA and sysadmin, mostly for Windows machines running SQL Server. I'm looking for a programming/scripting language for Windows that doesn't require Admin access or an installer, needing no install process other than expanding it into a folder. My intent is to have a language for automation around which I can standardize.

Up to this point, I've been using a combination of batch files and Unix shell, using sh.exe from UnxUtils but it's far from a perfect solution.

I've evaluated a handful of options, all of them have at least one serious shortcoming or another. I have a strong preference for something open source or dual license, but I'm more interested in finding the right tool than anything else. Not interested that anything that relies on Cygwin or Java, but at this point I'd be fine with something that needs .NET.

Requirements:

  • Manageable footprint (1-100 files, under 30 MB installed)
  • Run on Windows XP and Server (2003+)
  • No installer (exe, msi)
  • No reliance on a JVM or Cygwin install
  • Works with external pipes, processes, and files
  • Support for MS SQL Server or ODBC connections

Bonus Points:

  • Open Source
  • FFI for calling functions in native DLLs
  • GUI support (native or gtk, wx, fltk, etc)
  • Linux, AIX, and/or OS X support
  • Dynamic, object oriented and/or functional, interpreted or bytecode compiled; interactive development
  • Able to package or compile scripts into executables

So far I've tried:

  • Ruby: 148 MB on disk, 23000 files
  • Portable Python: 54 MB on disk, 2800 files
  • Strawberry Perl: 123 MB on disk, 3600 files
  • REBOL: Great, except closed source and no MSSQL or ODBC in free version
  • Squeak Smalltalk: Great, except poor support for scripting

Solution

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