summaryrefslogtreecommitdiff
path: root/README.md
blob: 84a4db06bd3e9360ccf715ec626c81336da1385e (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
94
95
96
97
98
99
100
101
102
103
104
105
106
[![Build Status](https://travis-ci.org/giann/fengari.svg?branch=master)](https://travis-ci.org/giann/fengari) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

<p align="center">
    <img src="https://github.com/giann/fengari/raw/master/logo.png" alt="Fengari" width="304" height="304">
</p>

# fengari
🐺 φεγγάρι - The Lua VM written in JS ES6 for Node and the browser

## So far

- [x] Lexing/Parsing
- [x] Parse bytecode
- [x] Opcodes
- [x] Basic types representation:
- [x] Tag Methods
- [ ] Standard library
    - [x] Base lib
    - [x] Coroutine
    - [x] Debug
    - [x] Math
    - [x] String
    - [x] Table
    - [x] utf8
    - [x] os (~~`os.setlocale()`~~)
    - [x] Package
    - [ ] io
        - [x] `file:__tostring()`
        - [x] `file:write()`
        - [x] `io.close()`
        - [x] `io.stderr`
        - [x] `io.stdin`
        - [x] `io.stdout`
        - [x] `io.write()`
        - [ ] `io.flush()`
        - [ ] `io.input()`
        - [ ] `io.lines()`
        - [ ] `io.open()`
        - [ ] `io.output()`
        - [ ] `io.popen()`
        - [ ] `io.read()`
        - [ ] `io.tmpfile()`
        - [ ] `io.type()`
        - [ ] `file:flush()`
        - [ ] `file:lines()`
        - [ ] `file:read()`
        - [ ] `file:read()`
        - [ ] `file:setvbuf()`
        - [ ] `file:__gc()`
- [ ] C API
    - [x] ...
    - [ ] `lua_arith`
    - [ ] `lua_islightuserdata`
    - [ ] `lua_register`
    - [ ] `lua_setallocf`
    - [ ] `lua_tocfunction`
- [ ] Auxiliary library
    - [x] ...
    - [ ] `luaL_addsize`
    - [ ] `luaL_checkoption`
    - [ ] `luaL_checkversion`
    - [ ] `luaL_newlibtable`
    - [ ] `luaL_optnumber`
    - [ ] `luaL_prepbuffer`
    - [ ] `luaL_pushresultsize`
    - [ ] `luaL_ref`
    - [ ] `luaL_unref`
- [ ] Run [Lua test suite](https://github.com/lua/tests)
    - [x] `calls.lua`
    - [x] `constructs.lua` (`_soft`)
    - [x] `locals.lua`
    - [x] `strings.lua`
    - [x] `vararg.lua`
    - [ ] `all.lua`
    - [ ] `api.lua`
    - [ ] `attrib.lua`
    - [ ] `big.lua`
    - [ ] `bitwise.lua`
    - [ ] `checktable.lua`
    - [ ] `closure.lua`
    - [ ] `code.lua`
    - [ ] `coroutine.lua`
    - [ ] `db.lua`
    - [ ] `errors.lua`
    - [ ] `events.lua`
    - [ ] `files.lua`
    - [ ] `gc.lua`
    - [ ] `goto.lua`
    - [ ] `heavy.lua`
    - [ ] `literals.lua`
    - [ ] `main.lua`
    - [ ] `math.lua`
    - [ ] `nextvar.lua`
    - [ ] `pm.lua`
    - [ ] `sort.lua`
    - [ ] `tpack.lua`
    - [ ] `utf8.lua`
    - [ ] `verybig.lua`
- [ ] DOM API binding

## 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)