UNEL Language Reference
The complete guide to UNEL — the Universal Natural English Language.
Every program reads like a story. No symbols, no cryptic syntax — just English.
Overview
UNEL is a programming language where syntax is English grammar. Programs are written as natural English sentences. There are no semicolons, no curly braces, and no cryptic operator symbols — only readable, grammatically correct English.
UNEL vs Traditional Code
UNEL replaces cryptic symbols with plain English. Here's the same logic in three languages:
Variables & Output
| UNEL | Python | JavaScript |
|---|---|---|
| Set name to "Alice". | name = "Alice" | let name = "Alice"; |
| Display "Hello " plus name. | print("Hello " + name) | console.log("Hello " + name); |
Math & Logic
| UNEL | Python | JavaScript |
|---|---|---|
| Set total to price plus tax. | total = price + tax | let total = price + tax; |
| Set area to length multiplied by width. | area = length * width | let area = length * width; |
| If age is greater than 18: | if age > 18: | if (age > 18) { |
Loops & Functions
| UNEL | Python | JavaScript |
|---|---|---|
| Repeat from 1 to 10 as i: | for i in range(1, 11): | for (let i = 1; i <= 10; i++) { |
| For each item in list: | for item in list: | for (let item of list) { |
| Define function greet that takes name: | def greet(name): | function greet(name) { |
Your First Program
Every statement ends with a period. Comments start with Note:.
Run with: python3 -m unel hello.unel
Variables
Declare variables with Set ... to ... — like writing a sentence.
Data Types
| Type | Example | Description |
|---|---|---|
| Integer | 42 | Whole numbers |
| Decimal | 3.14 | Floating-point numbers |
| Text | "Hello" | Strings (double quotes) |
| Boolean | true / false | Logical values |
| List | [1, 2, 3] | Ordered collection |
| Dictionary | {"key": "value"} | Key-value pairs |
| Nothing | nothing | Null / empty value |
Operators
All operators are written in natural English — no symbols needed.
Arithmetic
| UNEL Syntax | Meaning | Example |
|---|---|---|
| a plus b | Addition | Set total to price plus tax. |
| a minus b | Subtraction | Set change to paid minus cost. |
| a multiplied by b | Multiplication | Set area to length multiplied by width. |
| a divided by b | Division | Set avg to total divided by count. |
| a modulo b | Remainder | Set rem to n modulo 2. |
Comparison
| UNEL Syntax | Meaning |
|---|---|
| a is equal to b | Equality check |
| a is not equal to b | Inequality check |
| a is greater than b | Greater than |
| a is less than b | Less than |
| a is greater than or equal to b | Greater or equal |
| a is less than or equal to b | Less or equal |
Logical
| UNEL Syntax | Meaning |
|---|---|
| a and b | Both must be true |
| a or b | At least one must be true |
| not a | Negation |
Input / Output
Ask always stores text. Use Convert to change it to a number or decimal.
If / Else
Loops
Repeat N Times
Repeat From / To (Range)
For Each (Iterate)
While
Check / When (Switch)
Functions
Lambdas
Short, inline functions for use with map, filter, and reduce.
Built-in Functions (77)
Math
abs round floor ceil sqrt power mod min max sin cos tan random random_int
String
upper lower trim split join replace substring starts_with ends_with pad_left pad_right
List
length append remove sort reverse contains index_of slice map filter reduce
Type
type_of to_integer to_decimal to_text is_number is_text is_list is_empty
Lists
Dictionaries
Structs
Modules & Imports
16 standard library modules: Math, String, Convert, DateTime, IO, JSON, HTTP, Regex, Log, Testing, Validate, Functional, Collections, Crypto, Env, System.