Hi Javier,
Actually the opposite applies. C language handle *REAL* memory directly.
A NULL pointer in C is just a pointer whose value is 0, and 0 is a *REAL* memory address.
Most desktop&servers CPU's will consider an access to the 0 address a programming mistake and raise a SEGFAULT, but that's just a design decision. 0 is just one in a set of forbidden address as many other (upper memory belonging to kernel space for example or "gaps" between stack segment and code segment).
In fact, in microcontrollers, the "0" address can be read/written normally and it's even possible that some of them use it mapped to I/O ports.
In high-level languages NULL is, as you said, is a separate, single valued type.
What's the utility of such value? There are just two possibilities.
The first one is to declare a variable without forcing to initialize it. For sort programs this can work if we are sure that it will be initialized later on, before reading it.
In bigger programs it's a wrong pattern. A program can always use default values of a given type instead of a NULL, and that automatically fixes many potential errors.
The second use of NULL, is to use it internally (in the Lua VM) as a "mark" to indicate special values like "end of list", "end of parameters", ... This NULL is used just in if conditionals to continue/stop some function.
In such case, it's also possible to replace it with some other more intuitive values. In the lua VM C code for example it would be possible for example, to declare
TValue endOfList;
And later on, just use code like:
if (&objectInstance == endOfList) { /* we are finished reading the list */ ... }
In the Lua VM C code, there is not need to assign any type to those "mark" variables (not need to create a new NULL value), since they will never be read, only its address in memory will be compared, but the code will be more maintanable and easier to read.
Regards,