4 ms·
So basically this is an RTOS that runs an interpreter for a script(s) stored in flash. Correct? I didn't understand if this script is precompiled or not. I'm s
by scoutt 5y ago
So basically this is an RTOS that runs an interpreter for a script(s) stored in flash. Correct? I didn't understand if this script is precompiled or not.
I'm sure that if you want to avoid
uint8_t* ptr = 0x20000000;
while(1) { *ptr = 0xFF; ptr++; }
you have to be interpreting something else that is not C.
But this is a very interesting project in the way it's presented. I did once something similar, running in parallel some sort of reduced LUA scripts.
Even though, after 20 years of working in embedded, my free and unsolicited advice would be this: if you want to learn embedded, no matter how hard you are trying to avoid it, you need to learn some low-level language like C (or Rust or whatever is fancy now).
Put your mind at ease and do the extra mile. At the end learning C is not that hard. And I suppose you are learning, because if you propose Toit in your workplace is because you don't know how to code anything better at the moment.
I don't want to hurt anyone's feelings or sound dismissive but... learn C (or anything low-level). The rest are just toys of the moment.
- MayeulC 5y agoIt really depends on your needs. Overkill microcontrollers aren't that expensive anymore. It's probably faster to prototype something with micropython than C. And I say that as a very proficient C developer. On the other hand, C isn't hard to learn, since the language is so small. What's harder is to learn its pitfalls and the parts that are actually implementation-specific, and not specified. I'd argue that learning some assembly (enough for a few toy projects) is more useful to understand the system. C is required if you want to make the most out of the hardware, at least for now.
- scoutt 5y ago> Overkill microcontrollers aren't that expensive anymore I knew that this would be mentioned but I didn't want to write an extensive comment. In many embedded markets, cents make the difference. Also, space constraints, power consumption, availability, etc., makes you reconsider overkillability/price relationship. Someone will put a 16KB MSP430 in the BOM and there you go. What I wouldn't buy is something like "hey, chips are cheaper, let use a prototyped javascript-system over a VM over an RTOS, just because". > What's harder is to learn its pitfalls and the parts that are actually implementation-specific Yes. There are tradeoffs, like in everything in embedded. > It's probably faster to prototype something with micropython than C. Personally I wouldn't know where to start with micropython.
- pjmlp 5y agoPretend it is just like C64, Z80 BASIC, or BASIC Stamp.
- scoutt 5y agoSee??? Because you don't want to learn C now you have to learn Toit, Python, BASIC and another two subpar-performance languages!!! :)
- pjmlp 5y agoMy first computer was a Timex 2068, and I learned C long time ago, enough to be dangerous and knowing only to touch it when there is no other modern option available. Most of the stuff people do in the Makers community is more than doable with Micro/CircuitPython + a bit of Assembly.
- AYBABTME 5y agoOne could say that because you don't want to look at micropython now everybody else has to learn C. You earlier made an appeal to authority that people should just learn C/low-level language, and then admitted you have no clue how you'd get started with micropython. What makes your appeal to authority... authoritative, then? Not saying your conclusion is wrong, but here's some unsolicited advice, if you may take it: maybe you could explore the approaches you dismiss before professing that they shall be dismissed.
- scoutt 5y agoThe above was a joke. And where did I say “I don’t want to look at micropython”? I do know that if I want to learn it, it isn’t something out of my reach. But there are things you can do with C you can’t do with micropython, so other than from academic standpoint, what’s the point? I am already proeficient with C. That said, I don’t care what other people do. I had good intentions with my advice, talking from 20 years of experience in the field.
- jmiskovic 5y ago
- pjmlp 5y agoDepending on the hardware, there are other languages available other than C. For example I would rather use one of MikroElektronika Basic or Pascal compilers. https://www.mikroe.com/ https://www.mikroe.com/
- qayxc 5y agoNot to mention languages that can be compiled to C.
- sebe 5y agoMy understanding with toit vm you have can have multiple programmes running and if one crashes, the others continues. The vm, etc, allows live update and or to deploy something new. If you're interested in hearing Kasper talk about toit, he did a long livestream the other day, the toit bit is at the 1hr 34min mark. https://youtu.be/k7YITNpvcaY?t=5640 https://youtu.be/k7YITNpvcaY?t=5640
- rm445 5y agoIt's conceivable that microcontrollers with memory management units could become more commonplace. Your memory-trashing program could be restarted while the device keeps on doing other things, rather than the traditional bare-metal approach of having a watchdog restart the device.