Live data from Hacker News

Building a Minimalistic Virtual Machine

pointersgonewild.com

61–70 of 72 posts

Re: Building a Minimalistic Virtual Machine

#61

Earlier quoted context omitted.

You mention parallel computation and being open for discussion. My favourite area of computing is parallel computing and multithreading. My toy multithreaded interpreter in Java can communicate integers between threads with message passing. I never got around to communicating complicated objects because I'm not sure how to solve the garbage collection problem with compound data structures/object graphs AND sending ob…

I was thinking something like actors, or independent processes sending messages would be nice. Just because it's very safe and predictable. Less error-prone than threads. The thing that kind of gets me is it seems difficult to have safe shared memory with actors? You ideally want to be able to share memory if you want things to be efficient, but if you have shared memory, then you get into issues with atomic writes a…

I assume you would be communicating pointers with actor mailboxes, so the only copy is a pointer. I believe Erlang copies data itself into other actor's heaps, that simplifies garbage collection since GC can be done per process and there is only one owning reference to a processes' data.

You might find Pony's ORCA interesting which is how they implement garbage collection between actors.

https://www.imperial.ac.uk/media/imperial-college/faculty-of...

Post reply on HN