tsuki-0.1.1 has been yanked.
Tsuki
Tsuki is a port of Lua 5.4 to Rust. This is porting, not binding; which mean all code are Rust and can be using without C compiler. The initial works was done by C2Rust. Note that this port was done without compatibility with the previous version. You can see a list of the differences here.
[!IMPORTANT] Tsuki does not support multi-threading and no plan to support this at the moment.
Features
- 100% Rust code.
- libc is required at the moment.
- Support both synchronous and asynchronous.
- Safe and low overhead API.
- Any error propagated to the caller via Rust
Resultinstead of a long jump. core::any::Anyas Lua userdata and can be created without the need to define its metatable.- Metatable for a userdata is lookup with
core::any::TypeIdinstead of a string.
Differences from Lua
Language
- Binary chunk is not supported.
- Panic when memory allocation is failed without retry (Rust behavior).
- Chunk name does not have a prefix (e.g.
@). - Second argument to
__closemetamethod alwaysnil. __gcmetamethod is not supported.__namemetavalue must be UTF-8 string.__tostringmetamethod must return a UTF-8 string.- C locale is ignored (once
libchas been completely removed).
Standard library
- No
_VERSION,collectgarbage,dofile,loadfile,xpcall,string.dumpand debug library. - Second argument of
assertaccept only a UTF-8 string. - Arguments of
error:- First argument accept only a UTF-8 string.
- Second argument is not supported and it is always assume 1.
- Arguments of
load:- First argument accept only a string.
- Second argument accept only a UTF-8 string and will be empty when absent.
- Third argument must be
nilor"t".
warnis enabled by default without message prefixes and does not support control message.string.formatrequires UTF-8 string for both format string and format value.- Native module is not supported.
- Environment variable
LUA_PATHandLUA_PATH_5_4is ignored. LUA_NOENVin registry is ignored.
Non-goals
- Become a superset of Lua (e.g. Luau).
- C API compatibility.
- Stand-alone mode.
- 16-bit systems.
Roadmap
- Support Windows.
- Remove libc.
- JIT using Cranelift.
License
MIT