News for hackers. Stuff that matters.
Re:Stack-Oriented Programming by astrobe_ on Tuesday January 14, 2020 @06:05PM (#22050164)
Neither.

I recall that the first thing that jumped out at me was that Chuck's code didn't have all those layers that my code had. There was the abstracted code on top and the hardware drivers on the bottom and very little in between. There was not a clear distinction in style at various levels as in my code where there were always someone else's code layered under mine that I could not or dared not change. Chuck's code looked abstracted and high level right from the bottom, the top used almost as many primitives as the bottom code. [1]

The confusion seems to come from the idea that a piece of code has to be either "abstract" all the way or "close to the metal" all the way. Why should it be? If you need to flip a bit in a peripheral between a call to some filesystem function and a call to memory page management function, just do it directly, don't invent a pseudo-high-level function just for that. Bare metal ain't dirty.

[1] http://www.ultratechnology.com/levels.htm

Re:Stack-Oriented Programming by pjc50 on Wednesday January 15, 2020 @05:55AM (#22053224)
> Bare metal ain't dirty.

No, but it's not as solid as it sounds. What happens when version 2 of the hardware appears, and moves the bit to a different register?

Re:Stack-Oriented Programming by naikrovek on Wednesday January 15, 2020 @10:31AM (#22055046)
> What happens when version 2 of the hardware appears, and moves the bit to a different register?

You adapt your code for that platform. I don't know why developers today have such a love affair with unnecessary abstraction. Abstract when you need to; never before.

Re:Stack-Oriented Programming by pjmlp on Wednesday January 15, 2020 @06:01AM (#22053247)
The same thing when a new OS release break some API call.
Re:Stack-Oriented Programming by pjc50 on Wednesday January 15, 2020 @06:54AM (#22053466)
.. which they do far less often than hardware changes. You have a reasonable chance of running a 25-year-old Win32 program or 20-year-old statically linked ELF Linux program.