Title says it all. I don't know a lot about Lua but I do know that in general VMs operate on similar principals to hardware description languages, which can be implemented in real hardware. Besides being a ton of work (and needing access to the lowest-level bones of pico) what is stopping a true hardware version of our favorite fantasy console from existing?
The biggest thing I can think of is that carts would be a whole beast of their own, but I'd love to hear everybody else's thoughts, including if there are any good hardware emulators out there (I've seen a few raspberry pi versions, but many of them fall short when it comes to screen, buttons, ports, size, etc).
PICO-8 doesn't describe a processor in its fantasy machine specification, so you'd have to make up the difference. Lua has its own stack and heap memory independent of PICO-8's actual addressable region, and also stores both the code's raw text and its interpreted bytecode outside of that region as well. A straightforward implementation would need at least a full Lua interpreter, likely running as software on a traditional CPU and architecture on which Lua can run, with the PICO-8 API built in and wired to hardware drivers. Depending on your interests, that may or may not qualify as "100% hardware."
Lua bytecode is more CPU-like, but like most LLVMs it's not designed to be implemented directly in hardware. Here's a description: https://the-ravi-programming-language.readthedocs.io/en/latest/lua_bytecode_reference.html I don't quite know when and how the Lua interpreter normally compiles to bytecode and whether it can do a full up-front compilation of the entire source. It might be possible to host the bytecode interpreter in some combination of hardware and software and transpile to it on a different device. You might have better luck compiling Lua to the machine code of a more traditional processor.
This is considering the PICO-8 player in isolation of the SDK. The full application (console, editors, Splore, etc.) is written in C and not Lua, so it's not really something that would run on hardware architecture intended to execute Lua bytecode or whatever. Step back far enough and you're just running PICO-8 on a traditional OS, which presumably doesn't meet the question. I can imagine reimplementing something PICO-8-like, even PICO-8-compatible, on direct hardware. Again, whether that would meet the question depends on your interests.
[Please log in to post a comment]