2 ms·
Out of interest, genuinely asking, Go is out of the question due to the GC?
by keyle 6y ago
Out of interest, genuinely asking, Go is out of the question due to the GC?
- detaro 6y agoAnd generally not being designed with that kind of low level/microcontrollers in mind. There is a variant for microcontrollers (https://github.com/tinygo-org/tinygo https://github.com/tinygo-org/tinygo), so it's not impossible, but the fact that it is a variant and not just a different compile target already tells us something about the different focus.
- 1f60c 6y agoEven a "hello, world!" application is like 1.6 MB when using Go, when (from the article) > microcontrollers have limited program space, roughly 10–100kB in my case
- coder543 6y agoTinyGo is a Go toolchain for microcontrollers that uses LLVM, and it produces binaries that are extremely small. A few kB is not uncommon from what I've heard, although I don't have much personal experience with it. For WASM, the smallest binary TinyGo can produce is on the order of 500 bytes, and I would expect bare metal MCU targets to be similarly sized for the smallest hello world binaries. The standard Go toolchain cannot compile for microcontrollers, so the size of binaries that it produces is irrelevant. Just like there are many compilers for C, there are multiple compilers for Go with different priorities. https://tinygo.org https://tinygo.org