Hi all, I had a strange thing happening yesterday, which I cannot explain on my own. I am writing a firmware and some tools in nim for an 8-bit microcontroller, and part of this firmware implements an interrupt-based serial receiver via uart.
Data coming from there has a specific format, which gets parsed by the fw to populate the an object variant. Now this is where I see a strange scenario: I am using --mm:none --os:standalone --cpu:avr and with this configuration, accessing an object variant yields
Error: system module needs: appendString
If I use --mm:arc -d:useMalloc this disappears: why is that? Is it because object variants use exceptions behind the scenes to check for a wrong access? For context, I was trying to avoid --mm:arc because for this tiny MCUs the code sizes gets ~2x bigger for me.
Is it because object variants use exceptions behind the scenes to check for a wrong access?
I don't know, that might be the reason.
Usually the code size problems --mm:arc introduces are not really cause by ARC, but by --exceptions:goto. You can use --exceptions:quirky and get ARC's conveniences.
Thanks for the reply and suggestions, I stand corrected:
I did some more testing and changes and some preliminary numbers are pointing towards smaller builds with arc (also tried quirky, with bigger firmwares, with nice results)!
I will benchmark this more precisely for size and also at runtime later, but at this point I don't really have any reason to keep using --mm:none..
Nim is really incredible