Can Mojo 0.6.1 program microcontrollers? #1561
Replies: 2 comments 4 replies
-
I'd say no. As from the answer from #1461, there is some work that would need to be done in order it can be used for microcontrollers. One problem that I see is that some microcontrollers have different (exotic) instruction sets. The compiler currently has only real support for x86 and arm and those are tied to the operating systems (arm only works with macOS, ...) This will probably stay like this for a bit, because the priories lie different (e.g Windows support, bug fixes, ...). TLDR; No, not with 0.6.1 |
Beta Was this translation helpful? Give feedback.
-
As for the different exotic instruction sets, I'm not sure where MLIR and LLVM would fit into the picture, but I believe they will help. I'm still not exactly sure what MLIR does, but it appears to be a "compiler framework" that allows hardware vendors to quickly create backends that will take some kind of IR (I presume LLVM IR) and generate the machine code required by the hardware. This is necessary for all the exotic GPU and other hardware accelerators also, so I imagine it can be applied to microcontrollers as well. So, I would say that mojo's long-term goals would make it a good language for baremetal hardware
I think what mojo would need, and I haven't heard of anything on the roadmap for, is an abstracted out standard library like rust has, so that the "regular" standard library which makes use of OS resources is built on top of a more core fundamental library that doesn't assume built in memory allocators and data types that need it (e.g. any kind of heap allocated structure, including String types). |
Beta Was this translation helpful? Give feedback.
-
I am very curious to know whether Mojo 0.6.1 is capable of programming microcontrollers or not, and I do not really know the answer. Please, if you know the answer, So tell me Thanks.
Beta Was this translation helpful? Give feedback.
All reactions