// chapter 07

pax

the planned domain-specific language for praxis. not a general programming language.

what pax is for

  • package installation
  • source compilation workflows
  • system configuration
  • hardware checks
  • boot and desktop setup
  • installer logic

file roles

  • .pax - general config
  • .pkg.pax - package definitions
  • .profile.pax - install presets
  • .boot.pax - boot logic

required header

every pax file starts with:

[.Praxis Config - <file purpose or config name> .praxis.pax./]

example:

[.Praxis Config - packageinstall-config .praxis.pax./]

core style

  • blocks use { }
  • assignment uses =
  • comparisons use ==
  • comments begin with #
  • strings use double quotes
  • booleans are true and false
  • bare words like xfce, source, bad, finished are symbols

example files

  • pax/examples/packageinstall-config.pax
  • pax/examples/workstation-config.profile.pax
  • pax/examples/liveboot-config.boot.pax
  • pax/examples/core-packages.profile.pax
  • pax/examples/source-pkg.pkg.pax
  • pax/examples/ricing-desktop.profile.pax
  • pax/examples/hardware-check.pax
  • pax/examples/core-system-config.pax

starter set

praxis ships a broader default starter set:

  • core-packages.profile.pax - common software selection
  • source-pkg.pkg.pax - source-based package workflows through the praxis source-pkg path
  • ricing-desktop.profile.pax - desktop and ricing setup
  • hardware-check.pax - hardware validation
  • core-system-config.pax - general base praxis config

example pax file

[.Praxis Config - packageinstall-config .praxis.pax./]

# Define the install target and the desktop that should be enabled.
config "packageinstall-config"
{
    package = "xfce-base/xfce4-meta"
    desktop = xfce
    compile_mode = source
}

# Probe the current machine before the install actions begin.
check hardware

# Stop early if the hardware probe reports a failure.
if hardware.status == bad
{
    print "Hardware failed."
    stop
}

# Run the install workflow using values from the config block.
install package config.package
compile package config.package
enable desktop config.desktop

# Confirm success after the fake installer reports a finished state.
if install.status == finished
{
    print "[XFCE] Installed!"
}

interpreter

the first interpreter is a small c# console app split into:

  • lexer
  • parser
  • ast
  • interpreter

expected usage when a .net sdk is present:

dotnet run --project pax/interpreter/PaxInterpreter.csproj -- pax/examples/packageinstall-config.pax

back to overview.