2
0

main.lua 471 B

1234567891011121314
  1. -- I wish we could just say `lua blah.so` to run the C code in our experiments.
  2. -- But since we can't do that then we need to use a "main.lua" entrypoint.
  3. local modname = assert(arg[1])
  4. local N = arg[2] and tonumber(arg[2])
  5. -- As a convenience, allow either a module name or a file name
  6. -- This plays nice with the shell tab-completion.
  7. local prefix, _ = string.match(modname, "(.*)%.(.*)")
  8. if prefix then
  9. modname = prefix
  10. end
  11. local main = require(modname)
  12. main(N)