r/lisp • u/tearflake • 23h ago
Symp: a symbolic processing virtual machine
I've been working on a symbolic processing virtual machine based on S-expressions. Programming instructions resemble a kind of assembly, and the code and data are spanned over a hosting virtual filesystem.
Metaprogramming and basic virtual filesystem operations are at the heart of the system, so it can be suitable to embed arbitrary higher level programming systems, preferably S-expressions based ones.
Since symp practices some properties of the Lisp systems (although approaches the programming problems from a slightly different side), I thought this subreddit might be a suitable place to share this work.
The main intention of symp is to support my symbolic AI experiments, but I reckon I'll find it a use in business programming (at least for some of my own projects).
For now, it can be used in a browser and in Node.js through exposed API.
Resources:
1
u/arthurno1 22h ago
Cool.
I'll find it a use in business programming (at least for some of my own projects).
Can't you see if you can make a virtual machine for font hinting?
That is the virtually only piece left until we have a full font loading engine in pure Lisp. I have implemented OpenType loading and am finishing support for compressed fonts (woff1 and woff2) with decoders in Lisp (Brotli and libz). Will upload soon those. Virtual machine for hinting is the last big piece left. Two known open source projects one can look at for examples are Skrifa and Freetype. There you would have a real-world use for your virtual machine.
My only requirement would be: test and benchmark guided development, so you don't end up with unsupervised horror like this and not hiding behind anonymity (you have to stand for your contribution, so I am not accused of stealing someone's code).
An interpreter would be fine, a degradaiton in performance ~10%~30% compared to Rust/C is fine. Excellence would be if you jit-compile hints to machine code via SBCL and cache results.
1
u/dzecniv 20h ago
2
u/arthurno1 14h ago
No I haven't, I saw it now when you linked, but that's not something I want to use; it is CFFI. I can write sb-alien binding in few lines of code; I use sb-alien to compare to libbrotli in benchmark :)
Mine is pure lisp, and I get 0.9 ~ 1.1 speed compared to libbrotli. Unfortunately it is SBCL that is a bit in the way for those last 0.1 :).
1
u/cosmic-cosmonaut 22h ago
This looks neat. I need help understanding what this is. What do you mean a virtual machine based on s-expressions? What is this precisely?
I run a lot of virtual machines using all of the standard things like Qemu and so forth. I understand how to build a homebrew cpu using only logic chips and how to bootstrap that into a primitive os of some sort. I understand what a hypervisor and unikernels are and how to deploy them, and so on.
I can't wrap my mind around what this is. If it is a virtual machine ... what is it precisely. Is this an attempt to use virtual machine encapsulation to effectively create a "lisp kernel" which in your case you call a system? This would imply some sort of Symbolics like environment where the concept of a "kernel" as we have it in the c world doesn't really map but you would be able to program for it using s-expressions and bypassing all the infix branch of things?
Did I get any of that correct?