30 ms·
What do you think about MicroPython?
by rch 10y ago
What do you think about MicroPython?
- dbcurtis 10y agoI am a total MicroPython fan boy. I've done a lot of embedded C-on-bare-metal development and related electronics. For most non-embedded work, I use Python and am a huge fan of the language, so having Python on an ARM Cortex gets me very excited. MicroPython is absolutely great for getting a complex embedded project up and running quickly. Execution performance, of course, is nowhere near C. But, since a lot of performance critical I/O handling is already done as a C extension (import machine), and it is just as easy to write a MicroPython C extension as it is to write a CPython C extension, you can always move the performance critical parts to C as needed. Overall it is a huge win in development time. MicroPython does require a fairly biggish ARM Cortex M3, though.
- StavrosK 10y ago> MicroPython does require a fairly biggish ARM Cortex M3, though. What do you mean? I run it on an ESP8266 just fine, the tooling isn't great (it launches a REPL and takes up your serial port with no way to stop that), but other than that it's fantastic.
- dbcurtis 10y agoYes, but the ESP8266 is a bit of a squeeze. It's a more comfortable fit on larger processors. As to the serial port/repl issue, can't you build your own image to do something else that you like better? Micropython is pretty easy to build, in general.
- StavrosK 10y agoI imagine I could, but I'm very bad with C :( The REPL is fantastic when you want to prototype stuff, but it's not great when you want to actually deploy things. I'm sure there's going to be some way to avoid launching it in the future, though, such as having a main.py file that has a `repl.run()` you can take out when deploying your own code.
- dbcurtis 10y agoThe code for Micropython is very well structured. The toolchain is pretty easy to set up, just apt-get and go. The configuration things like I/O pin assignments and such are all on pretty simple definition files. I'd be very surprised if the repl loop takes more than flipping a #define to turn off. No C wizardry needed.
- StavrosK 10y agoHmm, I'll have a look, but currently you need the repl to be able to write files (otherwise I'd have to include my files in the firmware and copy the entire thing every time). That's not really so bad, as it's what you do for the C++ version, but it would be nice if there were a way to update the code somehow. Maybe I'll write some code to fetch a file from an HTTP server and unpack it, though.
- fumplethumb 10y agoI haven't tried MicroPython, but I'd love to check it out. I've been recently seduced by Elixir, so I'm looking into Nerves[1] at the moment. [1] http://nerves-project.org/ http://nerves-project.org/