|
|
|
|
|
by marktangotango
3571 days ago
|
|
Consider the case of an 'interpreter per thread' in an application server. In lua this is implemented by creating a lua context per thread, which is your memory foot print. The size here limits the number of concurrent requests the server can handle. So, in addition to my other comment, I think there's a major barrier to wide adoption to any of the 'mini' scripting language implementations, and that is a lot of people who use python would expect your implementation to act like the mainline. Here I'm alluding to the trouble pypy has gaining acceptance, because so many users expect all the c libraries to just work. I also contemplated going this route, not to get the language I want, but to get the runtime instrumentation I want. The conclusion I came to is that it would almost be better to create a new language than to always be explaining "no, that functionality doesn't work because of these design decisions". The language may in fact be a lot like python, or a subset python as you say, but just don't call it that! Edit; created a dupe somehow... |
|
So, in this situation, it would be useful for the interpreter to be lightweight in terms of RAM usage as well as code size. Presumably, though, it is still not necessary to be as frugal as MicroPython, which can get by with as little as 8KB of RAM and is commonly used with 128KB [1]?
A lot of people who use python would expect your implementation to act like the mainline. [...] it would almost be better to create a new language than to always be explaining "no, that functionality doesn't work" [...] just don't call it [Python]
In order to work within tens of kilobytes of RAM, MicroPython does some things differently from CPython [2]. I wonder if its developers spend much time explaining the differences between the two implementations? Or do users expect differences in the language runtimes because of the obvious differences in the hardware on which they run?
On the other hand, I imagine MicroPython would have significantly fewer users if it were advertised as "a Python-like language" rather than as "an implementation of Python".
[1] https://github.com/micropython/micropython/wiki/FAQ
[2] https://github.com/micropython/micropython/wiki/Differences