Development Team/scripting
Embeded scripting support for services-darenet.
We've narrowed the choices down to Python and Lua. Below are some comparisons between both.
General Comparisons
Python
- Huge library of very useful functionality.
- ctypes, allowing access to existing shared libraries without having to write a C wrapper.
- Remote debugger.
- Extensive slicing for strings and lists, which is a big productivity gain.
- Sensitive to whitespace.
- Binary operators built in.
- Static type checking.
- Extensive catalog of example scripts, tutorials, help and general reference material.
Lua
- Smaller footprint. E.g., a basic Lua engine, including parser/compiler/interpreter (excluding standard libraries) weighs in at under 100kb.
- Uses less memory.
- Faster interpreter (Lua vs. Python).
- Nice, simple API for C, with very little generation of glue code required. Try creating and manipulating lists and dictionaries in Python and then doing in Lua.
- Does not use reference counting for objects which can become complex and error prone.
- Nice, simple and very powerful syntax. From experience, I find you can write the same thing in Lua with less code than Python with more flexibility due to Lua's metamechanisms (e.g., tables are lists and dictionaries combined in Lua (though you can also make them behave like PythonLists and PythonDictionaries). Anonymous functions are useful for configuring things. In Python you get their poor cousin, lambda functions.
- Small, simple, stable codebase (see point 1).
- Few external modules making it easy to bundle Lua for a specialized purpose. Although, a vanilla build has less functionality compared to Python.
- Lua does support multiple threading. Multiple Lua intrepreters can exist in the same process and each one can run independently in its own thread. Thus Lua is more suitable for embedding in multithreaded programs.
- Lua is not whitespace sensitive.