summaryrefslogtreecommitdiff
path: root/README.md
blob: a965fb668cd8200d129a901d4373841828c15a4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# fengari
🐺 φεγγάρι - A Lua VM written in JS ES6 targeting the browser

## So far

- [x] Parse bytecode
- [ ] VM
    - [ ] Opcodes
        - [x] `OP_MOVE`
        - [x] `OP_LOADK`
        - [x] `OP_LOADKX`
        - [x] `OP_LOADBOOL`
        - [x] `OP_LOADNIL`
        - [x] `OP_GETUPVAL`
        - [x] `OP_SETUPVAL`
        - [x] `OP_GETTABUP`
        - [x] `OP_GETTABLE`
        - [x] `OP_SETTABUP`
        - [x] `OP_SETTABLE`
        - [x] `OP_NEWTABLE`
        - [x] `OP_SELF`
        - [x] `OP_ADD`
        - [x] `OP_SUB`
        - [x] `OP_MUL`
        - [x] `OP_MOD`
        - [x] `OP_POW`
        - [x] `OP_DIV`
        - [x] `OP_IDIV`
        - [x] `OP_BAND`
        - [x] `OP_BOR`
        - [x] `OP_BXOR`
        - [x] `OP_SHL`
        - [x] `OP_SHR`
        - [x] `OP_UNM`
        - [x] `OP_BNOT`
        - [x] `OP_NOT`
        - [ ] `OP_LEN`
        - [ ] `OP_CONCAT`
        - [x] `OP_JMP`
        - [x] `OP_EQ`
        - [x] `OP_LT`
        - [x] `OP_LE`
        - [x] `OP_TEST`
        - [x] `OP_TESTSET`
        - [x] `OP_CALL`
        - [x] `OP_TAILCALL`
        - [x] `OP_RETURN`
        - [x] `OP_FORLOOP`
        - [x] `OP_FORPREP`
        - [x] `OP_TFORCALL`
        - [x] `OP_TFORLOOP`
        - [x] `OP_SETLIST`
        - [x] `OP_CLOSURE`
        - [x] `OP_VARARG`
        - [x] `OP_EXTRAARG`
    - [ ] Tag Methods
        - [ ] `__index`
        - [ ] `__newindex`
        - [x] `__gc` (unavailable)
        - [ ] `__mode`
        - [ ] `__len`
        - [ ] `__eq`
        - [ ] `__add`
        - [ ] `__sub`
        - [ ] `__mul`
        - [ ] `__mod`
        - [ ] `__pow`
        - [ ] `__div`
        - [ ] `__idiv`
        - [ ] `__band`
        - [ ] `__bor`
        - [ ] `__bxor`
        - [ ] `__shl`
        - [ ] `__shr`
        - [ ] `__unm`
        - [ ] `__bnot`
        - [ ] `__lt`
        - [ ] `__le`
        - [ ] `__concat`
        - [ ] `__call`
    - [ ] Debug (errors)
- [ ] C API
- [ ] stdlib
- [ ] DOM API binding
- [ ] Parse Lua
- [ ] Generate bytecode

## References

- [Source code for Lua 5.3](lua.org/source/5.3/)
- [Lua 5.2 Bytecode and Virtual Machine](http://files.catwell.info/misc/mirror/lua-5.2-bytecode-vm-dirk-laurie/lua52vm.html)
- [Lua 5.3 Bytecode Reference](http://the-ravi-programming-language.readthedocs.io/en/latest/lua_bytecode_reference.html)
- [A No-Frills Introduction to Lua 5.1 VM Instructions](http://luaforge.net/docman/83/98/ANoFrillsIntroToLua51VMInstructions.pdf)