lua-users home
lua-l archive

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

Well here is my attempt to start a nice technical conversation and
increase traffic on this list!

I have been using Ravi in my business application project. I
originally started implementing the JIT for this use case as I
intended to allow users to code derivative pricing routines in Lua,
which would then be used by the application. The particular use case
requires calls to these pricing routines in a curve fitting component,
therefore as the solver iterates it calls the pricing routines many
many times as the solver creates a Jacobian matrix using numeric

Unfortunately the performance of this component is so critical that
when it came to the crunch, I decided not to use Ravi here (I had
built prototypes before using Lua and LuaJIT). I decided to implement
the pricing functions in C++, but use Lua to define the cashflow
structure used by the pricing routines. This means that Lua is used
once to create a prototype cashflow structure for each derivative
instrument (Interest Rate Swaps, FRAs etc), but the actual pricing is
performed by C++ functions.

This removed Lua from the performance critical section so in the end I
am not using the JIT compiler yet. So far the scripts I have written
seem to perform fine in interpreted mode. I do find Ravi's numeric
arrays very useful though - as they make it easier to code things in
C++. The array data can be accessed directly rather than going through
Lua API calls.

My project is not OpenSource so I cannot show or share the code. But I
will try to share some of my experiences using Ravi/Lua in the