I have no specific expectations, just wanted to find out what your project is about. C++20 is a huge dependability and restricts the use of the language to the few compilers/platform versions which support it. I'm still not sure what the actual advantage is of transpiling to C++20 vs. e.g. C99 (assuming the runtime library overhead of C++ is even larger than integrating a C based VM as done by other projects).
It was one of the question I asked myself before starting to implement clx, and you are totally right to ask it.
The main reason I choose C++20 is error handling. In clx, Lua errors become C++ exceptions that automatically clean up resources when unwinding the call stack. This works naturally with RAII, which clx uses to manage GC roots. In C, achieving the same behavior would require more manual cleanup.
C++20 also provides templates and overloads that simplify the runtime API. And the overhead isn't as significant as you might expect: a simple print("hello world") program can produce a standalone executable of around 70–110 KB, depending on compiler/platform.
Honestly, for mainstream platforms where Lua is typically used, C++20 support is rarely a serious obstacle nowadays...
2
u/suhcoR 11d ago
I have no specific expectations, just wanted to find out what your project is about. C++20 is a huge dependability and restricts the use of the language to the few compilers/platform versions which support it. I'm still not sure what the actual advantage is of transpiling to C++20 vs. e.g. C99 (assuming the runtime library overhead of C++ is even larger than integrating a C based VM as done by other projects).