Skip to content

Syntax Basics

Devlish programs read like structured English. Each line is one statement, and the language normalizes human-readable names into consistent identifiers.

One statement per line. Blank lines are allowed. Comments start with #.

# This is a comment
total cost equals base price plus tax
# Blank lines separate logical sections
Print total_cost

Use equals to assign a computed value. Use is to define a term.

# Assignment: calculate and store
total exposure equals liability_cap plus deductible
status equals "pending"
# Definition: declare what a term means
liability cap is the maximum amount payable
termination notice is days required before termination

Multi-word names are written naturally and normalized to snake_case internally. Both forms refer to the same variable.

Ask "What is your name?" as user name
# Stored as user_name internally
Print user_name

Devlish supports both English words and symbols for arithmetic.

total equals base plus surcharge
difference equals revenue minus expenses
area equals width times height
rate equals total divided by count
# Symbol equivalents
total equals base + surcharge
area equals width * height
rate equals total / count

Comparisons are used in conditions and validation statements.

If score > 70:
Print "passed"
If retry_count >= 3:
Fail with "Too many retries"
If status equals "approved":
Print "ready"

Available comparisons: >, <, >=, <=, equals.

Combine conditions with and and or.

If score > 70 and status equals "active":
Print "eligible"
If region equals "US" or region equals "CA":
Print "North America"

Strings use double quotes. Concatenation uses plus.

greeting equals "Hello, " plus user_name
full path equals directory plus "/" plus filename

String helpers are available for transformation:

upper equals uppercase user_name
lower equals lowercase user_name
cleaned equals trim raw_input
slug equals slugify title