News for hackers. Stuff that matters.
Re:What if you couldn’t program with loops? by Syzygies on Monday July 15, 2019 @11:02AM (#20441458)
Never forget that cultural differences look odd in either direction. My favorite passage from "Structure and Interpretation of Computer Programs":

> One reason that the distinction between process and procedure may be confusing is that most implementations of common languages (including Ada, Pascal, and C) are designed in such a way that the interpretation of any recursive procedure consumes an amount of memory that grows with the number of procedure calls, even when the process described is, in principle, iterative. As a consequence, these languages can describe iterative processes only by resorting to special-purpose “looping constructs” such as do, repeat, until, for, and while. The implementation of Scheme we shall consider in Chapter 5 does not share this defect. It will execute an iterative process in constant space, even if the iterative process is described by a recursive procedure. An implementation with this property is called tail-recursive. With a tail-recursive implementation, iteration can be expressed using the ordinary procedure call mechanism, so that special iteration constructs are useful only as syntactic sugar.

Re:What if you couldn’t program with loops? by Retric on Monday July 15, 2019 @11:25AM (#20441688)
From the other side, tail call recursion is often actually implemented as a loop by the interpreter. Effectively, making many recursive programs just a different way to write a loop.
Re:What if you couldn’t program with loops? by madhadron on Monday July 15, 2019 @12:04PM (#20442082)
Under the hood it's all conditional jump instructions whether it's tail recursion, loops, or if/else expressions.
Re:What if you couldn’t program with loops? by stcredzero on Monday July 15, 2019 @12:13PM (#20442195)
Is there an alternative to conditional jump instructions? What would a such a computer look like? Maybe such a computer exists, but it's hard for us to see it, because we've been drawn into thinking along Von Neumann machine lines.
Re:What if you couldn’t program with loops? by opwieurposiu on Monday July 15, 2019 @01:39PM (#20443218)
There other ways to do it, but they tend to be less efficient.

https://github.com/xoreaxeaxeax/movfuscator

Re:What if you couldn’t program with loops? by ksherlock on Tuesday July 16, 2019 @07:57PM (#20455090)
indexed jump instructions? (where the index is a boolean value corresponding to the if condition...)
Re:What if you couldn’t program with loops? by Retric on Monday July 15, 2019 @10:27PM (#20447027)
Several CPU’s had specific loop instructions. These are slow on x86, but where sometimes useful on other CPU’s.

Though this is half remembered second hand info, so your mileage may very.

Re:What if you couldn’t program with loops? by madhadron on Tuesday July 16, 2019 @02:03AM (#20447820)
You're absolutely right. I'm usually careful about being blinded by current machines. And there are other ways like changing your return stack manually which could be used to loop.

I was trying to express that the various mathematical formalisms we think in are all getting translated to the same machine in the end.