lua-users home
lua-l archive

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


On Fri, Sep 18, 2020 at 7:40 PM Albert Krewinkel
<albert+lua@zeitkraut.de> wrote:

> I believe languages like Rust and Go face similar issues.

Every language, including C, faces issues when Lua errors propagate
through code that does not expect that.

Paradoxically, C++ fares better, because Lua can be compiled in the
C++ mode, which will then use the standard C++ facility - exceptions -
for Lua errors, which works well with properly written C++ code. The
drawback is that exceptions may misbehave when they need to propagate
through a layer of non-C++ code, say a library written in C. This is
usually not a problem when libraries are statically linked. Note that
Francisco said he uses C++ and he uses static libraries, which is
probably why he did not mention this.

Cheers,
V.