Implement Lua - #45
Conversation
|
fyi, I think this is the right approach. LuaJIT really wants to stay native and in-process for hot paths. Keeping lua_State, GC, userdata, hooks, and math types in a small native core with a boring C ABI, and letting C# just orchestrate and call into it synchronously, feels like the cleanest and most Source-accurate way to do this. That keeps the bridge minimal and avoids turning FFI into a mess. |
There was a problem hiding this comment.
why not a submodule? https://github.com/luajit/luajit
There was a problem hiding this comment.
There are changes made to LuaJIT that would have to be done in order to be compatible with Garry's Mod's flavor of Lua, so it can't just be a LuaJIT submodule
There was a problem hiding this comment.
There are changes made to LuaJIT that would have to be done in order to be compatible with Garry's Mod's flavor of Lua, so it can't just be a LuaJIT submodule
submodule a fork of our own?
There was a problem hiding this comment.
There are changes made to LuaJIT that would have to be done in order to be compatible with Garry's Mod's flavor of Lua, so it can't just be a LuaJIT submodule
submodule a fork of our own?
Yeah I would prefer that. I need to talk with @RaphaelIT7 still about if he wants to continue leading this effort or not in general. We're a lot further along now but I still would want to continue focusing on engine implementations before focusing too much on Lua
| @@ -46,6 +46,10 @@ public IEngineAPI.Result RunListenServer() { | |||
| public void SetStartupInfo(in StartupInfo info) { | |||
| startupInfo = info; | |||
| Sys.TextMode = info.TextMode; | |||
| // RaphaelIT7: Excuse me for throwing this in here, but I don't have a copy of gmod on my laptop! lemme test in peace >:3 | |||
There was a problem hiding this comment.
could put it behind a flag of some kind (like a preprocessor ifdef)
There was a problem hiding this comment.
what is this? looks like something that should be gitignored
| namespace Type | ||
| { | ||
| enum |
There was a problem hiding this comment.
any particular reason not to use a class enum?
There was a problem hiding this comment.
other header files dont start with a lowercase letter
|
@penggrin12 I would probably ignore this PR if I were you as I imagine @RaphaelIT7 would want to do this differently now (in general I need to make a tracking issue for Lua implementation, since theres quite a few areas we could improve over Garry's Mod but would need to be careful) |
|
I probably won't be doing much here, as I don't have the time or patience to also further learn C# to figure this out. |
FFI gonna go brrrr
See: LuaJIT - 1165 Added it just to be safe since we were thinking about possibly using it
[+] Mostly implemented CLuaInterface [+] Added lua_getuserdatatype [#] Updated to C++17
The C++ side should be somewhat implemented now, though I still suck at C# and before I make a mess it would probably be best to get some feedback of which functions for FFI to add and what the best way to bridge C# & C++ would be