Ii. Differences with Lua
Squirrel supports oo better than Lua. squirrel can define classes, allow class inheritance, and automatically execute constructor functions. Lua can only simulate classes through tables. More importantly, squirrel allows classes to generate instances. Each instance has its own storage space, which is obviously better than the Lua simulation class.
Squirrel supports setting a userpoint on each instance. This feature is very advantageous with the c ++ object interface. A squirrel class can be conveniently used as the shadow of a C ++ class, we only need to implement the C ++ class interface on Squirrel and use the userpoint of squirrel to manipulate this c ++ object.
I encapsulated a support for SQLite and found that it is easy to use squirrel to convert the C/C ++ library into squirrel local support. It is troublesome to do this in Lua. Although there are a lot of secondary development in Lua, there are also very complete C/C ++ to Lua binding libraries, however, it is better to do this by yourself.