From my cursory glance, the real magic (InvisiCaps) appears to be a unique take on fat pointers to track types, access rights, etc. Pretty clever, and the website is a great technical read.
Can’t link Fil-C code to regular C code
And rust uses regular C ABI
You could make it work, if you teach Rust and Fil-C about each other. Nobody has done that (to my knowledge)
Do I understand correctly that this project is based on the work of just one person, Filip Pizlo? If so, that's amazing.
https://zef-lang.dev/implementation
https://news.ycombinator.com/item?id=47843194
It has list of more than 20 optimizations for interpreters, with measured speedups. I'm pretty sure I was looking for something like this 3-5 years ago, but it didn't exist
Does this just mean you reserve a register for the current thread? In which case you could explain it as a reserved register (like FS used for TLS). Describing it as "passes around as the first argument in all calls" makes it sound inefficient–but whether it actually is depends on how you implement it.
There’s a speedup to be had by either reserving a GPR or using one of the segment registers
Lots of obvious stuff like this hasn’t been done yet! If you want to have the satisfaction of landing speedups then Fil-C is a fun thing you could contribute to :-)
Seems like C technically requires function declarations for every possible signature. That quickly explodes into hundreds or thousands of function declarations in the header and switch statement.
Edit: clarification
C's type checker never sees the interpreted language's functions.
It’s a super hard problem! I don’t have a good answer, but I also can’t prove that it’s impossible