I'm curious, could you write a bit more about how you do this? Do you write Lua programs with performance-intensive parts written in C? Or more like C programs with some component wiring in Lua? Where do you draw the line, and why? And what kind of software do you make this way?
At my last job (developing cross-platform mobile games for iOS & Android), we wrote our game engine in C++ with Cocos2d-X, with Lua bindings for every OS feature, such as in-app purchase, HTTP client, all Cocoas2d objects, etc. with all of the game logic written entirely in Lua. As long as you stay entirely in Lua, the performance is excellent. The only time you take a hit is when you call between Lua & C++.
Generating the Lua bindings is very easy - there's a tool called ToLua++ which reads a simplified C++ header and generates the C code for the bindings.
Yes, you can write some functionality in C/C++, and export it to the Lua VM, and access those features from within the Lua language environment. This is really awesome!
Look underneath the covers (i.e. build MOAI from sources) and you'll see all of the techniques I'm promoting, albeit in an open, easy to understand - and DAMNED POWERFUL - form.
MOAI is a cross-platform game development toolkit, but since its been designed by talented engineers with great ideas, it could as easily be used to build a next-generation Operating System, akin to what is happening with Android and the Dalvik VM.
The Linux Kernel + MOAI(Lua) would be a formidable challenger to the Android eco-system, imho, given a little more love .. I've already gotten my rPi booting directly to the MOAI runtime, anyway, and its a much more fun way of writing apps for the thing than anything else right now, at least in my opinion. With the advantage that those same apps, with very, very little effort, will run on Windows, Linux, OSX .. iOS .. Android .. Chrome Native Client .. and so on ..
MOAI is an example of the ways in which the LuaVM can actually fulfill the promises made back in the Java honeymoon days ..
Write a nice, clean C library and export a decent header. Then, use the tolua tool to read that header and generate the bindings for the Lua VM. Build the LuaVM with those bindings, and suddenly you have the features of your C library available to you within the Lua language environment.
There are some great tutorials on this, here are a few I found with google-fu:
I think you will see, once you study the above, that there is a vast amount of power available to you. The Lua VM, written itself in pure C, is an utter joy to behold, and I encourage every new C programmer to inspect the Lua VM sources (its only about 12 files..) and see for yourself just what it has to offer you. C+Lua can be a very, very powerful tool .. and anyone learning C today would benefit greatly from also doing some Lua bindings, themselves, to see what I mean ..