The core concept of Jaculus-machine is a Machine type. A Machine is parametrized by MFeatures
added to the Machine using stack inheritance. At the bottom of the stack, there is always
jac::MachineBase which provides the most basic functionality.
For example, a Machine with some built-in MFeatures can be created like this:
using Machine = jac::ComposeMachine<
To further extend the functionality of the Machine, we can use Plugins. Plugins are added to the runtime dynamically after the runtime initialization.
After the Machine type is defined, we can instantiate it:
Then we can configure the Machine - we can, for example, set the output streams of the stdio MFeature:
At this point, we can add any Plugins to the Machine.
evalFile, however, only evaluate the code and do not control the event loop.
For that, we need to use the
MFeatures are the core building blocks of a Machine. The stack design of a Machine allows interfacing with different MFeatures in C++ directly and to implement new MFeatures on top of existing ones without a large performance penalty.
Only the most basic and necessary MFeatures are included with the library:
jac::MachineBase- the base class of all Machines. It provides the basic functionality of the runtime.
jac::EventQueueFeature- provides an event queue built on top of the standard library.
jac::EventLoopFeature- provides a default event loop implementation.
jac::FileystemFeature- provides filesystem access through
jac::ModuleLoaderFeature- provides module loading through
jac::StdioFeature- provides standard io streams and a simplified