# hckrnws

On a holiday with friends I once spent some time on a beach trying to demonstrate a computer could be built with sandcastles and tennis balls.

IIRC, we managed to get AND, OR, NOT, XOR working and I set about building a half adder. It needed a lot of beach space, since it was a fairly shallow slope and you needed the balls to get up enough speed to work the logic.

The end result was, unfortunately, that the sea started washing away my design before I quite managed to debug it.

Ultimately I'd have needed to find a way to build a bigger chunk of logic and keep the balls circulating around it - didn't get that far but felt ready to do so if a post-apocalyptic scenario called for it.

Excellent use of silicon.

So you created a tiny starter version of https://xkcd.com/505/ :)

Teaches you how to build NOT, OR, AND, and XOR gates out of ideal dominoes (that fall perfectly straight).

Pet peeve: This shouldn't be called computers. Doing so blurs the difference between what they and <the natural conceptspace cluster normally called "computers"> do.

This is a *calculator*: a machine cable of doing a one-off operation (implementing something interpretable as a calculation) before requiring further intervention. "Computer" should be at least reserved for those that can do a lot of instructions, preferably indefinitely, without human involvement.

And I don't think this is a terminological nitpick, it bleeds into a fundamental disconnect that leaks out in their puffery:

>The aim is to demonstrate how very simple reactions, simple enough that they occur in real physics, can be combined to perform mathematical calculations — which hopefully helps explain how large numbers of transistors can combine to play Doom.

No, it doesn't. No matter how many of these domino calculators you string together, *you're not getting Doom* (even with the appropriate hardware to use the calculation's results). To model the core dynamic needed to run Doom, you at least need the ability to indefinitely run such calculations, in a way that subsequent ones depend on the results of earlier ones. By construction, these systems can't do that, and provide no insight into how you would.

It does provide a demonstration that a (non-electronic) physical system can implement the dynamic behind addition. Cool. But I'm not sure what layperson actually has trouble on that point. There are lots of physical systems that do that -- the confusion, I think, would lie in *how* you can bridge the gap to Doom. (At least, it was for me when computers seemed mysterious.)

Cool, they found one more physical way to implement a specific calculation. Call it a domino calculator. Don't call it a computer, don't imply it solves the core difficulties needed to run Doom.

Okay, rant over, now you can accuse me of making a mountain out of a molehill.

When I was little and first starting to dig through my local library for books about how computers work, I ran across something sort of like this domino example, and I spent years trying to work out how you could build something Super Mario Bros. out of just a bunch of stuff that a cheap four-function calculator could to. Sure, I guess ANDs and ORs are a little different from + and -, but they're still fundamentally calculations.

Eventually I realized the same thing you called out here. You need a few extra things to really do computation instead of calculation. Memory, for one, and branching is crucial. But these little demo "computers" like this and Steve Mould's water computer always leave these out.

There's probably dozens of little curious minds like mine that look at this, get excited that they'll finally understand how that magic rectangle works, and then get frustrated when they can't see how the rubber meets the road (because they're missing crucial pieces through no fault of their own).

The key thing you end up needing is a clock (along with memory of course, yeah)

I still remember clearly the day I in college read the SICP chapter on simulating circuits and realized how computers work -- a purely functional circuit combined with a clock to govern that circuit so its inputs come from memory which came from the previous state but its outputs go into memory for the next state. Prior to that I always had the same confusion you describe -- logic happens, but how does anything actually progress?

Branching isn't really necessary per se in that you can do tricks to avoid it but essentially accomplish the same thing (differentiable computing leans heavily on this), eg if you want to select A or B, rather than saying `if(x) a else b`, you can say `x*a + (1-x)*b`

Thank you! It feels so good to know I wasn't alone in thinking this!

Here's an earlier comment where I fleshed out the point (connected to a possibly dubious, parallel argument about LLMs). Start from "If my point isn't clear":

If the dominos had little motors to stand themselves back up after N seconds, would it then fit your criteria?

Also, more pedantry - if you string enough domino calculators together, you could get arbitrarily long running-time of Doom - even the 49.7 days of uptime after which Windows 95 would restart. :)

I made a comment in the neighboring subthread that I think answers this:

But a loop can be constructed with just these gates.

