Live data from Hacker News

MicroPython

micropython.org

51–60 of 152 posts

Re: MicroPython

#51
post #25

Earlier quoted context omitted.

Why would you want to replace Lua in this space? At least why replace with another dynamically typed, imperative scripting language, but without tail-call optimization? What would be the gain?

I was wondering the same as the parent, and in my case it's library support (e.g. NumPy) and compatibility/familiarity in the space (VFX) where Python is everywhere and Lua is unheard of.

If you want NumPy support in particular you basically have to use CPython.

The only other implementation that really supports it is PyPy which is not in any sense more lightweight.

Re: MicroPython

#52
post #4

Earlier quoted context omitted.

Why not? I've used it and it works fine, you don't get the granular control you get with C but I don't think there's anything that makes it fundamentally unsuitable for production.

There are a few reasons. Number one, stability issues from heap fragmentation. http://docs.micropython.org/en/latest/reference/constrained.... Even if you are careful about manual allocation, Python is not a compiled language, and the interpreter will frequently request heap allocations on its own. So if you expect a program to run for a long time without crashing, you'll probably need to use much less memory than th…

Adafruit's fork was for business reasons as they wanted control over implementation for the hardware they sell, and to focus development efforts on making it more accessible to newcomers. While I'm not thrilled with the fork since it dilutes the original project imo, they do still contribute back to the micropython project. But I don't think there's any lost love there, they just had different goals with a financial stake (unlike the uasyncio split which was ego driven)

Re: MicroPython

#53
post #3

MicroPython is amazing, it runs on very tiny microcontrollers not much else runs on, and makes development of hobbyist embedded projects orders of magnitude easier than C. I backed it way back when, I think for the ESP8266 support, and have loved it ever since.

[deleted]

Re: MicroPython

#54

MicroPython is stellar. If you're building an embedded system for people to hack and customize, make the highest level abstraction of the embedded system in MicroPython so that users can easily modify/patch/contribute/hack your system with ease. This is what Arduino and Arduino IDE did for millions of hobbyist, but it is time to ditch C/C++ for MicroPython. In this [1] PyCon talk by Matt Trentini, a demo of QR code g…

Do you think it's suitable as a game scripting language?

How hard is to write bindings for micropython?

I've looked into cython but I'm not sure it's what I really need.

Re: MicroPython

#55
post #8

> MicroPython implements the entire Python 3.4 syntax Python 3.4 is now over 6 years old. Are there plans to add features from newer Python releases? Or perhaps the developers feel that Python's newer features wouldn't "pull their weight"?

I'd be interested in knowing how much bigger Python has gotten since 3.4 time frame. If course it's not unthinkable that it could always get smaller if there's a lot of refactoring going on, but that might be wishful thinking.

Re: MicroPython

#56
post #23
post #14

MicroPython seems to be heavily focused on embedded systems . Is there any support for embedding it within an application , i.e. as a replacement for Lua? Or is there another lightweight Python implementation (or Python-like language) that supports this?

Why not just use Lua? :) yes I get it, Lua is yet another language to your stack. But so is MicroPython. We were looking for a higher lever than C language for an embedded Linux system* and one engineer was massively in favor of MicroPython. But it’s not python, it’s based on 3.4 so it’s like python but not. It has its own rules and particularities. When I hire a new engineer I’d rather say “here read this book and l…

“Not quite python” is a subtle point many people miss and indeed can be an issue. Third party library support is also huge, does micropython support the cpython library ecosystem? In this case the plethora of lua libraries readily available via luarocks is a huge advantage.

Re: MicroPython

#57
I'm more familiar with CircuitPython because I've bought a few boards that could run it, though I've stuck with Arduino so far. It seems to be a fork started by AdaFruit, but it looks like there are other vendor boards it works on like SparkFun, Teensy, and Arduino.

What boards work with MicroPython? On their website, they only list their own?

Re: MicroPython

#58

MicroPython is stellar. If you're building an embedded system for people to hack and customize, make the highest level abstraction of the embedded system in MicroPython so that users can easily modify/patch/contribute/hack your system with ease. This is what Arduino and Arduino IDE did for millions of hobbyist, but it is time to ditch C/C++ for MicroPython. In this [1] PyCon talk by Matt Trentini, a demo of QR code g…

I would go with uLisp because Lisp for me [1]. And for IOT and small distributed things Nerves [2]. I started with Basic Stamp in 1997 way before Arduinos were born, and I then went on to PIC chips with C and asm.

[1] http://www.ulisp.com/

[2] https://www.nerves-project.org/

Re: MicroPython

#59
post #25
post #14

MicroPython seems to be heavily focused on embedded systems . Is there any support for embedding it within an application , i.e. as a replacement for Lua? Or is there another lightweight Python implementation (or Python-like language) that supports this?

Why would you want to replace Lua in this space? At least why replace with another dynamically typed, imperative scripting language, but without tail-call optimization? What would be the gain?

> Why would you want to replace Lua in this space?

The crowd of people who speak Lua is pretty different than those who speak Python.

I would guess the Lua crowd to be older, more experienced, but smaller.

The Python crowd is much bigger, and includes people who dabble in coding rather than those of us who do it for a living.

It depends on the user base of your application, but I can totally see why Python would be a better embedding language for users to use. You build the product for the users after all.

In todays world, I'd make some V8 bindings and get users to use javascript, because that's even easier to embed, has a bigger ecosystem via nodejs/npm, and has a probably larger userbase... It's got a nice remote debugger/UI too, which is quite a plus if you're expecting inexperienced users to write plugins/modules for you.

Re: MicroPython

#60

Neat, but not very practical. To be of any use you still need board support to drive the I2C, SPI, etc which means you have to use C anyhow. You can buy one of their boards with the BSP but that's over $40, yikes. To use micropython you need at least an M4 class micro-controller so that a $5 or greater part. Or you could just stick with C and use a M0 class micro that costs A difference of $40 in BOM cost makes it on…

Huh? I use MicroPython on ESP8266's that I'm sure are way under $5 in bulk these days. Including I2C support and various other stuff, without writing any C. I am a hobbyist but I don't see any reason why the same thing wouldn't work in a commercial product.
Post reply on HN