TCL vs Lua - scripting a mmo server

前端 未结 6 2245
轻奢々
轻奢々 2021-02-20 14:11

I have a c++ server side project that I need to embed some sort of scripting into. It is part of an online MMO type of server. I have significant experience using TCL, and it se

6条回答
  •  南方客
    南方客 (楼主)
    2021-02-20 14:45

    The Lua C API is extremely easy to integrate into an application. From C you have complete access to the Lua state, and to its native data types. I've recommended using Lua just to get the hash table implementation even with no need for scripting, for instance.

    Lua functions written in C can be injected as global names, collected in a table like most of the standard library functions, or implemented in DLLs and dynamically loaded at runtime. That permits the application to provide a stable API, as well as to support plugins written in either Lua or C.

    Lua as a language is surprisingly powerful, with support for both functional and object oriented programming styles. It is also surprisingly lightweight: the complete source kit and full documentation fits in well under 1 MB, and the whole VM, compiler, and standard libraries in a DLL is only 164KB on Windows.

    I haven't seriously examined TCL since version 2 or so... I won't try to compare them in a concrete way. I believe that they both were invented to fit the same niche, and at about the same time. They certainly are both mature languages with avid user communities.

提交回复
热议问题