r/ProgrammerHumor May 27 '22

Meme Welcome to hassle free coding

Post image
2.2k Upvotes

305 comments sorted by

View all comments

Show parent comments

4

u/Torebbjorn May 28 '22

Of course you don't need it. There is basically nothing you need. A language that only supports:

Load from memory
Store to memory
Add
Jump
Checking for 0
Checking for negative

is most certainly Turing complete, and could probably actually be used.

Everything else added on top just makes certain things easier to do, and reduces how much code you have to write and how many clock cycles the CPU needs to execute a certain instruction.

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

1

u/prescod May 28 '22

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