Can C ++ simplify the implementation of Lua VM?

For those who have taken a look at the Lua C VM implementation, will using C ++ greatly simplify the implementation?

+4
source share
3 answers

Lua is intended to be used as an embedded language. Thus, the "implementation" of a virtual machine consists of two separate parts: creating the source code of the virtual machine and integrating this code into the artifact that will be deployed. I suspect that your question is directed to the first part. Very sorry. The second part, integration, happens many times, and is usually much simpler in C than in C ++.

+4
source

For many years, engineers at the genius level put out the blood over this virtual machine to make it as simple as possible, while remaining extremely portable (any ANSI C compiler) and high-performance (look at any comparative measure of scripting languages). Beside such an effort, I don't see how C ++ can simplify anything. In fact, with C ++, I will worry about the language hiding important properties, such as the cost model.

+11
source

Anything C can do, C ++ can do better. I always thought that the Lua source is quite easy to read - it gave some warnings on 64-bit, although everything seemed to be in order.

The problem is that all user information is really not very good for displaying new types. I would look at redesign, not re-implementation.

-5
source

Source: https://habr.com/ru/post/1309586/


All Articles