| Newsgroups |
gmane.comp.lang.lua.general |
| Message-ID |
<[email protected]> |
In this case, the Lua function is translated into a C++ lambda, which is
then compiled by Clang/GCC/MSVC into machine code.
For example, the Lua f(g()) / g(f()) calls become clx::call_direct()
calls. Arguments are passed through LValue arrays (args[]), while
multiple return values are represented by clx::MultiValue.
So the pipeline is essentially:
Lua source → generated C++ → C++ compiler → machine code
This is essentially the same model used by other compiled languages: the
source is transformed into an intermediate representation (here C++
code) and ultimately compiled to native machine code.
The result is a true standalone native and fast executable, without
requiring lua55.dll, liblua5.5.so, or any embedded Lua 5.5 VM.
Samir
Le 23/08/2026 21:16, 'Martin Eden' via lua-l a écrit :
> Hi Samir,
>
> On 2026-08-23 20:02, Samir Tine wrote:
>
>> Clx compiles Lua source code to native code
>
> Sorry I don't understand what "native code" means.
>
> Let's consider this Lua code:
>
> return
> function(f, g)
> return f(g()) or g(f())
> end
>
> To what it is compiled? There must be some sort of intermediate
> representation.
>
> -- Martin
--
You received this message because you are subscribed to the Google Groups "lua-l" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/lua-l/b988d13bc067987815a9d22f384cec22%40luart.org.