Live data from Hacker News

Lua beats MicroPython for embedded devs

embedded.com

21–30 of 87 posts

Re: Lua beats MicroPython for embedded devs

#21
post #16

is anyone "serious" using micropython or lua for embedded work?

I have been developing Lua-heavy embedded products as a freelancer for about 20 years now, including VoIP devices, home automation controllers, industrial routers, digital video recorders, and more. These systems typically consist of a Linux kernel, some libc implementation, the lua interpreter and a few 3d party libs support libs to help building the app. The Lua apps ranges from 30k to 100k lines of code, depending…

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/

Re: Lua beats MicroPython for embedded devs

#22

With respect that sounds like marketing fluff. You use micrpython when you have lots of horsepower and need something fairly robust on the network. You use C/C++ if you need precise control over power, memory or CPU. Even though if you're doing network stuff its much harder to do quickly and securely. (THere might be better embedded TLS support now) Lua is frankly just sparkling C. Sure if someone has create a bunch…

> You use micrpython when you have lots of horsepower It runs on a 2350.

Cortex-M33s are decently powerful in the non-Linux embedded world. Micropython isn't competing with Linux, it is competing with bare-metal code.

Re: Lua beats MicroPython for embedded devs

#23

With respect that sounds like marketing fluff. You use micrpython when you have lots of horsepower and need something fairly robust on the network. You use C/C++ if you need precise control over power, memory or CPU. Even though if you're doing network stuff its much harder to do quickly and securely. (THere might be better embedded TLS support now) Lua is frankly just sparkling C. Sure if someone has create a bunch…

> You use micrpython when you have lots of horsepower It runs on a 2350.

the 2350 is huge compared to an STM8, or atmega.

Re: Lua beats MicroPython for embedded devs

#24
post #7

> [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

#25
post #4

What’s the dev experience actually like for serious Lua? I’ve only used it for some basic neovim configuration. The dynamicism and lack of type hinting in Python that was the norm when I started having to review professional code, after transitioning from pure mathematics, was a major cognitive blocker for me. With a math paper I could typically skim the first few pages to map the author’s particular symbology (if no…

> What’s the dev experience actually like for serious Lua

The dev experience for lua is f-ing awful.

The language is small, but not “simple”; it’s stuck in 1985.

The tooling is nearly non-existent and the stuff that does exist is a joke.

The few libraries that exist are awful and barely maintained; the maintained libraries are maintained by neckbeards with a god-complex.

The community is “reimplementing everything by hand is the right way to do it AND ALSO you’re an idiot doing it wrong” toxic. There are a million good reasons why it’s only has a foothold in nginx and Roblox territory.

It’s not a joke to say that it’s f-ing terrible all the way around.

Re: Lua beats MicroPython for embedded devs

#27
post #5

When 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

A nice thing about seeing an engine or application support Lua for scripting is that it implies Fennel can be used (and transpiled to Lua). Or at least that is highly likely unless something unusually weird is going on.

https://fennel-lang.org/

Re: Lua beats MicroPython for embedded devs

#28
post #4

What’s the dev experience actually like for serious Lua? I’ve only used it for some basic neovim configuration. The dynamicism and lack of type hinting in Python that was the norm when I started having to review professional code, after transitioning from pure mathematics, was a major cognitive blocker for me. With a math paper I could typically skim the first few pages to map the author’s particular symbology (if no…

> What’s the dev experience actually like for serious Lua The dev experience for lua is f-ing awful. The language is small, but not “simple”; it’s stuck in 1985. The tooling is nearly non-existent and the stuff that does exist is a joke. The few libraries that exist are awful and barely maintained; the maintained libraries are maintained by neckbeards with a god-complex. The community is “reimplementing everything by…

[flagged]

Re: Lua beats MicroPython for embedded devs

#29
post #2

Lua is just a much simpler language at heart. Python does have the 'there should be one, preferably only one, way to do it' mantra, but to me it utterly fails at that, and is in fact a bit of a 'kitchen sink' or 'armchair' language. That is it's strength in some ways, it's easy and approachable, and has more libraries than perhaps any other language, so you can usually get something working fairly quickly. But it's n…

Python also seems to have more issues with stability, in the sense that things randomly stop working when you upgrade from version 3.x to 3.x+1. Lua might not be perfect either, but at least it seems common that a platform supports a range of Lua versions instead of forcing an immediate upgrade.

Re: Lua beats MicroPython for embedded devs

#30

Earlier quoted context omitted.

Lua can be quite an elegant language once you get to know it well, but you can still use it like most other programming languages, it's not that weird. There are quirks like arrays starting at 1 (and all arrays being hash tables) but they don't take that long to get used to. The real strength is in the ecosystem and implementation itself, it's designed to be easily embedded into applications and there's not really mu…

> There are quirks like arrays starting at 1 I know it’s probably and overreaction, but this was a compete non-starter for me.

While I understand the aversion, I can't help but think that people miss out on some really cool experiences when they balk at stuff like 1-based arrays or parens in Lisp or whatever. Sure, those quirks may remain deal breakers after you've given the language a thorough try, but you may also gain super interesting new perspectives in the process.
Post reply on HN