by ErikCorry · 5y ago · 0 comments
We made lots of small decisions to make Toit useful for IoT. One of the things we optimized for was making the program code ROMable, so you can leave it in Flash. This has subtle effects on the language design but is vital on small devices where flash is often much larger and more power efficient than RAM.
We also just wanted to make a modern language with decisions that are natural in 2021, but weren't well known when Python was invented. Things like nullable types, or a language server that gives you nice autocompletion in VS Code. This also affects language design: collection.size is better than len(collection) because you can type collection.<tab> and the editor will help you.
>I don't personally think that using a subset of an existing language is a pleasant solution for programmers. The language doesn't get a coherent design, and you don't know which parts of the language will be present.
..sounds exactly like the kind of justification I would come up with if I got excited about designing a new system. Something that has happened many times :-)
(Note: I am just joking here, I have tremendous respect for you and your team mates)
My most recent experience is with Numba, the python subset JIT, so it may be slightly different for micropython
Maybe what you're talking about is a combination of things. If you don't know what you can and can't do yet, then you're unlikely to recognize limitations. New languages also probably tend to have documentation that more completely specifies the language, versus subset languages where the implementation might be all there is to tell you what you can't do. In principle, a subset language is a new language that just happens to have familiar syntax and semantics.
It's the gap between expectation and reality, coupled with the productivity hit of often using some feature, then having to rewrite without said feature, that leads me to dislike subset languages. It's often ultimately a different language with only syntactic similarity.