3 ms·
Are you going to use Rust on a PIC12 with 32 bytes of data memory and max 256 code instructions? Of course not. Assembly is still king in this low-powered embed
by zozbot234 7y ago
Are you going to use Rust on a PIC12 with 32 bytes of data memory and max 256 code instructions? Of course not. Assembly is still king in this low-powered embedded class and will stay as such for the foreseeable future.
- brohee 7y agoAt the 10 year horizon the grandparent was using, the ultra low end of MCU may be substantially more powerful, with possibly lowend AM or RISC V being the smallest thing you can find. At some point, packaging will dominate cost over silicon for such small MCU so a better silicon won't cost much more...
- zozbot234 7y agoPackaging will dominate silicon costs? I see plenty of silicon chips directly soldered onto PCB's for the smallest and cheapest applications, i.e. no packaging whatsoever.
- brohee 7y agoThe entity that solders it received it on a tape most likely, in 10 year I can totally see a small 32 bit core costing less that that.
- wtetzner 7y agoMaybe I misread it, but it sounded like the OP was comparing Rust to C or C++ on low-powered/resource-contrained firmware, not assembly.
- derefr 7y agoIn that specific case, I’d probably still not use ASM directly, but rather probably a Lisp DSL for machine-code generation (and a Lisp emulator for the ISA it generates), so that I could in turn write some genetic algorithm or somesuch to explore the space of such ASTs (and thereby the space of max-256-byte machine-code programs) to find the optimal way to pack instructions to solve my problem (where “solve my problem” is specified in terms of what the emulator’s registers and memory should look like on a given cycle.) ASM is for the use-case where you're optimizing code in terms of using specific instructions or intrinsics; but it's not really for the case where you're concerned with specific opcode encodings (as ASM abstracts that away, grouping multiple different opcode encodings—some short, some very long—behind a single friendly instruction name.) In that case, you have to work with the machine-code directly—or, at least, through data structures that contain machine-code at the base level, and so can tell you exactly what machine-code they contain.
- jack_h 7y agoBut the full quote is: "I doubt that we'll see it used for low-power/resource-constrained firmware, but lots and lots of embedded systems are now bulky Linux boxes with years of uptime, and I can see Rust making inroads there." There is a massive number of devices between an 8-bit PIC and a Cortex-A. Obviously you're not going to use Rust on a tiny PIC or similar, hell that architecture is outwardly hostile towards even C. I'm guessing these very low power chips will exist for many years to come, but a lot of work has moved over to things like Cortex-Ms which absolutely benefit from things like Rust.
- jononor 7y agoYeah, this segment (Cortex-M) is on the order of a billion devices shipped each year. With growth expected to stay high for years to come. Plenty of space for Rust to get adopted.
- dorfsmay 7y agoI interpreted alxlaz' comment as Rust vs C (or other high level language, C+" etc...), which his answer to my question seem to indicate that was the case, as he gives more reason for Rust likely not to be adopted on some platforms.