Earlier quoted context omitted.
I am currently working on an embedded system with 264Kb of RAM and 4Mb of flash. Do you think Lua could be used in such limited settings? I am also considering the berry scripting language [0]. [0] https://berry-lang.github.io/
That sounds like something the size of an ESP32. Assuming your flash allows XIP (execute in place) so all that memory is available for your lua interpreter data, you should at least be able to run some code, but don't expect to run any heavy full applications on that. I don't know Berry but it sounds like a better fit for the scale of your device. But sure, why not give it a try: Lua is usually easy to port to whatev…
Lua beats MicroPython for embedded devs
41–50 of 87 posts
Re: Lua beats MicroPython for embedded devs
#42is anyone "serious" using micropython or lua for embedded work?
Every so often I have a need for a small cheap device interoperating with a larger system that I'm developing. Like something that sits on MODBUS and does a simple task when signalled. I've taken the RP2040 and Pico board and spun it into a gizmo that can do whatever I want with Micropython, and it's an order of magnitude cheaper and faster than trying to spin it up in STMCube.
Re: Lua beats MicroPython for embedded devs
#43When I decided to create a game engine where the game could be entirely scripted in a scripting language, I was choosing between JavaScript (QuickJS), Python (Boost.Python), and Lua (Sol2). The ease of embedding Lua, even with a C++ wrapper, is incredible. With little effort, I now have something I consider “ready”. Not to mention, it’s a very lightweight VM. https://github.com/willtobyte/carimbo
Is Sol2 a Lua VM or just a wrapper to the standard Lua VM?
Re: Lua beats MicroPython for embedded devs
#44Earlier quoted context omitted.
That sounds like something the size of an ESP32. Assuming your flash allows XIP (execute in place) so all that memory is available for your lua interpreter data, you should at least be able to run some code, but don't expect to run any heavy full applications on that. I don't know Berry but it sounds like a better fit for the scale of your device. But sure, why not give it a try: Lua is usually easy to port to whatev…
It is a RP2040. We plan to eventually upgrade to RP2350B.
Re: Lua beats MicroPython for embedded devs
#45> [bolded] Lua isn’t just a high-level language. It’s an embedded dev strategy. I find it difficult to take any writing seriously when it uses phrases like this.
Much of the article resembles chatgptese... though I suppose for adslop it doesn't matter whether it's written by a human or an llm
Re: Lua beats MicroPython for embedded devs
#46As a hobbyist I just use Arduino (via platformio). I don't think I need an interpreter of any sort for microcontrollers because recompiling and uploading the flash on hobbyist boards is quick and easy. But I'd like to try some other compiled language someday because I'm not a big fan of C++. Any recommendations for something that works well with a Raspberry Pi Pico?
I'm also intrigued by Zig. I haven't used it for anything yet but the language looks fun and I believe platform.io supports it
Raspberry Pis are beefy enough that you could also get away with less systems-y languages. I like Kotlin. By default Kotlin needs a JVM but I think it's usable if you build native executables. However if you want to fiddle with GPIOs you might have to do it by manually setting things on/off in the filesystem (edit, sorry, just read you're using a PICO. Not sure how well Kotlin is supported)
Re: Lua beats MicroPython for embedded devs
#47Earlier quoted context omitted.
Boost.python is not the best scripting tool to be honest. So, that might affect your judgement as well.
I've yet to find an even decent python binding generator, TBH. Generally, I use pybindgen to get the basic module and then hack on that by hand. The main problem is most C(++) libraries aren't designed to interoperate with managed memory languages so most of the work is figuring that out. Don't get me wrong, I've tried to work within the binding library (with pybindgen at least) but the amount of work for anything ev…
Re: Lua beats MicroPython for embedded devs
#48As a hobbyist I just use Arduino (via platformio). I don't think I need an interpreter of any sort for microcontrollers because recompiling and uploading the flash on hobbyist boards is quick and easy. But I'd like to try some other compiled language someday because I'm not a big fan of C++. Any recommendations for something that works well with a Raspberry Pi Pico?
Re: Lua beats MicroPython for embedded devs
#49As a hobbyist I just use Arduino (via platformio). I don't think I need an interpreter of any sort for microcontrollers because recompiling and uploading the flash on hobbyist boards is quick and easy. But I'd like to try some other compiled language someday because I'm not a big fan of C++. Any recommendations for something that works well with a Raspberry Pi Pico?
I'm not an expert but from what I've seen Rust is one of the big alternatives. It's new enough to be trendy and fixed a lot of C++ issues whole being mature enough that the tooling is ok. I'm also intrigued by Zig. I haven't used it for anything yet but the language looks fun and I believe platform.io supports it Raspberry Pis are beefy enough that you could also get away with less systems-y languages. I like Kotlin.…
Re: Lua beats MicroPython for embedded devs
#50Is there a way to try out embedded Lua within the Arduino dev environment? Yeah I know, friends don't let friends, but I'm still curious.