Summary

Topics: Still alive and I/O schedulers and instructions

No technical information in this post. It's mostly an update on the general state of things in the Viua VM-land.


Still alive

Viua VM is not dead. The rumours about its demise were greatly exaggerated. In fact, it is the best shape it ever was and has seen usage in almost-real-world projects (I was dogfooding during my engineer's degree final project).

However, the development substantially slowed down in recent times. There's no denying that the amount of code I put out there is in no way comparable to what it used to be. This is particularly due to the amount of work I had to do in the academia (a degree does not earn itself) and industry (the bills do not want to pay themselves). This are just lazy excuses, though.

Hopefully, the pace of progress should now pick up a little as I have a bit more free time on my hands. If it doesn't - too bad, but the VM is definitely not dead.

I/O schedulers and instructions

One of the most recent additions were I/O schedulers and I/O instructions. In theory, they should take some load off of FFI schedulers which were until now used to execute both CPU-related and I/O-related calls.

I/O is based on ports, requests, and interactions. First you open an I/O port (it can represent a file, a socket, a pipe, etc.). Then, you use this port to submit I/O requests to the kernel and then to I/O schedulers. User code sees the I/O operation to perform as an "I/O request" value, the kernel sees it as an "I/O interaction" to perform - they are both linked together by an ID assigned to every I/O interaction.

While an I/O scheduler goes about executing an I/O interaction the user code may wait for an I/O request to become complete (either successfully or with an error) or cancel it. I/O is performed asynchronously (after an I/O interaction is submitted the user code just receives a handle, in the form of an I/O request value) and the user code is not blocked. It must explicitly block on an I/O request by using the io_wait instruction. Alternatively, if the request does not complete for too long it may be cancelled using the io_cancel instruction.