3 ms·
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 yo
by ErikCorry 5y ago
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.
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.
https://twitter.com/toitlang/status/1395365234664161283 https://twitter.com/toitlang/status/1395365234664161283
https://docs.toit.io/language https://docs.toit.io/language
- CornCobs 5y agoI also dislike language subsets. I feel that you run into the limitations of the subset real quick and figuring out the boundaries of the subset often feels like groping in the dark. Especially true for large languages like Python. My most recent experience is with Numba, the python subset JIT, so it may be slightly different for micropython
- kmill 5y agoWhat's the argument here? That it's difficult to learn to use a subset of a language because it is frustrating to locate the boundaries? Isn't it more frustrating to learn a completely unknown language? 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.
- CornCobs 5y agoIn practice though, the familiar syntax and semantics often leads you to believe you can do things that you in fact cannot, until you face the "this feature is not supported" error or go read the documentation and search through the long list of unsupported features, then curse yourself and rewrite your code around the lack of said feature. 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.
- kristiandupont 5y agoThis: >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)
- pansa2 5y agoI think it's accurate, though. Far more people know Python and Ruby than Lua, but when it comes to embedding an interpreter in an application, nobody chooses the language subsets of MicroPython and mruby over the complete language of Lua.
- deleted 5y ago[deleted]
- m4r35n357 5y agoHow about just "The Good Parts"?