sled icon indicating copy to clipboard operation
sled copied to clipboard

RFC: Scripting

Open vifino opened this issue 7 years ago • 1 comments

Not just scripting, but rather loading modules of different types.

My plan is to implement another module type, mod. It's basically a module loader, as as module. The idea is that we can implement a really bare-bones modloader in the core, add perhaps missing APIs and not only outsource the complex loading, but also allow the addition other loaders that aren't loading dynamic objects for example, but Lua or Scheme scripts. This could make the effect prototyping phase even faster, which is already something we're pretty good at.

Ideally, with this rework, we'd also support dynamic module loading and unloading, probably invoked via FISh.

  • [x] Introduce mod module type: Module loaders.
  • [x] Introduce mod_native for loading existing sled-native modules.
    • This can have quite some complexity, maybe introducing search paths and other goodies?
    • With this, feature parity to the existing master is reached.

  • [ ] Introduce mod_lua for Lua(JIT) based scripting. Same methods, but Lua.
    • Should be beginner-friendly, heh.
  • [ ] Introduce mod_chicken for CHICKEN scheme.
    • While Scheme's not everybody's favourite, it's pretty great.

vifino avatar Jul 06 '18 12:07 vifino

Regarding Lua: Nice idea, but a word of warning! Under no circumstances have both LuaJIT and Lua 5.2/5.3 as available options. Instead, add a simulation of (or the actual version of) the LuaJIT bit-manipulation library on Lua 5.1. The issues you'll get otherwise were bad enough with lua-cpuemus, let's not repeat Minetest's mistakes.

20kdc avatar Jul 06 '18 17:07 20kdc