6 ms·
> Q. How do you port an OS from one language to a new one, pre-LLM? A. you reduce impedance mismatch, but making the new language using similar concepts and m
by nivertech 10d ago
> Q. How do you port an OS from one language to a new one, pre-LLM?
A. you reduce impedance mismatch, but making the new language using similar concepts and mechanisms
--
You're right, this table is just a coincidence, probably derived from the standard math notation, and used in many PLs like FORTRAN and Python ;)
PDP-11 C
INC R ++i
DEC R --i
ADD src, dst dst += src
SUB src, dst dst -= src
(R)+ *p++
-(R) *--p
X(R) p[x]
@(R)+ **pp++
@X(R) *p[x]
BR label goto label ; near jump
JMP label goto label ; far jump
- uecker 10d agoI do not disagree with the point that some superficial aspects are inspired by the PDP-11, I disagree with that this has anything to do with the fundamentals of computing architecture. It would also completely contradict the whole idea that everything today simulates the PDP-11 design because of C, as few architectures have this auto-in/decrement addressing modes despite C having native syntax.
- rramadass 10d agoYou are being somewhat disingenuous with your comment ;-) PDP-11 was hugely influential in the later designs of various Hardware, Software, OS, Languages etc. See for example; Dave Cheney's What Have We Learned from the PDP-11? - https://dave.cheney.net/2017/12/04/what-have-we-learned-from-the-pdp-11 https://dave.cheney.net/2017/12/04/what-have-we-learned-from... The conclusion from the article; While its development was sometimes chaotic, and not without its flaws, the PDP-11 is at the intersection of many threads of history. Hardware, software, programming languages, operating systems, have all been influenced by the PDP-11. I wager there is not a single person in this room who cannot trace the lineage of the language they work with, the computer they use, or the operating system it runs, back to the PDP-11. And that is worth celebrating. While the PDP-11 instruction set was certainly influential in the design of the "C Abstract Machine" the latter was generalized to accommodate other architectures extent at that time (eg. Honeywell 6000, IBM System/370) with enough flexibility that you can implement a C compiler for almost any architecture you can think of. That is its strength. David Chisnall's criticisms in his C Is Not a Low-level Language: Your computer is not a fast PDP-11 (https://queue.acm.org/doi/10.1145/3212477.3212479 https://queue.acm.org/doi/10.1145/3212477.3212479) has to do mainly with the fact that the abstract machine was serial execution with no concept of memory protection/models. But this very flexibility is what makes C easily portable to dinky little MCUs which do not have those features while allowing the programmer to explicitly program those using libraries on more complex processors with lots of parallel cores, mmus etc. Thus a single thread runs on a "C abstract machine" on a core (i.e. the bare minimum) and it is up to the programmer to manage interactions between the threads on various cores. We have lost nothing but perhaps burdening the programmer with more knowledge of hardware complexity which was an acceptable tradeoff then. Note also that there already exists various extensions to C to handle parallel programming directly eg. "Concurrent C" by Narain Gehani et al. The industry however chose to settle on external libraries and optional thread support in C11 again keeping with its minimality and flexibility mantras.
- uecker 10d agoNote that IMHO there are quite a few things incorrect or misleading in this article.
- rramadass 10d agoDo you mean in Cheney's article or Chisnall's article or in my comment?
- uecker 10d agoChisnall's article. A lot of the general criticism would still apply if you replace "PDP-11" with "von Neumann architecture" which makes the whole thing a bit weird. But also many specific comments about C are bit off (the cost of copying padding, the sequencing, provenance, etc.)
- rramadass 10d agoRight. Its catchy title gained it notoriety and then got amplified by human parrots. However, it is a good article to read and understand low-level multiprocessing issues.
- rramadass 10d agoYou might find Beyond the PDP-11: Architectural support for a memory-safe C abstract machine by David Chisnall et al. also interesting - https://dl.acm.org/doi/10.1145/2786763.2694367 https://dl.acm.org/doi/10.1145/2786763.2694367
- uecker 9d agoYes, I have much less complaints about the content of this paper, except for the PDP-11 meme aspect.