Portable scripting language for a multi-server admin?

后端 未结 7 1783
误落风尘
误落风尘 2021-02-14 03:44

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

7条回答
  •  你的背包
    2021-02-14 04:19

    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:

    • Very crisp, clean, well-designed language.
    • Small enough to master in its entirety and to be productive within a day.
    • Superb book Programming in Lua (check out the previous edition free online)

提交回复
热议问题