Closed ehmry closed 1 year ago
Excellent, thank you
Just curious: what platform are you targeting?
Solo5 unikernels. The platform support isn't yet upstreamed to Nim in part because I don't know that to do about the os
module.
I use Npeg to parse the initial command-line string from the unikernel supervisor - https://codeberg.org/eris/nim-eris/src/branch/solo5/src/eris/solo5/eris_unikernel.nim#L27 https://git.syndicate-lang.org/ehmry/preserves-nim/src/branch/trunk/src/preserves/private/parse.nim
Nice, I'll have a look at that!
Yeah, for most embedded or non-standard platforms I usually fall back to --os:any
, which works in almost any environment and has very few dependencies. Not needing to have any upstream support in the standard libraries is nice, imho.
Do not import the os module or attempt to create files unless compile-time conditionals indicate that the platform supports it or the behavior is requested from a define. This allows Npeg to be built for platforms without access to an OS.