1,688 karma · joined June 6, 2017
As you said though, sometimes you have to go the wrong way (knowingly or unknowingly) just to see what's there or if there aren't missed opportunities. Heavily established (sub-)fields can be very rigid and hard to find new ground in.
If you are daring, you can find my puny attempt here: https://github.com/libriscv/libriscv/blob/master/lib/librisc...
I did manage to improve it once I figured out some of the various modes of accessing memory, and I even managed to cut the jump table down from 64- to 32-bit which should help keep it in memory. I made the jump table part of .text in order to make it RIP-relative. For the fibonacci sequence program, not many bytecodes are needed. I would greatly appreciate some tips on what can be improved there.
Your situation is eerily similar to something in my past, and probably many others. I don't think it's a good idea to do things without formal agreements. Try to do it solo for as long as possible and hire the help you need.
Sometimes if you're lucky you'll meet incredible people who contribute in ways that is essentially innovating on their own, maybe even adding more legs to stand on. I think that's where it's natural for 50/50 partnership discussions to occur. How you can make an agreement if you don't know who you're partnering with? It generally takes some time to get to know someone.
Anyway, just my rambling.
It's very much still a work-in-progress. But it works!
The main plugin repo is here: https://github.com/varnish/libvmod-tinykvm
Agreed. That's a good way to sum it up.
But you can do whatever you want. For example in libriscv I override the global allocator in my guest programs to use a host-managed heap. That way heap usage has native performance in interpreter mode, while also allowing me full control of the heap from the outside. I wrote about this here: https://medium.com/@fwsgonzo/using-c-as-a-scripting-language...
I have experience with this from libriscv, where I also embed JIT run-times like v8 and LuaJIT already.
It runs on bare metal, though. I just thought it was very interesting to see. Must have been a lot of work.
register long a0 asm("a0") = arg0;
register long syscall_id asm("a7") = n;
asm volatile ("ecall" : "+r"(a0) : "r"(syscall_id));
return a0;
This is an example where a0 is an in/out integer. For memory, change long a0 to a pointer to some struct and add a "m" input or "+m" in/out. It's even easier in other languages like Rust and Zig.Among endless examples, here is a Trumper begging to be educated on why Trump said he is king: https://old.reddit.com/r/Conservative/comments/1itkmen/expla...
EDIT: Found the offending PR and made an issue