Fork me on GitHub

Parfait, a minimal runtime

RubyX uses the these following classes at compile time to build the base of an object oriented system.

In RubyX every object really is an object and data is hidden to the language level.

Objects have a Type and constant size. See memory for more on memory layout and management.


If we would be talking about a language, this would be like Javascript, or previously Self. Basically rubyx's types would be (immutable) prototypes in a prototype based language.

It may be easiest to understand types by how they are used. When rubyx parses a class, it creates a Sol::ClassExpression, which in turn creates a Parfait::Class. This class carries the Sol methods, basically the language code for the methods.
At this point a type, representing the object layout as known at the time, is created. Parfait::SolMethod are compiled to binary (Parfait::Callable) according to the type information and stored in the type.
If the class changes at run-time, ie variables are added or removed, a new type object is created (with the updated layout) and the same ruby code is compiled to new Parfait::Methods.

Method, Message and Frame

The TypedMethod class describes a callable method. It carries a name, argument and local variable type and several descriptions of the code:

When TypedMethods are invoked, A message object (instance of Message class) is populated. The data in the Message holds the receiver, return addresses, arguments and a frame. Frames are also created at compile time and just reused at runtime. Calling describes more detail about the calling convention, while method resolution described how the methods are found, mainly at run-time.


The single instance of Space holds a list of all Types and all Classes, which in turn hold the methods. The space also holds messages and will hold memory management objects like pages.

Pages are currently not implemented but will be used to realise the aproach described in the page about memory management.


There are off course several utility classes necessary just to implement the type and class system.