
“Maxwell's equations of software” examined (2008) - lelf
http://www.righto.com/2008/07/maxwells-equations-of-software-examined.html
======
tromp
In my opinion, "Maxwell's equations of software" ought to be based on the
simplest possible computational framework, which one could argue is the lambda
calculus.

A meta circular interpreter working on a simple binary encoding of lambda
calculus (where abstraction is 00, application is 01, and a variable is
1^{n}0) is only 206 bits long [1][2], over 20 times smaller than the article's
equations.

[1] [https://tromp.github.io/cl/cl.html](https://tromp.github.io/cl/cl.html)

[2] [https://tromp.github.io/cl/LC.pdf](https://tromp.github.io/cl/LC.pdf)

~~~
esmi
How about a 2 state 3 symbol Turing machine? That’s pretty simple, and
universal too.

[https://en.m.wikipedia.org/wiki/Wolfram%27s_2-state_3-symbol...](https://en.m.wikipedia.org/wiki/Wolfram%27s_2-state_3-symbol_Turing_machine)

~~~
tromp
It's not directly comparable, since this Turing Machine is not a self-
interpreter in the sense of interpreting arbitrary programs in a language of
Turing Machines.

~~~
esmi
First off, I admit I didn’t do my homework so I have no idea what I’m talking
about, but couldn’t the Turing machine make a Turing machine interpreter and
therefore be a self interpreter? It is universal, no?

~~~
tromp
There's different notions of universality.

In the more abstract one, you can emulate arbitrary computation by preparing
the system (in case of the 2 state 3 symbol TM, its tape) in an appropriate
configuration, letting it run until some the configuration satisfies some
condition, and then extracting the result from the final configuration.

In a more concrete one, you have a language of programs, and a universal
program takes a program description as input, and interprets it. I give a
slightly more formal definition of such a notion of universality, as
applicable to Algorithmic Information Theory, in [1].

[1]
[https://tromp.github.io/cl/Binary_lambda_calculus.html#Unive...](https://tromp.github.io/cl/Binary_lambda_calculus.html#Universality)

------
neutronicus
As someone who spent years studying Computational Plasma Physics, it feels
strange to see someone cite "Maxwell's Equations" as some sort of platonic
form of simplicity

~~~
adameast1978
I have never understood the need in the Computer field or other fields for
that matter to make unnecessary and incorrect analogies to physics. It is
silly and I have to look past this as many things have worth where the author
does this as some sort of way to make what they did seem more impressive
rather than just advance something on its own merits.

~~~
Koshkin
I guess there's something to be gained by doing that. (By contrast,
electrodynamics wouldn't gain anything by calling Maxwell's equations "the
lambda calculus of physics.")

~~~
adameast1978
I would say that we as CS people could learn from physics but when name things
God Particle... Arguably to grab headlines I wonder about the Physics world...
Then again I guess things like funding and getting people interested are
important.

~~~
Koshkin
As Lederman explains, "This boson is so central to the state of physics today,
so crucial to our final understanding of the structure of matter, yet so
elusive, that I have given it a nickname: the God Particle. Why God Particle?
Two reasons. One, the publisher wouldn't let us call it the Goddamn Particle,
though that might be a more appropriate title, given its villainous nature and
the expense it is causing. And two, there is a connection, of sorts, to
another book, a much older one..."

~~~
adameast1978
Haven't read Lederman's book but sounds interesting. If he is referencing the
Bible that makes me not like the name even more however names really are
pretty trivial and aren't the real science so I guess it doesn't even matter.
It is just my opinion doesn't really mean much in the grand scheme of things,
both my opinion and what he names the Higgs-Boson.

------
z29LiTp5qUC30n
I think current bootstrapping work clearly shows that the Maxwell equations of
software are:

    
    
       pop rx -> sp--; rx := mem[sp]
       push rx -> mem[sp] := rx; sp++
       sub rx ry -> rx := rx - ry
       jmp rx $I -> if rx is zero jump $I bytes from end of instruction.
    

One might also argue:

    
    
       call rx -> mem[sp] := IP; sp++; IP := rx
       ret -> sp--; IP := mem[sp]
       nand rx ry -> rx := rx nand ry
    

but those are just optimizations

~~~
andrewflnr
Exactly what bootstrapping work? Looks interesting (and like Forth, but that's
no surprise).

------
ncmncm
There is really nothing to it. A Lisp interpreter runtime can be made to
interpret a subset of Lisp.

It is very much more impressive that you can make a whole computer out of
nothing but NAND or NOR gates, but still the same sort of thing.

~~~
jmiskovic
Depends very much on gates. They would have to be idealized, with constant
non-zero input-to-output propagation time. Best approach is then to simulate
them, perhaps in Lisp.

~~~
gradschool
I'm guessing that's because you envision using some of those gates to fake a
clock. Wouldn't you also have to make some assumptions about wire propagation
delays to guarantee hazard-free operation?

~~~
jmiskovic
Any wire propagation would work, zero or positive, as long as it is
deterministic (it can all be compensated by extra NAND/NOR gates). And with
negative propagation delays you could do wonders! Anyway, my comment was a
quick jab to circle back to Lisp after parent dismissed its elegant core.

------
amelius
Maxwell's equations are linear (solutions are superimposable etc.)

I think if you'd call something "Maxwell's equations of software", a similar
property should hold, somehow ...

~~~
evanb
Only if you take U(1) as your gauge group. If you pick a non-abelian group the
equations are not linear and solutions are not superposable.

~~~
mrfox321
Maxwell's equations _are_ linear. The nonlinearity of quantum field theory is
not relevant here.

~~~
evanb
I was trying to convey that "Maxwell's equations" can name not just the
equations that describe electromagnetism, which has a U(1) gauge group, but
can name an entire category of gauge theory equations---one for each gauge
group. If the gauge group isn't abelian Maxwell's equations are _not_ linear.

~~~
a1369209993
Can you give a example of a set of gauge theory equations for a non-U(1) gauge
group? This seems interesting but I'm not really sure what it would actually
look like.

~~~
evanb
QCD is a nonabelian gauge theory, for example. The generalized Maxwell action
is called the Yang-Mills action. The corresponding equations are very similar,
except the gauge-covariant derivatives do not take a particularly simple form
(which they do in the U(1) case because U(1) is abelian).

[https://physicstravelguide.com/equations/yang_mills_equation...](https://physicstravelguide.com/equations/yang_mills_equations#tab__why_is_it_interesting)

------
bsaul
side question : i remember a course in my logic class where our teacher showed
us a programming language made of only two letters, and where all operations,
numbers, etc were all defined with just those two letters. It was created by
some famous logician but i can't find anything on the web about it.

Anyone here knows what that could be ?

edit : i think the lesson was showing curry's work on combinator logic..

~~~
andrelaszlo
'0' and '1'? Sorry :P

~~~
a1369209993
You can technically do it with only one character (via Godel numbering and
unary), but it gets annoying fast for obvious reasons.

