Hacker News new | past | comments | ask | show | jobs | submit login

And really, aren't loops just ifs and jumps under the hood? So coding is just ifs



Indeed. Jump on zero and integer manipulation are sufficient for turing-completeness. For example: https://en.wikipedia.org/wiki/Counter_machine


Can it compare two values and do one thing or another depending on that comparison? (IF)

Can it do something multiple times? (LOOP)

Can it change a piece of data?

Congrats, it's Turing complete.



All you need is `mov`

`mov`

`mov` is all you need.




It’s a pretty fun and enlightening exercise to sit down and work out how you’d implement all the usual instructions when all you have is Subtract And Branch If Negative.


it’s NANDs all the way down


It's NP-junctions all the way down.


all the way up, shurely?


and capacitors


Wires figure in there somewhere.

And lack of wires in the other places.


Until you find your NANDs are made of XORs :)


https://youtu.be/otAcmD6XEEE?t=1965

Sequence, selection, iteration (or recursion if available).

Note that the child overlooked the assumption that it's sequential.


Haha, yeah I was thinking the same.

I started in GW-BASIC when I was a kid, and all I needed was IF and GOTO. You could do anything with that. No loops, no functions, no nothing. IF's and GOTO's!!!


Ach no! It's arrays, too.


iterating and conditionals?




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: