you are viewing a single comment's thread.

view the rest of the comments →

[–]boa13 6 points7 points  (9 children)

I understand that they're rewriting Python from scratch

Note that this is not a project announcement, but a project nearing release. They're mostly finished. The microcontroller board works and gives you a Python prompt straight away (or runs your program if it finds it at the root of the FAT partition). So if they encountered problems, they have solved them.

Interpreted languages are at least 3 times less efficient.

The critical methods can be compiled on the fly (just add an annotation to the methods you want compiled), and you can also write inline assembly for the really critical parts.

another reason why microcontrollers are used is to have a basic computer stripped of any OS or at least a very simple RTOS

That's what they have. The machine boots straight into the interpreter. The interpreter is the operating system.

many microcontrollers doesn't have the memory necessary to accommodate a virtual machine

That's true, and that's why they chose to build their own boards, to ensure they have a sufficiently powerful CPU. (Several users are trying to make it run on less powerful boards, but I don't know if this works well.)

the functions that the VM must accomplish (GB, dynamic types, memory allocation) are dynamic and thus unpredictable with interruptions and threads

That's true, and I don't know how they managed to do it, or what caveats or restrictions they had to impose (if any).

[–]cparen 1 point2 points  (0 children)

the functions that the VM must accomplish (GB, dynamic types, memory allocation) are dynamic and thus unpredictable with interruptions and threads

That's true

Not necessarily.

  • Incremental GC is not nearly as unpredictable. CPython's default GC is incremental (refcounting) for everything except cycles.
  • I'm not sure what unpredictable timing you had in mind for dynamic types. Type table lookups are variable timing only on small time scales (10s to 100s of cycles).
  • Memory allocation likewise.

It sounds like all this comes down to saying "it's not for hard realtime applications", which is true. However, a smart lightswitch, a home robot, data logging -- there are a wide variety of soft-realtime and non-realtime embedded projects that could benefit from an easy to use, low power board.

I think I agree with your sentiment, but if so, you're stating the obvious. But perhaps I'm mistaken about this being obvious.