Language Reference

Syntax

Understand the rules that make Plain Language readable and easy to parse.

Syntax essentials

  • One statement per line.
  • Indentation defines blocks.
  • Unknown lines pass to Python.

Statements and lines

Plain Language treats each line as a single instruction. Keep sentences short and focused. When you need multiple operations, split them into multiple lines for clarity and predictable transpiling.

syntax.pln
print "Starting"
set total to 0
set total to total + 1

Blocks and indentation

Use the word do or then do to open a block. Every indented line after that belongs to the block until indentation returns to the previous level.

blocks.pln
if status is "active" then do
    print "User is active"
    set level to "gold"
otherwise do
    print "User is inactive"
  • Use 4 spaces for indentation to match Python standards.
  • Never mix tabs and spaces in the same file.
  • Close a block by returning to the previous indent level.

Literals and comments

Strings, numbers, booleans, lists, and dictionaries are used directly in the language.

literals.pln
# This is a comment
set name to "Ada"
set count to 3
set enabled to true
set tags to ["beta", "internal"]
set profile to {"role": "admin"}

Human shortcuts

Plain Language includes shortcuts for common actions so scripts read like instructions.

shortcuts.pln
set name to ask "What is your name?"
say hello
wait 2 seconds
exit