JoyTrain is a pseudorandom algebraic multiquine relay written in a subset of Joy programming language by Manfred von Thun. It works by specializing a probabilistic pattern matcher with a non-confluent TRS and applying the residual program to itself. All ad-hoc specialization and interpretation is done in Chez Scheme.
chezscheme --script joy.scm joytrain.joy > 1.joy
chezscheme --script joy.scm 1.joy > 2.joy
chezscheme --script joy.scm 2.joy > 3.joy
...
chezscheme --script src/joytrain.scm > joytrain.joy
- All recursion is eliminated by the fixpoint combinator.
- Quotations
[...]
are treated as extensional, so no axioms violating extensionality are used. - Strings
"..."
are intensional. They are used with theintern
combinator as patterns to avoid their further overwriting. - No type checking is implemented, so no axioms like
id == swap swap
are used. - Strategy is the dumbest possible:
- randomly apply axioms N times
- normalize
- randomly apply axioms once
- Doesn't work with the original Joy interpreter because it crashes with segfault for some reason.