Language reference

A scannable cheat sheet. For explanations and examples, see Getting started, Sets & syntax, and Progressions & hooks. For the full hook and macro reference, see Lifecycle hooks and Progression macros.

Directives

DirectivePurpose
@version 1Required. Pins syntax stability
@name "..."Program name
@author "..."Author
@description "..."Long description
@difficulty <level>beginner · intermediate · advanced · elite
@category <cat>powerlifting · bodybuilding · strength · hypertrophy · conditioning · general
@unit <unit>Default weight unit: kg · lb · lbs

Blocks

BlockPurpose
tm { ... }Training maxes that @% percentages reference
state { ... }Program-wide variables (initial values)
alias { ... }Local exercise-name aliases
substitutions { ... }Approved exercise alternatives
progression "name" (params) { ... }Reusable progression rule
week "name" { ... }A training week of day blocks
deload week "name" { scale: use: }A scaled-down week
day "name" { ... }A training day of exercise blocks
superset { ... }Exercises sharing one rest timer

Set forms

FormMeaning
55 reps
5+ / amrapAs many reps as possible
8-12Rep range
3x83 sets of 8
30s / 1m30sTime-based set
@%8585% of this exercise's TM
@%85 of Squat85% of another exercise's TM
@135lbs / @60kgFixed weight
@BW / @BW+20kgBodyweight (+ added load)
warmup · drop · failureSet flags

Exercise-block options

OptionMeaning
rest: 3mRest between sets
intensity: rpe / rirIntensity logging mode
notes: "..."Coaching note
using "macro" (args)Attach a progression macro

Hooks & variables

Hooks: on_set (after each set), on_complete (after the exercise). Read these inside hooks:

VariableMeaning
completedDid the set/exercise hit its target?
completed_repsReps logged on the latest set
target_repsTarget reps for the latest set
total_repsTotal reps across the exercise
current_weightWeight used on the latest set
set_index / set_countIndex / total of sets
failed_setsCount of sets that missed
is_amrap / is_prWas it AMRAP / a PR?
estimated_1rmEstimated 1RM (in on_complete)
unit_is_metric1 if the enrollment is in kg, 0 if lbs
next_set_weight / next_set_repsWritable in on_set to pre-fill the next set

Training-max access: tm.self (this exercise) and tm.<exercise> (another, e.g. tm.bench). State access: state.<name>.

Built-in functions

FunctionReturns
round(x, n)x rounded to the nearest n
floor(x) / ceil(x)Round down / up
min(a, b) / max(a, b)Smaller / larger
clamp(x, lo, hi)x constrained to [lo, hi]
pct_of(weight, pct)weight × pct
rpe_to_pct(reps, rpe)%1RM for a reps/RPE pair
pick(cond, a, b)a if cond is non-zero, else b

Unit-aware increments

Weights in ReptoLang are raw numbers labelled with a unit — nothing ever converts kg ↔ lbs. To bump a training max by the right amount for either kind of lifter, write a unit pair { <kg>, <lbs> }:

{ Akg, Blbs } is shorthand for pick(unit_is_metric, A, B). It needs exactly one kg and one lbs weight (order doesn't matter) and is the one place a program may name both units — the suffixes only pick a slot, so no conversion happens. Each slot must be a non-negative weight literal; a leading - is a parse error (write a subtraction like tm.self -= { 2.5kg, 5lbs } instead).

Built-in progression macros

lp · lp_deload · dp · wave_lp — see Progressions & hooks.

How exercise names resolve

When you write an exercise name, ReptoLang matches it in this order:

  1. Script alias — your local mappings.
  2. Exact match — case-insensitive against the library name.
  3. Built-in alias — common shorthand (e.g. OHP, Bench, RDL).
  4. Fuzzy match — closest library name above a similarity threshold.

If nothing matches, the exercise is flagged unresolved and you map it on import. Browse every referenceable name in the exercise library.