summaryrefslogtreecommitdiff
path: root/README.md
blob: 6de8cabdc09afdea6e297e08ddc6e7bfbeb742cb (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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
[![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
🐺 φεγγάρι - A Lua VM written in JS ES6 targeting the browser

## So far

- [x] Lexing/Parsing
- [x] Parse bytecode
- [x] Opcodes
- [ ] Basic types representation:
    - [x] nil
    - [x] boolean
    - [x] table
        - [ ] weak table
    - [x] function
    - [x] string (8-bit clean)
    - [ ] number (32-bit ?)
        - [ ] integer
        - [ ] float
    - [ ] userdata
- [x] Tag Methods
- [ ] C API
    - [x] ...
    - [ ] lua_arith
    - [ ] lua_close
    - [ ] lua_gethook
    - [ ] lua_gethookcount
    - [ ] lua_gethookmask
    - [ ] lua_geti
    - [ ] lua_getinfo
    - [ ] lua_getlocal
    - [ ] lua_getstack
    - [ ] lua_getupvalue
    - [ ] lua_getuservalue
    - [ ] lua_isboolean
    - [ ] lua_iscfunction
    - [ ] lua_isfunction
    - [ ] lua_islightuserdata
    - [ ] lua_isthread
    - [ ] lua_isuserdata
    - [ ] lua_newuserdata
    - [ ] lua_pcallk
    - [ ] lua_pushfstring
    - [ ] lua_pushlightuserdata
    - [ ] lua_pushvfstring
    - [ ] lua_rawgetp
    - [ ] lua_rawseti
    - [ ] lua_rawsetp
    - [ ] lua_register
    - [ ] lua_setallocf
    - [ ] lua_sethook
    - [ ] lua_setlocal
    - [ ] lua_setuservalue
    - [ ] lua_tocfunction
    - [ ] lua_touserdata
    - [ ] lua_upvalueid
    - [ ] lua_upvaluejoin
- [ ] Auxiliary library
    - [x] ...
    - [ ] luaL_addsize
    - [ ] luaL_checkoption
    - [ ] luaL_checkudata
    - [ ] luaL_checkversion
    - [ ] luaL_dofile
    - [ ] luaL_dostring
    - [ ] luaL_execresult
    - [ ] luaL_fileresult
    - [ ] luaL_getmetatable
    - [ ] luaL_gsub
    - [ ] luaL_loadfile
    - [ ] luaL_loadfilex
    - [ ] luaL_newlibtable
    - [ ] luaL_newmetatable
    - [ ] luaL_optnumber
    - [ ] luaL_optstring
    - [ ] luaL_prepbuffer
    - [ ] luaL_pushresultsize
    - [ ] luaL_ref
    - [ ] luaL_setmetatable
    - [ ] luaL_testudata
    - [ ] luaL_traceback
    - [ ] luaL_unref
- [ ] Standard library
    - [ ] Base lib
        - [x] ...
        - [x] load
        - [ ] dofile
        - [ ] loadfile
    - [x] Coroutine
    - [x] Table
    - [x] Math
    - [x] utf8
    - [ ] String
        - [x] string.byte
        - [x] string.char
        - [x] string.dump
        - [x] string.format
        - [x] string.len
        - [x] string.lower
        - [x] string.rep
        - [x] string.reverse
        - [x] string.sub
        - [x] string.upper
        - [ ] string.find
        - [ ] string.gmatch
        - [ ] string.gsub
        - [ ] string.match
        - [ ] string.pack
        - [ ] string.packsize
        - [ ] string.unpack
    - [ ] Package
    - [ ] os
    - [ ] io
    - [ ] Debug
- [ ] Run [Lua test suite](https://github.com/lua/tests)
- [ ] 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)