experimental
Dibyendu Majumdar 6 years ago
parent d27dbd7619
commit 1216ebfaa2

@ -9,7 +9,7 @@ Interestingly a precursor to Lua was `Sol <http://www.lua.org/history.html>`_ wh
static types; Sol means the Sun in Portugese.
Lua is perfect as a small embeddable dynamic language so why a derivative? Ravi extends Lua with
static typing for greater performance under JIT compilation. However, the static typing is
static typing for improved performance when JIT compilation is enabled. However, the static typing is
optional and therefore Lua programs are also valid Ravi programs.
There are other attempts to add static typing to Lua - e.g. `Typed Lua <https://github.com/andremm/typedlua>`_ but
@ -22,7 +22,7 @@ My motivation is somewhat different - I want to enhance the VM to support more e
known. Type information can be exploited by JIT compilation technology to improve performance. At the same time,
I want to keep the language safe and therefore usable by non-expert programmers.
Of course there is also the fantastic `LuaJIT <http://luajit.org>`_ implementation. Ravi has a different goal compared to
Of course there is the fantastic `LuaJIT <http://luajit.org>`_ implementation. Ravi has a different goal compared to
LuaJIT. Ravi prioritizes ease of maintenance and support, language safety, and compatibility with Lua 5.3,
over maximum performance. For more detailed comparison please refer to the documentation links below.
@ -90,6 +90,7 @@ History
- Additional type-annotations
* 2018
- Implemented Eclipse OMR JIT backend
- Created `Ravi with batteries <https://github.com/dibyendumajumdar/ravi-distro>`_.
License
=======

@ -15,6 +15,8 @@ Contents:
ravi-reference
ravi-omr-instructions
ravi-llvm-instructions
ravi-dmrc
ravi-new-parser-codegenerator
lua-introduction
lua_bytecode_reference
lua-parser

@ -0,0 +1,21 @@
====================================
dmr_C embedded C parser and compiler
====================================
Ravi includes dmr_C, an embedded C parser and compiler. The C compiler supports LLVM and Eclipse OMR backends.
The following api is under development, but is not yet fully functional, and is subject to change.
``drmc.getsymbols(source)``
Parses the input and returns a table of symbols found.
``dmrc.compileC(source)``
Compiles the input source.
Examples
========
An example use of the C parser is `ravi-tests/dmrc_getsymbols.lua <https://github.com/dibyendumajumdar/ravi/blob/master/ravi-tests/dmrc_getsymbols.lua>`_.
For an example of invoking the C compiler with LLVM backend see `ravi-tests/dmrc_testllvm.lua`.
Outstanding issues
==================
* The Eclipse OMR backend cannot automatically access C functions externally defined; these have to be pre-registered. A solution might be to expose the resolution of symbols from dynamic libraries.
* We need to validate that the compiled C function is callable from Lua. This is not as easy to do with Eclipse OMR backend as with the LLVM backend.

@ -25,3 +25,11 @@ Some other things
2. during code generation it will be good to know which registers are type constant - i.e. their types do not change. register allocation
should be designed / implemented so that we try to avoid over-writing type data where possible. This will allow backend JIT
to generate more optimized code.
Current Status
--------------
We have a parser implementation that can convert Ravi source to an abstract syntax tree (AST).
Static type checking is not yet implemented.
For examples of how to call the parser please see `ravi-tests/ravi_test_ast.lua <https://github.com/dibyendumajumdar/ravi/blob/master/ravi-tests/ravi_test_ast.lua>`_.

@ -9,7 +9,7 @@ Interestingly a precursor to Lua was `Sol <http://www.lua.org/history.html>`_ wh
static types; Sol means the Sun in Portugese.
Lua is perfect as a small embeddable dynamic language so why a derivative? Ravi extends Lua with
static typing for greater performance under JIT compilation. However, the static typing is
static typing for improved performance when JIT compilation is enabled. However, the static typing is
optional and therefore Lua programs are also valid Ravi programs.
There are other attempts to add static typing to Lua - e.g. `Typed Lua <https://github.com/andremm/typedlua>`_ but
@ -22,7 +22,7 @@ My motivation is somewhat different - I want to enhance the VM to support more e
known. Type information can be exploited by JIT compilation technology to improve performance. At the same time,
I want to keep the language safe and therefore usable by non-expert programmers.
Of course there is also the fantastic `LuaJIT <http://luajit.org>`_ implementation. Ravi has a different goal compared to
Of course there is the fantastic `LuaJIT <http://luajit.org>`_ implementation. Ravi has a different goal compared to
LuaJIT. Ravi prioritizes ease of maintenance and support, language safety, and compatibility with Lua 5.3,
over maximum performance. For more detailed comparison please refer to the documentation links below.
@ -90,6 +90,7 @@ History
- Additional type-annotations
* 2018
- Implemented Eclipse OMR JIT backend
- Created `Ravi with batteries <https://github.com/dibyendumajumdar/ravi-distro>`_.
License
=======

Loading…
Cancel
Save