Skip to content

Latest commit

 

History

History

runtime

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Plasma Runtime System

Plasma uses a byte code interpreter. One basic interpreter and runtime system is currently under development but this could change in the future, including the addition of native code generation.

Files

The runtime is mostly C++ with small bits of C, some care needs to be taken with header files. C++ may call C (and include its headers) but C may not call C++ or include its headers (without wrappers).

These files break the rule about having matching implementation/header files for each module. Since for these headers, multiple alternative files could provide different implementations.

  • pz_interp.h - The header file for the core of the interpreter
  • pz_closure.h - Header file with closure related declrations. The implementation is in the interpreter files themselves.
  • pz_generic.cpp - The architecture independent (and only) implementation of the interpreter
  • pz_generic_*.{cpp,h} - Other parts of the generic interpreter. Only files in this group may include other headers in this group, there must be no coupling with the rest of the system other than trhough pz_interp.h
  • pz_generic_run.cpp/pz_generic_run.h - The main loop of the interpreter.
  • pz_generic_builtin.cpp/pz_generic_builtin.h - The implementation of the builtins.

Other files that may be interesting are:

Build Options

  • PZ_DEV - Enable developer build which makes the PZ_RUNTIME_DEV_OPTS below available.

  • DEBUG - Enable runtime assertions.

Runtime Options

Runtime options are specified using environment variables. They're each interpreted as comma-seperated, case-sensative tokens.

  • PZ_RUNTIME_OPTS for general runtime options.

    • load_verbose - verbose loading messages

    • fast_exit=[ yes | no ] - exit without freeing resources.

  • PZ_RUNTIME_DEV_OPTS for developer runtime options.

    These require PZ_DEV to be defined during compile time.

    • interp_trace - tracing of PZ bytecode interpreter

    • gc_zealous - Make the GC zealously perform a GC before every allocation. To test this mode run: ( cd tests; ./run-tests.sh gc )