lua-users home
lua-l archive

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


Inlining is purely a platform dictated 'sideffect', or whatever you want to call it.. Inlining lua code doesn't make much sense, but it does for languages compiled to native code. (I guess that would include luajit, and I'm sure senior pall has ventured there on many occasions in his code)

In other words, inlining is not so much a language feature but a compiler optimization to better reach it's intended hardware as good as possible.

Macro's on the other hand have nothing to do with inlining, and are purely a tool for the engineer to (I guess) get around shortcomings in language implementations or just to tidy up/write less code.

guuh, difficult to explain, macros -do- relate to inlining in the strictest sense of the word, but related to text, not hardware.. :)

Peter Sommerfeld wrote:
Roberto Ierusalimschy wrote
The real "selling point" for a macro
mechanism is what you can do with its macros that you cannot do with
functions. And (at least for me) the real interesting question is *why*
you cannot do with functions what you can do with macros.

Inlining for instance to achieve better performance with small functions. Special forms for creating sublanguages...

Peter