Hacker News new | ask | show | jobs
by ItCouldBeWorse 741 days ago
So what lua needs- is a c-compiler, that allows "static" library code to compile additions directly into dll, that those can be reused by lua via api
2 comments

This is the goal of the Pallene project: https://github.com/pallene-lang/pallene
It isn't terribly hard to write the bridge code to lua, just monotonous to translate inputs and outputs from C++.

You throw a lua function into a table (usually tables are used as namespaces and globals are just a table) and then make that C++ translate to your normal one and handle the return value correctly.

The hard thing is building a system to pass in a C++ object in general as that required building a table for each instance that matches its class.