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!

How time flows: Gutenberg time vs Internet time

Based on  a HN comment, I made a page which proposes the hypothesis:

(Δ t-historic) = (Δ t-today)^(log 5/ log 2)


where the Δ t-historic is the time in decades from the invention of the printing press and Δ t-today is the time in decades from the opening of the ARPANET.

A collection of interesting correspondences is given, as well as some predictions, if this hypothesis is to be taken seriously.

The page has a small JS script for a calculator t-historic to t-today, so you can easily find new correspondences if you like the game. Please let me know in case.

UPDATE: There is now a very amusing python3 script by 4lhc, at this gist. It lets you write a year, recent or old, then it proposes two events, one from the old time and one from recent time. I played with it on my computer and it’s just cute!

[I had to install the wikipedia module and then the correct command is


wait a short moment and get the pair of events!]



computing with space | open notebook

%d bloggers like this: