Skip to content

Luau #870

@bjornbytes

Description

@bjornbytes

The luau branch has a working version of LÖVR that uses Luau instead of LuaJIT. You can run stuff like this:

function lovr.load()
  local a: number = 1_000
  a += 1
  print(`a is {a}`)
end

This issue is meant to track/discuss the status of Luau in LÖVR. Luau has many differences from both Lua and LuaJIT, and some things are missing and/or broken. There are also interesting things about Luau that remain to be explored, like experimenting with its vectors and integrating with tooling for typechecking.

Known issues:

  • require doesn't exist
  • os.getenv doesn't exist (decided to leave as-is)
  • collectgarbage doesn't exist (should polyfill, see this, remove hack from test/conf.lua once finished)
  • Plugins don't work (lovr-http and lua-enet fork could be updated to support luau?)

Pending investigations:

  • Vectors (integrating into lovr.math's vector API, performance, 3 vs. 4 component vectors)
  • Does it work on WebAssembly?
  • Test on Android
  • Should LÖVR also support .luau file extensions? (Added)
  • Native code generation
  • Imports/sandboxing
  • __namecall optimization
  • Should we be using lua_newuserdatadtor and/or tagged userdata?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions