Common mistakes
This page is for people learning Echo. It explains problems in ordinary language.
Looking for error codes (E1001, E2003, …)? Use Errors and Troubleshooting.
For each problem:
What you see → What it means → Why → How to fix → Try againMissing semicolon
What you see
A message like: Expected ;, got end of input (or similar).
What it means
Echo reached the end of an instruction and did not find ;.
Why it happened
You wrote something like:
say("Hello, Echo!")How to fix
Add ; at the end:
say("Hello, Echo!");Try again
Run the fixed program. You should see Hello, Echo!.
Variable used before it was declared
What you see
Something like: Variable 'count' is not declared (often E1011), with a hint to declare with a type.
What it means
You tried to assign to a name Echo has not been introduced to yet.
Why it happened
count = 1;How to fix
Declare it the first time, with a type:
count: int = 1;Try again
count: int = 1;
say(count);Should print 1.
Wrong type of value
What you see
A type error when you assign or pass a value (message mentions types or E codes in the Type category).
What it means
The name was declared for one kind of value (for example int), but you gave it another kind (for example text).
Why it happened
count: int = 1;
count = "two";How to fix
Keep the same kind, or declare a different variable for text:
count: int = 1;
count = 2;
label: str = "two";elang: command not found
What you see
The Terminal says it does not know the command elang.
What it means
Your computer is not finding the Echo install in this Terminal window.
Why it happened
Common causes: install not finished, or you did not open a new Terminal after pipx ensurepath.
How to fix
Open a new Terminal window.
Run
elang --versionagain.If it still fails, re-run:
bashpython3 -m pipx ensurepath(Windows PowerShell:
python -m pipx ensurepath), then open another new Terminal.Check
pipx listmentionsecholang.
Still stuck? On macOS/Linux, developers sometimes need ~/.local/bin on PATH — see the longer checklist in Install Echo.
Try again
Success looks like:
Echo 2.2.1File not found when running
What you see
Echo (or the shell) says it cannot find hello.echo (or similar).
What it means
Terminal is looking in a folder that does not contain your file.
How to fix
- Note where you saved the file (Desktop, Documents, …).
cdinto that folder.- Confirm the file name ends with
.echo. - Run
elang hello.echoagain.
Missing { } after if / while
What you see
A syntax error near if or while.
What it means
Echo expects braces around the block.
How to fix
if true {
say("yes");
}Changing an outer variable inside a function
What you see
An error about assignment / E2003, often mentioning use mut.
What it means
Inside a function you may read a name from outside. To change it, Echo requires use mut first.
How to fix (when you need it)
count: int = 0;
fn bump() {
use mut count;
count = count + 1;
}
bump();
say(count);Beginners can avoid this pattern: pass values in as parameters and return new values instead. Full rules: Scope, use, and watch.
Next
- Back to Learn Echo
- Full catalog: Errors and Troubleshooting