CPU, memory, and etc sre just a collection of these gates, connected by these gates.

For sure, you need to go further in this direction to build a general purpose computer, but it is in this direction that you have to go.

>But a loop can be constructed with just these gates.

No, it can't be. You could unroll a *constant length loop* into a network of these domino calculators (which is how you get Turing-completeness in homomorphic encryption from a few logical primitives), but you cannot implement arbitrary looping that real computers can do.

>CPU, memory, and etc sre just a collection of these gates, connected by these gates.

No, they aren't. Those implement the additional functionality necessary to do that for arbitrary *cycles* of calculations, not just one static loop unrolled into a fixed-size circuit.

>For sure, you need to go further in this direction to build a general purpose computer, but it is in this direction that you have to go.

No, the functionality implemented here cannot generalize to arbitrary computation until you implement other, orthogonal primitives.

A CPU is only capable of generating loops so long as one feeds it enough power. In essence it is creating a constant length loop which is bounded by how long the machine is turned on for.

These dominoes are distinct in that they cannot flip the state back and therefore cannot rerun the same sections, and need need more and more dominoes to do more computations, but fundamentally I dont see how that is any different than providing a longer and longer input of energy into a modern computer.

Can you clarify what "orthogonal primitives" are missing?

>Can you clarify what "orthogonal primitives" are missing?

Sure. From my earlier comment[1] distinguishing the core primitives -- labeled a) through d) -- necessary to call something a computer:

>>if you want to get the core, impressive functionality of the things-we-call-computers, you have to include a bunch of other, nontrivial, orthogonal functionality, like a) the ability read and execute a lot of such instructions, and b) to read/write from some persistent state (memory), and c) have that state reliably interact with external systems. Logic gates (d) are just one piece of that!

>These dominoes are distinct in that they cannot flip the state back and therefore cannot rerun the same sections, and need need more and more dominoes to do more computations, but fundamentally I dont see how that is any different than providing a longer and longer input of energy into a modern computer.

In addition to SonOfLilit's comment, a fundamental difference is that, for a modern computer, the provision of electricity is *specified as part of how the computer works*, while the domino "computer" did not specify the apparatus necessary to reset and execute the subsequent instructions (nor the mechanism whereby such subsequent instructions would be provided) -- the a) and possibly b) in my model above.

So yes, *if* they had presented a "domino computer" that included such functionality (and rounded out the a-d), I would indeed agree with calling that a computer!

Why does (the absence of) such apparatus matter? Well, the whole point of the project was to provide intuition behind how/why some physical mechanisms give rise to a "computer". Since people already understand how dominoes work, they will therefore understand how the computer built from them works! Except they don't, because, for it to be a computer, you'd have to add on something they *don't* have an intuition for (the resetters etc).

So yes, by all means, use this as an intuition pump for yet-another-way to physically implement a calculator. Just, not a computer, which is something else and a tad more mysterious.

> *while the domino "computer" did not specify the apparatus necessary to reset and execute the subsequent instructions*

I don't see why it would need to specify this. Anyone who has played with dominoes knows you can set them up again. Why would anyone waste time stating something so obvious?

Because they're claiming it's a computer, even though that term implies that it's a mechanism by which this all happens *automatically*.

We already have a term for the machine where you have to reset it yourself after every calculation: a calculator. Hence the original comment.

>automatically

>electricity

pick one.

This is generally where the pedant would derail the conversation into the usual Turing* Completeness* infinite tape semantics.

Ok, but do you get how there's something fundamentally different between repetition and unrolled repetition?

Yes and Im saying a CPU is unrolling a repetition. You put in a long linear stream of current.

At each step it creates an output, which can be repetitive, or not repetitive.

The generated sequence is still finite unless were talking about an infinite amount of power. If we allow an infinitely long domino then they are equivalent.

It's the fallacy of perpetual motion and conflation between a Turing machine that requires net external energy to operate and a passive Rube Goldberg machine.

While one can create combinational "logic" out of valves or dominos, it's impossible to create *sequential* logic out of passive physical objects.

Sequential logic takes the form of S-R latches like:

