// 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
trueandfalse - bare words like
xfce,source,bad,finishedare symbols
example files
pax/examples/packageinstall-config.paxpax/examples/workstation-config.profile.paxpax/examples/liveboot-config.boot.paxpax/examples/core-packages.profile.paxpax/examples/source-pkg.pkg.paxpax/examples/ricing-desktop.profile.paxpax/examples/hardware-check.paxpax/examples/core-system-config.pax
starter set
praxis ships a broader default starter set:
core-packages.profile.pax- common software selectionsource-pkg.pkg.pax- source-based package workflows through the praxis source-pkg pathricing-desktop.profile.pax- desktop and ricing setuphardware-check.pax- hardware validationcore-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.paxback to overview.