Update ravi-reference.rst

mini
Dibyendu Majumdar 4 years ago committed by GitHub
parent 7e26dc8d0f
commit e483fe40ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -5,6 +5,18 @@ Ravi Extensions to Lua 5.3
:depth: 2
:backlinks: top
------------
Introduction
------------
Ravi is based on Lua 5.3. Additionally some features of Lua 5.4 have been back-ported to Ravi.
This document describes the enhancements available in Ravi compared to the Lua 5.3 baseline.
* Optional static typing
* ``defer`` statement
* Generational Garbage Collector
* New random number generator
----------------------
Optional Static Typing
----------------------
@ -277,8 +289,9 @@ Another example using arrays. Here the function receives a parameter ``arr`` of
The ``table.numarray(n, initial_value)`` creates a ``number[]`` of specified size and initializes the array with the given initial value.
``defer`` statement
-------------------
-----------------------
The ``defer`` statement
-----------------------
A new addition to Ravi is the ``defer`` statement. The statement has the form::
@ -350,7 +363,29 @@ A JIT api is available with following functions:
Enables support for line hooks via the debug api. Note that enabling this option will result in inefficient JIT as a call to a C function will be inserted at beginning of every Lua bytecode boundary; use this option only when you want to use the debug api to step through code line by line. Currently only supported by LLVM backend.
``ravi.verbosity([b])``
Controls the amount of verbose messages generated during compilation.
-------------------------------
Generational Garbage Collection
-------------------------------
Ravi incorporates the generational garbage collector from Lua 5.4.
Please refer to the Lua 5.4 manual regarding the api changes to support generational collection.
Note that by default, Ravi now enables generational garbage collector.
To switch to incremental GC::
collectgarbage("incremental")
To switch to generational GC::
collectgarbage("generational")
-----------------------
Random Number Generator
-----------------------
Ravi incorporates the new random number generator from Lua 5.4.
Please refer to the Lua 5.4 manual for api changes in this area.
----------------
C API Extensions
----------------

Loading…
Cancel
Save