Discussion about this post

User's avatar
BreddyT85's avatar

"Most CPUs implement CALL and RETURN opcodes. These instructions were originally meant for sharing common bits of code"

Dear Paul, are you referring to GOSUB/RETURN statements in the BASIC language? These instructions permit to call a piece of code multiple times during the execution of the program. The called section is enclosed between a label and the RETURN instruction, but it has access to all the variables declared in the main section of the program. The code section called by GOSUB behaves like a subroutine without any input parameters, neither local variables. The GOSUB/RETURN couple is a very primitive version of CALL/RETURN paradigm.

Steve Phillips's avatar

Nice post. I think this one does the clearest job of pointing out that what most programmers think of as the fundamental building blocks of software -- functions -- are in fact not fundamental at all.

> What is called “programming” today is not programming of bare CPUs, but, is only a function-based variant of programming that requires function-based engines and libraries. This is what we have. We’re not going to go back to square one and start all over. We have to build on what we have.

Speak for yourself :-D . In 3 years we'll be using LLMs to write entire operating systems with exactly the features we say we want, and no more. Those OSes will be written in whatever programming language we tell it to use, including momentarily-imaginary ones we prompt into existence.

The time has come to #RewriteTheStack .

6 more comments...

No posts

Ready for more?