Building an Emacs Lisp VM in Rust
coredumped.dev
coredumped.dev
enum Value {
Unit,
False,
True,
Integer(isize),
Float(FloatSize),
String(Rc<str>),
Closure(Rc<Closure>),
Tuple(Rc<[Value]>),
}
Unfortunately since I'm depending on reference-counting, it can't implement `Copy` which I suspect is where I'm currently losing significant performance. For values embedded in bytecode instructions I can cheat and copy anyway since only the non-refcounted ones are allowed in them.[0] https://github.com/python/cpython/blob/main/Include/object.h...
I struggle a lot early on my lang with this (also: Wanna have 2d vectors) and eventually get a enum alike yours (but the Rc<str>, Rc<Closure>, Rc<[Value]> intrigue me!).
Do you have a link to your hobby interpreter? I would love to take a look at it.
Why not make it two pass? We are not reading source from cards anymore.
Doesn't sound like the author is super-experienced with this whole interpreter thing, thought might not have crossed their mind.