doc updates and some minor reformatting

pull/168/head
Dibyendu Majumdar 5 years ago
parent 72b5dc551a
commit 81b4b1fb35

@ -34,7 +34,7 @@ Features
* `LLVM <http://www.llvm.org/>`_ powered JIT compiler
* `Eclipse OMR <https://github.com/dibyendumajumdar/nj>`_ powered JIT compiler
* Built-in C pre-processor, parser and JIT compiler
* A `distribution with batteries <https://github.com/dibyendumajumdar/ravi-distro>`_.
* A `distribution with batteries <https://github.com/dibyendumajumdar/Suravi>`_.
Documentation
=============
@ -47,17 +47,17 @@ Documentation
Lua Goodies
===========
* `An Introduction to Lua <http://the-ravi-programming-language.readthedocs.io/en/latest/lua-introduction.html>`_ attempts to provide a quick overview of Lua for folks coming from other languages.
* `Lua 5.3 Bytecode Reference <http://the-ravi-programming-language.readthedocs.io/en/latest/lua_bytecode_reference.html>`_ is my attempt to bring up to date the `Lua 5.1 Bytecode Reference <http://luaforge.net/docman/83/98/ANoFrillsIntroToLua51VMInstructions.pdf>`_.
* `Lua 5.3 Bytecode Reference <http://the-ravi-programming-language.readthedocs.io/en/latest/lua_bytecode_reference.html>`_ is my attempt to bring up to date the `Lua 5.1 Bytecode Reference <http://luaforge.net/docman/83/98/ANoFrillsIntroToLua51VMInstructions.pdf>`_.
Compatibility with Lua
======================
Ravi should be able to run all Lua 5.3 programs in interpreted mode, but following should be noted:
Ravi should be able to run all Lua 5.3 programs in interpreted mode, but following should be noted:
* Ravi supports optional typing and enhanced types such as arrays (described above). Programs using these features cannot be run by standard Lua. However all types in Ravi can be passed to Lua functions; operations on Ravi arrays within Lua code will be subject to restrictions as described in the section above on arrays.
* Ravi supports optional typing and enhanced types such as arrays (described above). Programs using these features cannot be run by standard Lua. However all types in Ravi can be passed to Lua functions; operations on Ravi arrays within Lua code will be subject to restrictions as described in the section above on arrays.
* Values crossing from Lua to Ravi will be subjected to typechecks should these values be assigned to typed variables.
* Upvalues cannot subvert the static typing of local variables (issue #26) when types are annotated.
* Certain Lua limits are reduced due to changed byte code structure. These are described below.
* Ravi uses an extended bytecode which means it is not compatible with Lua 5.3 bytecode.
* Ravi uses an extended bytecode which means it is not compatible with Lua 5.3 bytecode.
+-----------------+-------------+-------------+
| Limit name | Lua value | Ravi value |
@ -80,21 +80,21 @@ When JIT compilation is enabled there are following additional constraints:
History
=======
* 2015
* 2015
- Implemented JIT compilation using LLVM
- Implemented libgccjit based alternative JIT (now discontinued)
* 2016
- Implemented debugger for Ravi and Lua 5.3 for `Visual Studio Code <https://github.com/dibyendumajumdar/ravi/tree/master/vscode-debugger>`_
* 2017
- Embedded C compiler using dmrC project (C JIT compiler)
* 2016
- Implemented debugger for Ravi and Lua 5.3 for `Visual Studio Code <https://github.com/dibyendumajumdar/ravi/tree/master/vscode-debugger>`_
* 2017
- Embedded C compiler using dmrC project (C JIT compiler)
- Additional type-annotations
* 2018
* 2018
- Implemented Eclipse OMR JIT backend
- Created `Ravi with batteries <https://github.com/dibyendumajumdar/ravi-distro>`_.
- Created `Ravi with batteries <https://github.com/dibyendumajumdar/Suravi>`_.
* 2019 (Plan)
- Release Ravi 1.0
- New parser, type checker and code generator
- Release Ravi 1.0
License
=======
MIT License for LLVM version.

@ -34,7 +34,7 @@ Features
* `LLVM <http://www.llvm.org/>`_ powered JIT compiler
* `Eclipse OMR <https://github.com/dibyendumajumdar/nj>`_ powered JIT compiler
* Built-in C pre-processor, parser and JIT compiler
* A `distribution with batteries <https://github.com/dibyendumajumdar/ravi-distro>`_.
* A `distribution with batteries <https://github.com/dibyendumajumdar/Suravi>`_.
Documentation
=============
@ -90,7 +90,10 @@ History
- Additional type-annotations
* 2018
- Implemented Eclipse OMR JIT backend
- Created `Ravi with batteries <https://github.com/dibyendumajumdar/ravi-distro>`_.
- Created `Ravi with batteries <https://github.com/dibyendumajumdar/Suravi>`_.
* 2019 (Plan)
- New parser, type checker and code generator
- Release Ravi 1.0
License
=======

@ -1605,10 +1605,10 @@ int luaV_execute (lua_State *L) {
vmcase(OP_EQ) {
TValue *rb = RKB(i);
TValue *rc = RKC(i);
int res;
int res;
Protect(
res = luaV_equalobj(L, rb, rc);
)
res = luaV_equalobj(L, rb, rc);
)
if (res != GETARG_A(i))
pc++;
else
@ -1856,7 +1856,7 @@ int luaV_execute (lua_State *L) {
}
h = hvalue(ra);
last = ((c-1)*LFIELDS_PER_FLUSH) + n;
savepc(L); /* in case of allocation errors */
savepc(L); /* in case of allocation errors */
if (h->ravi_array.array_type == RAVI_TTABLE) {
if (last > h->sizearray) /* needs more space? */
luaH_resizearray(L, h, last); /* pre-allocate it at once */

@ -569,7 +569,6 @@ static void add_upvalue_in_levels_upto(struct parser_state *parser, struct ast_n
*/
static struct ast_node *new_symbol_reference(struct parser_state *parser) {
TString *varname = check_name_and_next(parser->ls);
const char *str = getstr(varname);
bool is_local = false;
struct lua_symbol *symbol = search_for_variable(parser, varname, &is_local);
if (symbol) {

@ -69,8 +69,7 @@ void raviV_dumpIR(struct lua_State *L, struct Proto *p) {
// and also whether to dump header or body or both
char fname[30];
snprintf(fname, sizeof fname, "jitfunction");
ravi_compile_options_t options = {0, 0, 0};
options.codegen_type = RAVI_CODEGEN_ALL;
ravi_compile_options_t options = {0, 0, 0, RAVI_CODEGEN_ALL};
if (raviJ_codegen(L, p, &options, fname, &buf)) { puts(buf.buf); }
membuff_free(&buf);
}
@ -174,5 +173,6 @@ int raviV_gettraceenabled(struct lua_State *L) {
}
int ravi_compile_C(lua_State *L) {
(void)L;
return 0;
}
Loading…
Cancel
Save