by Isomorpheus · 6y ago · 0 comments
You just mentioned using "nil" in a simple example which doesn't appear to be related to systems programming.
Just checked Github for some of the top Nim projects.
Forum software: https://github.com/nim-lang/nimforum/search?q=nil&unscoped_q...
Web framework: https://github.com/planety/prologue/search?q=nil&unscoped_q=...
Twitter front-end: https://github.com/zedeus/nitter/search?q=nil&type=Code
These uses of "nil" don't appear to have anything to do with systems programming.
You need nil/null when doing systems work -- and Nim is capable of that -- but I don't know the rationale for allowing 'nil' in higher level language features.
Nim interests me but this nil business seems questionable to me.
Just found this comment from the language creator,
https://github.com/nim-lang/Nim/issues/6638#issuecomment-487...
"We need the nil state to disarm pointers but that only means these can be nil and so would require a nil check before deref. Doesn't seem to be too hard nor too cumbersome."
Seems a bit dismissive to me