3 ms·
And further, in my view, if manual memory management is extraordinarily difficult a language is not necessarily a good candidate for systems programming.
by sidlls 10y ago
And further, in my view, if manual memory management is extraordinarily difficult a language is not necessarily a good candidate for systems programming.
- zzzcpan 10y agoYou can relatively easily get to manual memory management using Go's runtime, i.e. access those runtime·sysAlloc(), runtime·sysFree() functions directly, the way Go accesses syscalls in the external sys package [1]. It's like ten lines of code, nothing extraordinarily difficult. [1] https://github.com/golang/sys/blob/master/unix/asm_linux_amd64.s#L16 https://github.com/golang/sys/blob/master/unix/asm_linux_amd...
- kibwen 10y agoThe difficulty of manually managing memory isn't necessarily to do with how many lines of code it takes to allocate or deallocate. The difficulty is in managing the scope of the rest of the program that is now susceptible to memory errors, which extends far beyond those initial ten lines of code if encapsulation is done inexpertly.