lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


It was thus said that the Great Dibyendu Majumdar once stated:
> Hi,
> 
> I have been thinking about what I should do with Ravi. My first
> priority is to use it in the application that I originally intended it
> for - I hope to share more details of this later this year. This is a
> business application in the financial sector so perhaps not very
> interesting to this list.
> 
> I work on Ravi in my spare time, so none of what I list below may get
> implemented in 2017.
> 
> 1. I would like to add support for inlining of Lua functions.

  I assume this would be based upon function size?  Or an indication (ala C)
that a function can (or should) be inlined?

> 2. A related goal is to allow a faster calling convention for C
> functions that do not require the Lua state, e.g. std C functions.

  The major issue I have with LuaJIT's ffi is that you can't feed it C
header files.  I mean, if they're relatively clean (sans #defines and #if
stuff) you could probably get away with it, but otherwise, you have to
declare all structures and prototypes.  Ideally, you do something like:

	ffi.define { MAXSEG_64K = 1 } -- we need this defined for this example
	ffi.include("zlib.h")

and now you can use zlib. But I do admit that such an interface is a *major*
undertaking and I can understand why no one has done it yet.

> 3. General performance improvements in Ravi -  I have been
> experimenting with adding branch weights in the code to enable better
> optimisation.
> 4. More type annotations - such as string, closure and more
> interestingly - a userdata annotation where you can use the __name
> attribute of the metatable to say what type is expected.

  I would avoid trying to overload the __name attribute.  This is Ravi, not
Lua, so perhaps come up with your own metamethod [1].

> 5. Backward compatibility with 5.1 and 5.2 as far as possible - this
> is mainly so that Ravi can be used to run projects that have no plans
> to upgrade to 5.3.

  I think the hardest "feature" to support is setfenv()/getfenv() from Lua
5.1 to _ENV in 5.2 and above ...

  -spc

[1]	http://lua-users.org/lists/lua-l/2016-06/msg00324.html