```
-+++++++++++===++++++-.
==::::::::::::::::::::=*-
.-==. .. ==::::::::::::::::::::::-*-.
.:-=. :#*++++++++++++++++++++++++++++++*=::::::::::::::::::::::::==.
.-++. ==:::::::::::::::::::::::::=+
==::::::::::::::::::::::::::*-
==::::::::::::::::::::::::::-*..::. ....
==:::::::::::::::::::::::::::*-+..==. .:. .:..= .=
==:::::::::::::::::::::::::::*==..-+-:::::-*+::::::::==..=-==
==:::::::::::::::::::::::::::#..--:. .=: ....
==::::::::::::::::::::::::::+= .=:
==:::::::::::::::::::::::::-*. .=:
.-+++++++++++++#=::::::::::::::::::::::::-+. .=:
.=- ==:::::::::::::::::::::::++. .=:
.=- ==::::::::::::::::::::-++. .+:
.=- -*++++++++++++++++**+-:. .:+*=:.
.=- ...-**-.
.=- .-=+=:.
.=- :=+=:..
.==... ...-+*-.
.:=+=-.. ..-=+=:.
..:=*+:. .:=*=:..
.-*+-.....-+*=..
.+#*#+:.
.=*=:.....:=*+:.
...:+*=. .=*+-...
..-=+=:. .:=+=-..
.==.. ..:=*=:.
.=- .=*+-...
.=- .:=+=-..
.=- ..:=*=:.
.=- =*===============++**=:.. ..=*+-.
.=- ==::::::::::::::::::::-++. .=:
.=- ==:::::::::::::::::::::::++. =:
.-+++++++++++++*=::::::::::::::::::::::::-+. =:
==:::::::::::::::::::::::::-*. =:
==::::::::::::::::::::::::::+= =:
==:::::::::::::::::::::::::::#..--:. =: .=++:
==:::::::::::::::::::::::::::*==..-+-------*+--------==..=.:=
==:::::::::::::::::::::::::::*-+:.==.....................+:=-
==::::::::::::::::::::::::::-*. ...
==::::::::::::::::::::::::::*-
.=++: ==:::::::::::::::::::::::::=+.
.==+: :##++++++++++++++++++++++++++++++#=::::::::::::::::::::::::==.
.:..-. . ==::::::::::::::::::::::-*-.
==::::::::::::::::::::+*:.
:*++++++++++++++++++=:.
```

hey now, computers are magic and you cant take that away from me with no amount of nand2tetris or turing lambada bullsheet

I've often felt that neither Church nor Turing really captured the essence of computation. All you need is a set of distinguishable states, and the ability for them to affect each other a la a nand gate. Neither binary nor electrons are particularly important to the idea. This is what's so great about these primitive machines is that they highlight the full generality of computation. I would like to see more non-binary systems though.

Turing machines are literally “a set of distinguishable states,” along with the tape, and the rules of the machine. There’s nothing about binary in the definition. Or electrons.

2-symbol machines happen to have the smallest possible useful alphabet. And, because of Turing completeness, you can always define a binary machine that emulates any other Turing machine.

The same thing happens with Church’s lambda calculus - there’s no binary, and no electricity required.

Computer Science doesn’t require a digital electronic computer; after all, neither Church nor Turing did, when they wrote their research.

Turing used a metaphor that was appropriate to his time: a tape, an alphabet, and a machine that reads (and writes to) the tape. It is a simplified expression of real machines - but it does not capture the essence of the connection between physics and computer science, because it does not stress the core features of what are required for computation physically, and only presents a simple isomorphism for reasoning about any given computational machinery.

Actually, it had been a while since I read "Computing Machinery and Intelligence" and he does, in fact, speak directly to these issues (distinguishability of states, support for N distinct states not just 2) in sections 3 and 5 [1]. And in fact he notes the arbitrariness of the "tape" formulation. I think my point remains, though, that "The Turing Machine" itself does NOT stress these points, picking only advantageously simple examples of distinguishable states, even if the paper does.

1 - https://redirect.cs.umbc.edu/courses/471/papers/turing.pdf

Comment was deleted :(

A set of distinguishable states IS binary.

You have something, and you have something else. Any more states can be broken down into binaries.

It makes sense after all. If you have anything less than a binary then everything is the same, and the notion of tranformstions or things happening over time make no sense.

It should be no surprise that binary/duality/positive negative/yin yang or whatever you call it is all over physics.

Crafted by Rajat

Source Code