Term re-writing systems are a really interesting way of looking at computation.
It completely abstracts away the concept of a machine, and it's simply translation as computation - but equally as powerful.
This is very cool! I'm actually working on something very similiar, as I wanted a scripting language with very robust pattern matching and macro-like capabilities with term rewriting for writing DSLs. Seeing this project is very inspiring, nad it seems we have very similiar ideas, my original idea was also that undefined terms would just be the way to construct data types. However, I want the lazyness to be optional in my language, and for completely undefined terms to throw errors as I think the ergonomics of just treating undefined terms as valid data would be a bad programming experience. In my (upcoming language, hopefully), data would be constructed like this:
pair a b = '(pair a b)
where ' is shorthand for quoting, like in lisp. If you want to explicitly define datatypes on demand, you can just manually quote and not use the pair function constructor. One thing I thought about to was smart constructors, like say if you want to define the mod 3 group: zero = 'zero
s (s (s x))) = x
s x = '(s x)
if values are always constructed with either "s" or "zero", the smart constructor of s enforces you can't create any terms with an s-chain of 3 or higher, IF the function arguments are eagerly evaluated.This is vastly more pattern matching than term rewriting. In a term rewriting system you have no types for a start: https://en.wikipedia.org/wiki/Rewriting
Marty Alain's Lambdaway is another term-rewriting evaluator, of sorts.
I'm really annoyed when lisp languages use infix operators. Is it really so hard to write (= (f a) b) over (f a = b)? In fact, can you even call it lisp if the first element of the list isn't the operation of that list? Perhaps if they had a special bracket type for definitions I would be more amenable to it, but the idea that a symbol half way through a list completely changes its meaning simply doesn't sit right with me. Isn't this just a term rewriting system with an extra pair of parentheses?
Also, why is this needed over the second line?