Skip to content

Development environment setup#1

Merged
Sunrisepeak merged 3 commits intomainfrom
videcodingdevelopment-environment-setup-f0a5
Feb 26, 2026
Merged

Development environment setup#1
Sunrisepeak merged 3 commits intomainfrom
videcodingdevelopment-environment-setup-f0a5

Conversation

@Sunrisepeak
Copy link
Member

Adds mcpplibs.capi.lua module, providing a simple C++23 modular binding for the Lua C API.

This PR introduces the mcpplibs.capi.lua module, which wraps the Lua 5.4 C API into a C++23 module (mcpplibs::capi::lua). It includes comprehensive tests, examples, and documentation. Key challenges addressed during implementation involved resolving GCC C++ module extern "C" linkage issues using a wrapper header and splitting the module into interface (.cppm) and implementation (.cpp) files to handle C++ name mangling with inline functions.


Open in Web Open in Cursor 

cursoragent and others added 2 commits February 26, 2026 20:52
- Add src/capi/lua.cppm (module interface) and src/capi/lua.cpp (implementation)
- Wrap lua.h, lauxlib.h, lualib.h in mcpplibs::capi::lua namespace
- Types: State, Number, Integer, CFunction, L_Reg, L_Buffer, etc.
- Constants: status codes, type tags, operators, GC options, hook masks
- Functions: 100+ bindings covering state, stack, push/access, tables,
  globals, calls, coroutines, GC, debug, auxiliary library, standard libs
- Use extern C wrapper header to fix GCC C++ modules linkage issue
- 97 comprehensive Google Test cases covering all API categories
- 4 examples: basic, table, function, eval
- Update xmake.lua, CMakeLists.txt, CI workflow, README, architecture docs
- Design docs and task breakdown in docs/pr/
- Remove old templates.cppm placeholder module

Co-authored-by: SPeak <sunrisepeak@d2learn.org>
- SKILL.md: quick start, naming map, core API cheat sheet, common patterns,
  build config, caveats (callback signatures, extern C, inline limitation)
- reference.md: complete API reference with all 15 types, 50+ constants,
  100+ functions organized by category with C API correspondence
- Update skills README to list both available skills

Co-authored-by: SPeak <sunrisepeak@d2learn.org>
@cursor
Copy link

cursor bot commented Feb 26, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

GCC C++ modules require std.gcm to exist before dependent targets
compile. Build mcpplibs-capi-lua first (serialized) then build
remaining targets in parallel.

Co-authored-by: SPeak <sunrisepeak@d2learn.org>
@Sunrisepeak Sunrisepeak merged commit 2cf3c2b into main Feb 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants