r/ProgrammerHumor May 27 '22

Meme Welcome to hassle free coding

Post image
2.3k Upvotes

305 comments sorted by

View all comments

Show parent comments

2

u/CdRReddit May 28 '22

thats not even all you need

subtract and branch if less or equal is turing complete

1

u/Torebbjorn May 28 '22

Subtracting is adding, but yeah, you are right, to actually subtract, you would need to have a way to invert a number.

I wrote "check for 0 and negative", of course that means branch

2

u/CdRReddit May 28 '22

no, like, subtract and branch if less or equal as a single instruction is enough

one instruction set computing

2

u/Torebbjorn May 28 '22

Yes, of course you don't need all the luxuries to just have a Turing complete machine. You could get by on a binary machine with just nor and branch if 0.

But my point was not to make it minumal without going esoteric. Hence my "could probably actually be used"

2

u/CdRReddit May 28 '22

even then a load/store/add/jump/jz/jn is quite esoteric

1

u/prescod May 28 '22

The point was that your code got cleaner when you got rid of the -- operator.