I also think that nim could use a "memory" module with defines a mem-slice and 
different pointer arithmetic procedures (and a real hexdump function). That 
would at least set a standard on how to deal with raw memory for whatever 
reason. This also could have something like `proc MemSlice(s: string): 
MemSlice` which uses `unsafeAddr(s[0])` and `s.len`. This is of course unsafe 
and people may use it wrong but it would unify the topic in a module which 
could hold some information about Nims data types internal structures and why 
and how stuff works different to what one may think how it works. Those 
"MemSlice" could then be the universal Parameter for procs which accept memory 
buffer/len pairs.

Reply via email to