3 ms·
Ok, I think we're past the misunderstanding now. I don't understand why this makes it hard to compile Bel. Application code won't check the first two elements
by akkartik 2y ago
Ok, I think we're past the misunderstanding now.
I don't understand why this makes it hard to compile Bel. Application code won't check the first two elements of the list to determine if a term is a function. Instead it will say ((isa 'function) ___). It seems fine that a program using the former approach will run slower.
- lisper 2y ago> I don't understand why this makes it hard to compile Bel. Because Bel is supposed to be a specification, not an implementation. And if you specify that functions are lists then you are no longer free to implement them in a way that does not preserve the illusion that they are lists. Worse, in Bel, lists are mutable. That makes reasoning about programs nearly impossible. Every time you call CONS (which in Bel is spelled JOIN for some reason) you may or may not be producing a function. Every time you mutate a pair you may or may not be creating a function, or destroying one, or changing a function's environment. There is not and cannot be any barrier between the mutable and the immutable in Bel. It is not possible to add a data type that guarantees invariants. Mutable pairs are all you have to build with, and so whatever you build, not matter how carefully you design it, the rug can get pulled out from under you at any time by an errant call to XAR or XDR.
- akkartik 2y agoGeneralizing from the representation of functions to the absence of invariants makes your point crystal clear, thanks.