That's usually the case. For hardware, at least
For software, it usually was done before by Lisp in the '70s.
That's usually the case. For hardware, at least
For software, it usually was done before by Lisp in the '70s.
That model works, but is not compatible with C and UNIX.
There's some good background here for those who are interested: https://www.smecc.org/The%20Architecture%20%20of%20the%20Bur...
The architecture of the B5000 / B5500 / B6500 lives on today in the Unisys ClearPath line. I believe the OS, MCP, is one of the longest-maintained software operating systems still in active use, too.
So recursive routines get access to their own local variables
I think it's important to understand that it's not a C machine, doesn't have a linear address space in the normal sense
This is worth reading to understand more:
https://people.eecs.berkeley.edu/~kubitron/courses/cs252-F00...
How do I address a variable within a function that was recursed into twice?
http://bitsavers.org/pdf/burroughs/B5000_5500_5700/Organick_...
The Unisys Clearpath line of systems have ISO C compliant compilers, and MCP provides a fairly complete POSIX environment. I've never actually programmed them, but I have the manuals. dlopen is conspicuously missing from the list of POSIX routines. I don't know how close the ISA is to 5500, but at least for Unisys Clearpath the only real incongruity in the environment is that unsigned arithmetic requires compiler-generated instrumentation as integers are sign-magnitude, which doesn't naturally provide the unsigned overflow semantics required by the standard.
ISO C has always tried to steer away from integer/pointer conversions for precisely this reason--pointers are special and might be opaque to the runtime environment. C99 adopted intptr_t, but it was optional and had restricted semantics. There's still no way in standard C to convert a function pointer to an object pointer or to intptr_t. But even in a full POSIX system this limitation only effects dlopen.
Reading the CHERI papers, porting all of FreeBSD to CHERI turned out to be surprisingly easy. dlopen and signals were two of the biggest headaches, IIRC. Very little application code had to change. Playing games with pointers just isn't particularly common in run-of-the-mill Unix applications, or even in open source generally, where writing standards-conformant code has always been valued. (Portability is even more valued, but usually the best way to achieve the latter is through the former.) It's more common in proprietary applications, like games, HPC, embedded, etc.
Sure, but that's not how it works. What does happen is that real-world software written in C doesn't use all those nasty tricks all that often anymore, or isn't that hard to fix. There are a few tricks that _do_ get used, and CHERI provides accommodations for those. Take a look at https://papers.freebsd.org/2019/bsdcan/davis-cheriabi/.
[1] https://www.cl.cam.ac.uk/research/security/ctsrd/pdfs/201406...