On Thursday, June 14, 2012 1:16:31 PM UTC+2,
paulo....@gmail.com wrote:
A language like Go is quite capable for OS development.
One of the features of an OS is that it needs to be defined what happens when it exhausts memory. Therefore an OS requires a programming language with explicit memory management. From this also follows the need to stop or kill a process in order to keep the OS running.
Go will allocate memory on various occasions. For example, it may need to allocate memory when converting a value from one interface{...} to another interface{...}.
In the C language, memory gets allocated as a side-effect of language design only when calling a C function (the call will result in the allocation of a new stack frame).
In the Go language, there are more places (in comparison to C) where memory gets allocated as a side-effect of language design.
In an assembly language, there are no such places in the language design. There do exist the CALL and PUSH instructions, but their usage isn't mandatory.
A difference between assembler and C/Go is that it is impossible to estimate the memory requirements of a task prior to starting the task. This is because the C/Go language and compiler are hiding information such as the sizes of stack frames of functions.