articles/lua.md: update
This commit is contained in:
parent
5884fa542c
commit
8b1e6e63ae
1 changed files with 11 additions and 0 deletions
|
@ -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.
|
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.
|
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
|
## Examples
|
||||||
### Hello world
|
### Hello world
|
||||||
```lua
|
```lua
|
||||||
|
|
Loading…
Add table
Reference in a new issue