articles/lua.md: update

This commit is contained in:
tocariimaa 2025-02-17 14:54:17 -03:00
parent 5884fa542c
commit 8b1e6e63ae

View file

@ -10,6 +10,17 @@ implementing arrays and hash tables in a single type and enabling metaprogrammin
The main reference implementation is written in [ANSI C](c.md) (about 32000 LOC) and uses a register-based bytecode virtual machine for execution.
Another notable implementation is [LuaJIT](https://luajit.org), which speeds up execution speed by JIT compiling the Lua code.
## Bytecode
`luac` can be used to compile and dump bytecode into a file. However the bytecode is not portable.
```sh
luac -o out source.lua
```
You can get a listing of the compiled bytecode for a Lua source file with `luac`:
```sh
luac -p -l -l source.lua
```
## Examples
### Hello world
```lua