The key is to unhinge the gameplay thread from the render/physics threads. This in practice means you have to use Array of 64 byte Structure for your shared data. Lua is not going to change that. You can hot-deploy C with a .so/.dll without losing performance.
"The key is to unhinge the gameplay thread from the render/physics threads."
Many simple games don't need it, by the way. A lot of 2D indie games don't do complex enough rendering/physics to warrant a separate thread. This, in turn, makes everything much simpler if your entire game only uses one thread.
Lua seems to be widespread in games, but in fact is a very nice tool to make day-to-day apps user-extendible (with neovim and mpv being a couple of examples).
Agreed. I see many programs use JS and Python for plugin APIs, while Lua might be a better choice in many cases. It's much simpler and easier to pick up even if you're new to the language.
The key is to unhinge the gameplay thread from the render/physics threads. This in practice means you have to use Array of 64 byte Structure for your shared data. Lua is not going to change that. You can hot-deploy C with a .so/.dll without losing performance.
"The key is to unhinge the gameplay thread from the render/physics threads." Many simple games don't need it, by the way. A lot of 2D indie games don't do complex enough rendering/physics to warrant a separate thread. This, in turn, makes everything much simpler if your entire game only uses one thread.
2D games can be made with anything. 3D action MMOs on the other hand need attention.
"The key is to unhinge the gameplay thread from the render/physics threads." Many simple games don't need it, by the way. A lot of 2D indie games don't do complex enough rendering/physics to warrant a separate thread. This, in turn, makes everything much simpler if your entire game only uses one thread.
2D games can be made with anything. 3D action MMOs on the other hand need attention.
Indeed. I have no credentials to speak about such hard problems, my experience is working with high QPS servers written in Lua and a bunch of small indie games. :)
I have built professional, scientifically sensitive, important apps with Lua. A recent project involved doing fluidic particulate quantification in an embedded, field portable instrument, which was delivered on time and under-budget - and represented a major revenue source for the customer (40 million dollars worth of orders) when it was shipped. The client was told it "could not be done" with the hardware as specifi…
Out of interest, is there any public information about your project? I am currently prototyping a Lua environment for instrument control in a regulated environment. I've added several customisations and safety mitigations to make it suitable for use, and it works beautifully. One thing I would like is to be able to showcase examples of use in other products. If you, or anyone else, have any examples I could point peo…
There isn't any public info about the architecture of the system, but you can find product info here:
I think it once was taught, but was considered passé in various places during the "Java" revolution, and in general I think there is a degradation of capabilities in most comp-sci programs, a consequence of interference by market players who invest in the schools in order to keep their technologies relevant. If anyone reading this wants to see what the fuss is, you can get started very easily with antirez' (Redis fam…
It's a shame that Java (and JavaScript) replaced the "Lua with C/C++/whatever" approach. JavaScript is incredibly hard to write in a "correct" way. It has way too many quirks and an incredibly complex tooling system (npm, etc.). Lua is pretty much a "minimal" language which gets things done. It's not perfect, but it certainly doesn't suffer from the bloat which many other languages have.
I agree with you completely, Javascript has been a step backwards from what could have been, had we been teaching teenagers to glom the VM onto C/C++ layers. This is just a much better approach than 'npm all the things' .. although Lua isn't without its warts: LuaJIT, LuaRocks, 5.1, 5.2, 5.3 ..
Lua really is a joy, and after 40 years of software development is still one of the top ways, in my personal list, to get serious software built. I've done quite a few projects where I built a library of C modules to do the heavy lifting for some particular purpose (data in/out mostly), glommed these functions into the LuaVM, then built the application logic, very rapidly and smoothly, in Lua - outcompeting others wo…
"I think its really important for any developer, whether they are encased in the glories of the browser or otherwise, to understand how to add the Lua VM - to anything - and then use that as a means of productive application development." I completely agree! I feel that I should add thoughts about this into the article. A lot of people (justifiably) complain that C and C++ are not memory-safe and that it's hard to wr…
Definitely. And I think one of the reasons this approach is so powerful as well as being safer - when done properly - is that it follows the philosophy embodied in the OSI model. By glomming the VM onto a hierarchy of abstraction, one is fulfilling the OSI intention of clean separation of concerns.
This isn't so easy to do in the Javascript jungle, alas.
Happy to read your article, we are very much aligned. I hope your work brings more programmers to the world of Lua ..
Out of interest, is there any public information about your project? I am currently prototyping a Lua environment for instrument control in a regulated environment. I've added several customisations and safety mitigations to make it suitable for use, and it works beautifully. One thing I would like is to be able to showcase examples of use in other products. If you, or anyone else, have any examples I could point peo…
There isn't any public info about the architecture of the system, but you can find product info here: https://www.spectrosci.com/product/fieldlab-58---portable-oi...
Many thanks for the reference, this looks like a really interesting device, and it has quite a lot of similarities with the type of system I'm working on (albeit in a completely different application domain).
There isn't any public info about the architecture of the system, but you can find product info here: https://www.spectrosci.com/product/fieldlab-58---portable-oi...
Many thanks for the reference, this looks like a really interesting device, and it has quite a lot of similarities with the type of system I'm working on (albeit in a completely different application domain).
You're welcome - what are you working on, may I ask? Common interests, and all ..
Many thanks for the reference, this looks like a really interesting device, and it has quite a lot of similarities with the type of system I'm working on (albeit in a completely different application domain).
You're welcome - what are you working on, may I ask? Common interests, and all ..
In vitro medical diagnostics, using microfluidics, fluorescence spectroscopy and imaging.