3,566 karma · joined May 8, 2013 (13y ago) · 1,534 submissions
comment 3y ago · link · parent
comment 4y ago · link · parent
But you are right that x86 processors can (they all do?) track stack pointer movement in the frontend. For RISC you can track affine transformations of registers or even just the ABI designated stack pointer but it’s usually not worth the high cost.
comment 4y ago · link · parent
The biggest reason we do not use stack machines today is that it's actually harder for optimizing compilers to generate good code for and it's awkward when joining control-flow from multiple blocks (stacks have to be in the same state).
However, amusingly, almost all modern processors have a small-ish control stack; it's called the RAS, the Return Address Stack predictor and allows the frontend to fetch through calls and returns way before the actual instructions are executed. There's definitely some redundancy here as everything is done again at execution time (and we check that the frontend got it right).
ADD: Knuth's MMIX and SPARC's register windows implement effectively a coarse stack, but both completely miss out on the instruction density that a true stack computer has.
comment 4y ago · link · parent
comment 4y ago · link · parent
comment 4y ago · link · parent
comment 4y ago · link · parent
comment 4y ago · link · parent
X11 is such a kludge, but a useful one, so it took the market I guess. I suppose Wayland is the future but AFAICT, it's even harder to develop for than X11.
comment 4y ago · link · parent
When I first got here I was stunned by how noticeable nicer the weather was when driving from Santa Clara to Palo Alto, and more than once have I forgotten to bring a sweater to SF.