All posts by chorasimilarity

can do anything

Play with quines in the chemlambda editor

ishanpm made a wonderful chemlambda editor prototype and I enjoyed playing with the 9_quine. It looks like this (screencast, real speed)



You can do the same, or other stuff! You need a mol file to input, for example I took the mol file of the 9_quine from here.  You can pick from lots of them (not guaranteed all of them work yet in the editor, especially those with “bb” in the name), from the chemlambda collection of molecules.

Is much much better than the animation made by hand


I look forward for a convergence with hapax, it would be nice to make a gamelike “feed the quine” where you have the “tokens” which make the reactions happen and you feed them with the mouse to the quine, etc.

Chemlambda and hapax

I wrote an expository text about chemlambda and hapax (and interaction combinators). You can see clearly there how hapax works differently and, as well, clear exposition of several conventions used, about the type of graphs and the differences in the treatment of rewrites.

Chemlambda and hapax

Please let me know if you have any comments.

What is the purpose of the project Hapax?

“hapax” means “only once” in ancient Greek. You may have seen it in the form hapax legomenon, quote: ” a word that occurs only once within a context, either in the written record of an entire language, in the works of an author, or in a single text”.

After a bit of research I found the correct, I hope, form that I  use for this project:


It reads “hapax cheon” and it means, again in ancient Greek, “poured only once”.

Why this? Because, according to this wiki link, “the Greek word χυμεία khumeia originally meant “pouring together””.

The motivation of the project hapax comes from the realization that we only explored a tiny drop in the sea of possibilities. As an example, just look at lambda calculus, one of the two pillars of computation. Historically there are many reasons to consider lambda calculus something made in heaven, or a platonic ideal.

But there are 14400 = 5! X 5! alternatives to the iconic beta rewrite only. Is the original beta special or not?

By analogy with the world of CA, about a third of cellular automata are Turing universal. My gues is that a significant fraction of the alternatives to the beta rewrite are as useful as the original beta.

When we look at lambda calculus from this point of view, we discover that all the possible alternatives, not only of beta, but of the whore graph rewriting formalism, say in the form of chemlambda, all these alternative count a huge number, liek 10^30 in the most conservative estimates.

Same for interaction combinators. Same for knot theory. Same for differential calculus (here I use em).

I started to collect small graph rewrite systems which can be described with the same formalism.

The formalism is based on a formulation which uses exclusively permutations (for the “chemistry”  and Hamiltonian mechanics side) and a principle of dissipation which accounts for the probabilistic side.

The goal of the project hapax is to build custom worlds (physics and chemistry)

“poured only once”

which can be used to do universal computation in a truly private way. Because once the rules of computation are private,  this leads to the fact that the who;le process of computation becomes incomprehensible.

Or is it so? Maybe yes, maybe not. How can we know, without trying?

That is why I starded to make the hapax stuff.

For the moment is not much, only demos like this one, but the rest will pass from paper to programs, then we’ll play.


Project Hapax needs your help

UPDATE (16.06.2019): Check out the original
is more fun. Faster! animations coming but now you can see what it means.
UPDATE (15.06.2019): I made a github repository. Compared with the page available at my home page, I corrected some bugs, two subtle errors and sped the thing a little.
While at homepage you can play with ackermann_2_2 (which does not end well because subtle errors in the algorithm, will update tomorrow that page), at
you can play with the 9quine. See how much it lives!
I’m working on a project called “hapax cheon” (means “poured only once in Ancient Greek) and I tried for this javascript and used chemlambda as an example.

It is incredibly slow, at least compared with the original chemlambda version. I tried it with ackermann(2,2), used many times before related to chemlambda. Here is it:

and the fun thing is to read the annotated js sources which are used in that page.
Why is so slow?
  • I am a js noob and I made some time consuming mistakes, I hope so!
  • or the program, which is written this time for humans, it spends the most time to give meaning to stuff, which is of course time consuming,
  • or js is not good for this and I should pass to something else, like C.
Which is which? I want to do lots of stuff with this basis. There are even tokens there 🙂
I don’t know which is which but the js sources are annotated aplenty and mathematically the formalism is fun.
If you know your javascript then please show me!
Some more context:
  • the project asks how can we anchor a cost to a computation?
  • also, there is nothing special to the models of computation we have. Probably we just fond a drop in the ocean of possibilities. See the 14400 alternatives to the beta rewrite.
  • which hopefully brings the desire to have your own, private, “poured only once”, model of computation, incomprehensible to anybody else.
  • if you don’t think that there are as many other models of computation, I can prove you wrong by showing several other alternatives, which you know (or specialist know) as calculus, or knot theory 🙂

But for this, and also for other reasons (like if I want to paint a canvas 5 times/second to show you the molecules and (reasonable) physics in action), I have to know if I can do it as fast as I did it with not for humans scripts in awk used previously.

Not to talk about gamifying all this stuff, which is certainly possible if this first step is sufficiently fast.

And finally, I ask: why does a browser have a 1GB footprint if I can’t do fast things like this? Is like I am in a kitchen, preparing some fancy food, and over my shoulder there is always a policeman which asks me: “is this a crumb of bread? let me put it in the heap of bread crumbs. Is this a piece of a potato, let me put it in the heap of potato pieces”. Why, policeman? Who gives a shit? I certainly know what to keep and what to throw away! “Is for your help”, says the policeman. Well, FY, if so, give me back the GOTO and give me a  break.

But probably I am a js noob. Hope so. Prove me so.

Hapax chemlambda

Chemistry is a game with a pair of dices.

You roll two dices and act. The dices are permutohedra.

Which leads to ask what certain chemistries (artificial or real) have so special. The conjecture is that (probabilistically speaking) a sizeable proportion of them are special.

For example, we can evade the lambda calculus by choosing one of the  14400 rewrites for ( β with random right patterns) .

Hapax chemlambda!