
D3.js visualization of a lambda calculus - miesman
http://chorasimilarity.github.io/chemlambda-gui/dynamic/bigpred.html#
======
kmonad
Is this supposed to be academic work? The documentation is pretty messy,
questions are unclear (the FAQ honestly does not look like anyone would ask
those questions frequently), and even though I spent a while I could not find
any explanation/justification what this is for, or why it is useful for what
it claims to be doing (first, the nodes are atoms, next - though same
algorithm - the nodes are microbes). Looks pretty, the meaning however is
currently elusive.

------
stared
It looks beautiful, but could anyone give me a plain word explanation how does
lambda calculus relate to moving dots?

The closest thing I can think about are L-systems, but I couldn't understand
even Fibonacci numbers ([http://chorasimilarity.github.io/chemlambda-
gui/dynamic/fibo...](http://chorasimilarity.github.io/chemlambda-
gui/dynamic/fibo.html)).

~~~
darby2000
I agree. This looks amazing. Absolutely gorgeous. This really was done with
just using JS? wow. But I have no idea what I just watched.

~~~
pjc50
It's quite cute, but I'm surprised that you're surprised that JS can do it -
it's only a few hundred moving objects, and JS has within-order-of-magnitude
of native performance.

For shinier stuff, see the demoscene eg
[https://www.youtube.com/user/Annikras](https://www.youtube.com/user/Annikras)
. Demoscene programmers love generative systems, especially when targetting
the 4 kilobyte executable category. For example this one, which looks like a
distorted Menger sponge:
[https://www.youtube.com/watch?v=E3qn1RsJlUM](https://www.youtube.com/watch?v=E3qn1RsJlUM)

------
sergiotapia
Warning: Causes Firefox latest on Mac to crash.

~~~
Excavator
Probably due to the horrible way animations are set up with setTimeout:

    
    
        var step = -1;
    
        function nextval() {
            step++;
            return 3000 + (20*step);
        }
        setTimeout(function() {
    
            graph.removeLink("31", "31_1");
            keepNodesOnTop();
    
        }, nextval());
    

There are 9687 setTimeout on that page.

------
manish_gill
Hmm. Requested an insecure script
'[http://d3js.org/d3.v3.min.js'](http://d3js.org/d3.v3.min.js'). This request
has been blocked; the content must be served over HTTPS.

:(

------
sago
Some context. Marius Buliga isn't a native English speaker (he's Romanian), so
parts of these pages may sound a little confusing. His academic papers are (I
find) more clearly written.

The 'lambda' being referenced is the 'graphical lambda calculus' which is
Marius's own invention of a family of graphs and graph rewrite rules that can
act as a notation for the untyped lambda calculus. Chemlambda is a chemically
themed specialisation of his graphical lambda calculus used as an artificial
chemistry.

Artificial chemistries, in turn, are used to understand properties of chemical
systems in the abstract, without the fiendish difficulties and complexities of
actual chemical soups. Much as artificial evolution can be used to understand
the dynamics of evolution without the long-time scales and messiness of actual
organisms. Stuart Kauffman used the same technique in the 70s, shuffling punch
card programs to show the presence of attractors in networks of chemical
interactions. This sheds light on behavior such as 'autocatalytic sets': sets
of chemicals that can catalyse their own production, which is a necessary
condition of life.

For artificial chemistries, it isn't always essential to say what each element
'corresponds to' in real world chemistry. Hence some of the ambiguity between
whether the nodes in the graph represent atoms, molecules, or in some cases
bonds.

Marius's artificial chemistry is turing complete in an interesting way: it
stores information in topology as well as linear sequences of discrete
elements (though it isn't the only 'graph computation' approach). This makes
it a good analog for biochemistry, which is also structural as well as linear.
He is using this system to look at models of decentralised chemical
computation.

As for many scientists who create a formalism, he is also evangelising it as a
useful tool for others to work with in looking at chemical computation in the
abstract. Take up is small so far, with only one other cited researcher to
date.

The animations are very stylised, they illustrate simple underlying processes
with a lots of visual action. The actual 'moves' are very discrete: they
happen at regular intervals and rewrite parts of the graph in one go. When
nodes in the graph are removed by a move, they float around in the animation
for a while then disappear. Similarly when new nodes are about to be rewritten
into the graph they appear and float around in the animation a little before
they'll be incorporated. When a move takes place the graph is simply connected
to new nodes, wherever they are on the canvas, and D3 is used to then relax
the graph. Hence the violent pulsing of the simulation as moves take place.

Hope that helps. It's not my area of research interest (though I worked with
Prof S. Kauffman in the late 90s), so feel free to correct my understanding if
I'm off.

~~~
chorasimilarity
Thank you sago, that's accurate. Technically, chemlambda rewrites together
with the reduction algorithm used in the script quiner.awk from the repository
describe an asynchronous graph rewrite automaton.

(An addition to sago's comment is that the rewrites are done randomly; there
is a cycle in the algorithm where rewrite patterns are identified, then coins
are flipped and as a result some of them are done. The chemical analogy is
that there are invisible "enzymes" which do the rewrites, and they roam around
randomly. Alternatively one can make another version of the algorithm, for
example one where these enzymes are produced and they choose randomly their
preferred patterns. This is a way to erase the visual impression that there
are global steps in time when the graph is updated.)

Graphic lambda calculus is the ancestor of chemlambda. Actually both
formalisms don't have a lot in common with lambda calculus, in the sense that
there is an algorithm to produce a graph from a term in untyped lambda beta
calculus, such that the lambda calculus rewrites correspond to moves in these
graphical formalism. But chemlambda works with a family of graphs which is
much larger than the ones which represent lambda terms.

However, you can see in the demos page some classical computation problems:
Ackermann function, factorial, predecessor. There are also some demos which
can't be qualified as related to lambda calculus.

Chemlambda resembles most with the ALCHEMY of Fontana and Buss, which is also
based on lambda calculus, with the main difference being that in ALCHEMY
application is a chemical reaction and abstraction is a reactive site (very
sketchy description), while in chemlambda the application and abstraction are,
on equal footing, just nodes in a graph.

------
chorasimilarity
This replication and composition of permutations - in the same time - uses
lambda calculus together for composition but otherwise the permutations and
replications are not lambda calculus like
[https://chorasimilarity.wordpress.com/2015/07/22/permutation...](https://chorasimilarity.wordpress.com/2015/07/22/permutation-
replication-composition-all-in-one/)

------
raverbashing
Just as a note, the site doesn't work when accessing it through https (like,
with https everywhere)

It's a nice concept

------
zitterbewegung
If anyone needs help running these scripts I can offer help to run these
scripts. You need awk (gawk).

------
Tycho
Is this got something to do with how DNA molecules were formed?

~~~
chorasimilarity
It's an artificial chemistry which is inspired, but can do other things as
well, from untyped lambda beta calculus. There are two projects related to it,
one in meatspace, other in virtual space. Project 1 says that if this
chemlambda can be done by real chemistry then it may help to build or
understand biochemistry. The article is
[http://chorasimilarity.github.io/chemlambda-
gui/dynamic/mole...](http://chorasimilarity.github.io/chemlambda-
gui/dynamic/molecular.html) Molecular computers (2015). Project 2 is about
decentralized computing, without any higher layer of control. Pretty, short
animations with some explanations in the
[https://plus.google.com/u/0/collection/UjgbX](https://plus.google.com/u/0/collection/UjgbX)
chemlambda collection. More meaty stuff in the
[http://chorasimilarity.github.io/chemlambda-
gui/index.html](http://chorasimilarity.github.io/chemlambda-gui/index.html) .
But you have to follow links to articles and read them :) Real stuff in the
github repo, see [https://github.com/chorasimilarity/chemlambda-gui/blob/gh-
pa...](https://github.com/chorasimilarity/chemlambda-gui/blob/gh-
pages/dynamic/README.md) . I'm a mathematician, not a programer, there has
been no release yet, every possibility is left open. Play with it folks! I
have not figured out why firefox is so lousy with some of these d3.js
animations, but you can make your own and fiddle with them. True is that some
of them have tens of thousands of nodes which appear/dissapear (several
hundreds at a time). Safari works well, chromium decently.

