[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: What languages could be used to implement the functions to be invoked by Lua?
- From: Viacheslav Usov <via.usov@...>
- Date: Fri, 18 Sep 2020 20:34:07 +0200
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.