lua-users home
lua-l archive

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


Just asking whether it would be technically possible, to generate code for simple functions without all marshaling (VM barriers) that happens on caller code and Lua callback code?

I.e. "function (x) x+1 end" that is mapped into "int (*addone)(int v)", this function is using only built addition in operator.

Having that such function use only built-in operators, locals and single types across whole body, could it be optimized straight ahead into machine code? This could be some benefit to some math packages that can take callback function as argument, calling it a lot.

Probably if it is possible, anyway that wouldn't be trivial task.

Adam Strzelecki