3 ms·
I read this as "embeds anywhere. ... I don't think you'd use Pycopy to write a desktop application That's pretty much it in my opinion. There's a huge differen
by stinos 6y ago
I read this as "embeds anywhere. ... I don't think you'd use Pycopy to write a desktop application
That's pretty much it in my opinion. There's a huge difference in available libraries. Yet for simple things and special cases there still might be reasons to choose MicroPython over CPython even on desktop platforms. CPython startup time is a multiple of MicroPython startup time for instance (ok, not a lot of chance that matters, but you never know) and some things are more performant (but others arent; due to optimizing for size). I initially got to know it when looking for an embeddable scripting language working on unix/windows and intime which is a real-time extension for Windows, and of all major and less major implementations I checked MicroPython was the only one which only needed a small amount of extra code to make it compile, because it was written from the start with the idea to use C99 and make no assumptions about availability of libraries. CPython on the other hand was pretty messy (and LUA, and ...) E.g. if CPython sees an msvc compiler it automatically assumes it's running on Windows and has access to the complete CRT. Of which intime is the prime example where that is not the case. So, not easy to workaround and moreover it assumes e.g. it has registry access and that's not something which can be disabled with PP directives. And so on. I'm not really blaming anyone for that, makes sense from a certain point of view, but it's not too ideal. MicroPython on the other hand has like a hundred PP directives making a lot of features configurable, even language features so it can be made really minimal. Also MicroPython's source code overall is really nicely written, very readable, again in contradiction to some of CPython's source I've seen. And some parts like interpreter and compiler are pretty genius.