summaryrefslogtreecommitdiff
path: root/notes/260522-interpreter.md
diff options
context:
space:
mode:
authorTaylan Kammer <taylan.kammer@gmail.com>2026-11-14 16:48:21 +0100
committerTaylan Kammer <taylan.kammer@gmail.com>2026-11-14 16:48:21 +0100
commitf4d2fa3fb2f41a0231040f7e005c4bd467855620 (patch)
tree0aa6d59bd467ed0bac1b3aae8d4ad6f02298cb8f /notes/260522-interpreter.md
parentee7a205bd8235255b652038bfef779744f3d93f5 (diff)
s/zisp/xisp/g on notes
Diffstat (limited to 'notes/260522-interpreter.md')
-rw-r--r--notes/260522-interpreter.md70
1 files changed, 35 insertions, 35 deletions
diff --git a/notes/260522-interpreter.md b/notes/260522-interpreter.md
index cf87180..6beac10 100644
--- a/notes/260522-interpreter.md
+++ b/notes/260522-interpreter.md
@@ -3,16 +3,16 @@
_2026 May_
Last December, I wrote the following in the context of how one might
-[bootstrap](250329-boot.html) Zisp even if it uses a self-hosting
+[bootstrap](250329-boot.html) Xisp even if it uses a self-hosting
compiler:
-* There will be a Zisp interpreter written in Zig, which is fairly
+* There will be a Xisp interpreter written in Zig, which is fairly
simple and naive in its implementation and, for example, ignores
- static type declarations. It should support the full Zisp language
+ static type declarations. It should support the full Xisp language
including hygienic macros, but be as easy as possible to maintain.
-* The Zisp compiler will be written in Zisp. The interpreter can run
- the compiler (since it can run any Zisp program) and will be used to
+* The Xisp compiler will be written in Xisp. The interpreter can run
+ the compiler (since it can run any Xisp program) and will be used to
compile the compiler.
After some pondering on a variety of topics, I've decided to stick
@@ -20,7 +20,7 @@ with this, just with one significant added insight:
The interpreter will not be some bootstrapping hack and then put in
the dustbin until someone needs to bootstrap from scratch again.
-Rather, the interpreter will be a first-class citizen of the Zisp
+Rather, the interpreter will be a first-class citizen of the Xisp
implementation.
This is because a simple interpreter without any compilation overhead
@@ -34,23 +34,23 @@ one might otherwise write in GNU Bash or the like (which is also quite
slow) except GNU Bash doesn't even have proper data structures, so it
becomes a terrible choice very quickly. The next consideration after
Bash would typically be a language like Python, and although even the
-CPython interpreter might beat the naive Zisp interpreter (because the
+CPython interpreter might beat the naive Xisp interpreter (because the
former at least uses bytecode and had a ton of engineering poured into
it) this shouldn't really matter, since the kind of tiny application
we're talking about typically wouldn't involve heavy computation.
-(Besides, a Zisp script could choose to compile parts of itself; more
+(Besides, a Xisp script could choose to compile parts of itself; more
on this later.)
Another example are build scripts. One of the first ideas I had when
-pondering on Zisp's design is how [compilation](250210-compile.html)
+pondering on Xisp's design is how [compilation](250210-compile.html)
should automatically evaluate the top-level of a program, simply
because this feels most natural to me. Furthermore, I've pondered
about how it should be possible to [serialize](250210-serialize.html)
everything in the language, so compiling a program would be a matter
of calling something like `(write main)` after the main function is
defined. Both of these fit naturally with the idea that a build
-script for a Zisp program would essentially just be a Zisp script
+script for a Xisp program would essentially just be a Xisp script
which imports all the files in the codebase, compiles everything, and
writes out the result. Such a build script would be interpreted, with
the compiler being a shared library it loads.
@@ -119,11 +119,11 @@ like Varnish, it ends up being somewhat limited. Varnish does make
that jump and implements a whole DSL for per-request decisions, which
is transpiled to C, compiled into a dynamic lib and loaded.
-Imagine Nginx was written in Zisp, and distributed in source format.
+Imagine Nginx was written in Xisp, and distributed in source format.
You could have arbitrary code in your configuration, for per-request
decisions, which would be compiled into native code and potentially
inlined straight into Nginx's request handler. Imagine Varnish was
-written in Zisp. It wouldn't need to invent a whole new language!
+written in Xisp. It wouldn't need to invent a whole new language!
(I just realized Varnish has been renamed to Vinyl Cache, but I
suspect most people still know it as Varnish, like me just now.)
@@ -169,9 +169,9 @@ Another reason, probably, is that many high-level languages are very
dynamic and lack a serious static type system that would be needed to
generate peak performance AOT compiled code.
-Zisp is all about breaking norms, and giving the programmer maximum
+Xisp is all about breaking norms, and giving the programmer maximum
freedom. The interpreter might one day incorporate some lightweight
-JIT, but my aim is to ensure that a Zisp programmer always has the
+JIT, but my aim is to ensure that a Xisp programmer always has the
ability to generate peak-performance native compiled binaries, through
a combination of features such as: An optional but serious static type
system, the ability to completely take control over memory management
@@ -189,27 +189,27 @@ day now.
Just to recap, here's the plan so far:
1. A code base in a low level language (probably Zig but not married
- to it) implements the Zisp core, meaning interpreter, basic data
+ to it) implements the Xisp core, meaning interpreter, basic data
types, and a slim standard library. Comparable to R7RS-small in
complexity, give or take. The interpreter accepts but ignores
advanced code constructs intended to help the compiler, such as
declarations and directives related to static typing and explicit
object lifetime management. (Simple bindings to libgccjit are
exposed; libgccjit.so is an optional run-time dependency.) This
- yields libzisp.so and the zisp executable, which are like liblua
+ yields libxisp.so and the xisp executable, which are like liblua
and the lua executable. You *can* use just this if you need a
- minimal Zisp interpreter with a barebones stdlib; OS package
- repositories could deploy these in a "zisp-core" package.
+ minimal Xisp interpreter with a barebones stdlib; OS package
+ repositories could deploy these in a "xisp-core" package.
-2. Richer standard library routines are written in Zisp, but the
+2. Richer standard library routines are written in Xisp, but the
sources are meant to stay in the source code repo; wait for it.
3. An advanced compiler, which actually understands the constructs
- mentioned in point 1, is written in Zisp. The compiler infers
+ mentioned in point 1, is written in Xisp. The compiler infers
static types where possible, and applies strategies to decrease GC
pressure, such as escape analysis, even if compiled code offers no
helpful declarations at all. But with full static typing and
- manual memory management, Zisp can practically be used as if it's
+ manual memory management, Xisp can practically be used as if it's
yet another low-level language front-end for GCC; it's up to the
programmer how much effort they want to put into improving the
performance of their code. The compiler implementation may use
@@ -217,10 +217,10 @@ Just to recap, here's the plan so far:
yet compiled, mind you.
4. The interpreter runs the compiler to compile the compiler; this
- yields libzispcomp.so which Zisp can load dynamically so when
- deploying Zisp you don't need to compile the compiler on every
- end-user machine. (Zisp can load any .so dynamically really.)
- Standard library routines written in Zisp are imported directly
+ yields libxispcomp.so which Xisp can load dynamically so when
+ deploying Xisp you don't need to compile the compiler on every
+ end-user machine. (Xisp can load any .so dynamically really.)
+ Standard library routines written in Xisp are imported directly
from within the source code repo at this point, and are merely
interpreted, since the compiler itself wasn't ready yet.
(Actually, you could run the compiler with the interpreter to
@@ -228,20 +228,20 @@ Just to recap, here's the plan so far:
compiling the compiler. But this would probably be slower.)
5. The richer standard library routines are finally compiled, giving
- us libzisputil.so, which contains goodies that interpreted Zisp
- code can also load and use, so Zisp scripts aren't limited to the
+ us libxisputil.so, which contains goodies that interpreted Xisp
+ code can also load and use, so Xisp scripts aren't limited to the
barebones stdlib anymore.
-In OS package repositories, you'd have zisp-core which only contains
-libzisp.so and the zisp executable, and then you'd have the standard
-zisp package which also pulls in libzispcomp and libzisputil as two
+In OS package repositories, you'd have xisp-core which only contains
+libxisp.so and the xisp executable, and then you'd have the standard
+xisp package which also pulls in libxispcomp and libxisputil as two
additional packages.
-Actually, libzispcomp itself would probably depend on libzisputil
+Actually, libxispcomp itself would probably depend on libxisputil
anyway, but if you're an absolute nerd you *could* manually install
-only zisp-core and libzisputil, giving you an interpreter and rich
+only xisp-core and libxisputil, giving you an interpreter and rich
standard library, without a compiler. This would allow you to omit
-libgccjit as well, which could be useful if you want to use the Zisp
+libgccjit as well, which could be useful if you want to use the Xisp
interpreter for simple scripts on some minimal systems.
## Closing up
@@ -250,12 +250,12 @@ Funny, I had totally forgotten about this note:
- [Using libgccjit?](250920-libgccjit.html)
-Yes, I will most definitely be using libgccjit. If Zisp is to be a
+Yes, I will most definitely be using libgccjit. If Xisp is to be a
true [full-stack language](260102-full-stack.html) then it must be
able to produce code rivaling C in efficiency, and that requires
either GCC or LLVM.
Some of the other considerations in the above linked note, like the
-"ZispScript" idea, are obsolete. Unless I've totally goofed up and
+"XispScript" idea, are obsolete. Unless I've totally goofed up and
planned some illogical nonsense above, I'll be going with what I've
written here, not in the previous note.