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.
[ Parent
| on HN ]
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.
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...)
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.