Subroutine calls in the ancient world, before computers had stacks or heaps
41–50 of 241 posts
Re: Subroutine calls in the ancient world, before computers had stacks or heaps
#42Earlier quoted context omitted.
Historically, that was also a big goal of GNU. It aimed to get rid of artificial limitations in core utilities. That was a big improvement over (made up example) sed having a finite and short maximum command length.
I can understand why people wanted that, and the benefit of doing that. With that said, I also see benefit in having limitations. There is a certain comfort in knowing what a tool can do and cannot do. A hammer cannot become a screwdriver. And that's fine because you can then decide to use a screwdriver. You're capable of selection. Take PostgreSQL. How many devs today know when it's the right solution? When should t…
Don't tell me you've never hammered a screw into a wooden plank? Vice versa, a screwdriver also can be used as a hammer although a quite pathetic one.
Re: Subroutine calls in the ancient world, before computers had stacks or heaps
#43Re: Subroutine calls in the ancient world, before computers had stacks or heaps
#44Earlier quoted context omitted.
Most recursion is about as bad as goto coding methodologies. Personally, I think it should be avoided in modern compiled languages too. Haskell is fun to play around on, but it is horrific to consider using in a stable production environment. =)
Outside of a university course, if I see recursion in a non-FP language I consider it a code-smell
Re: Subroutine calls in the ancient world, before computers had stacks or heaps
#45Am I the only one who read it as the ancient world before computers existed had stacks or heaps? English is so weird sometimes...
Re: Subroutine calls in the ancient world, before computers had stacks or heaps
#46Re: Subroutine calls in the ancient world, before computers had stacks or heaps
#47I wrote a Forth interpreter for a SUBLEQ machine ( https://github.com/howerj/subleq ), and for a bit-serial machine ( https://github.com/howerj/bit-serial ), both of which do not have a function call stack which is a requirement of Forth. SUBLEQ also does not allow indirect loading and stores as well and requires self-modifying code to do anything non-trivial. The approach I took for both machines was to build a virt…
Re: Subroutine calls in the ancient world, before computers had stacks or heaps
#48Am I the only one who read it as the ancient world before computers existed had stacks or heaps? English is so weird sometimes...
The ordinarily “The Ancient World” means an era ending with the fall of the Western Roman Empire circa 476 CE. All that world was well before computers were a thing (even the human type were called “scribes,” “clerks” etc.) So of course I read it the same way even though “before computers” was redundant once your comment made me think about it.
Re: Subroutine calls in the ancient world, before computers had stacks or heaps
#49For the kind of programs I write for AVR-8 it seems insane to use the calling conventions of C, so if I write assembly I can sometimes keep the inner loop variables in registers (big register file) and otherwise use the methods he describes. I like “coloring” functions in an app like that, if I know a red and a green function will never be active at once I can reuse locals/parameters for them.
Re: Subroutine calls in the ancient world, before computers had stacks or heaps
#50Note that before we had arbitrarily extensible heaps, programmers always did at least a little engineering, in that they had to consider the probable distribution of inputs and size* all their intermediate storage appropriately. * giving rise to "BUGS AND LIMITATIONS "