Echo is a modern, statically-typed programming language designed for simplicity and readability. It combines strong type safety with a clean, intuitive syntax and powerful features for modern programming. Checkout documentation here.
Echo is designed to be both beginner-friendly and powerful, offering:
- Type Safety: Strong static typing with mandatory type annotations and runtime type checking
- Modern Syntax: Clean, readable code with intuitive constructs and method chaining
- Rich Standard Library: Comprehensive built-in methods for common operations
- Advanced Features: Support for modern programming patterns and debugging tools
- Static typing with mandatory type annotations
- String interpolation with
${variable}syntax - Method chaining for fluent code
- Function closures and nested functions
- Context-based scoping with
useanduse mutstatements - Variable watching for debugging
- Basic types:
int(32-bit),float(64-bit),str(UTF-8),bool - Collections:
list(mutable arrays),hash(key-value pairs) - Dynamic typing with
dynamickeyword nullliteral support- Type conversion methods:
asInt(),asFloat(),asBool(),asString()
- Type aliases are supported via
type Alias = BaseType; - Object type aliases are supported, e.g.
type User = { id: int, username: str, email: str, isAdmin: bool }; - Function calls support keyword arguments, e.g.
greet(name: "Alice", age: 21); - Type inference is still limited (explicit declarations are required)
- Generic types are not yet supported
forloops with step control (bykeyword)foreachloops for collection iterationwhileloopsif/elseconditionalsbreakandcontinuestatements- Logical operators:
&&,||,!
- I/O:
say(),ask(),wait() - String manipulation:
trim(),upperCase(),lowerCase(),length(),reverse() - Collection operations:
push(),empty(),clone(),countOf(),find(),insertAt(),pull(),removeValue(),order(),merge() - Type checking:
type()
- List operations:
push(),empty(),clone(),countOf(),find(),insertAt(),pull(),removeValue(),order(),merge() - Hash operations:
keys(),values(),wipe(),clone(),pairs(),take(),take_last(),ensure(),merge()
// Basic syntax example
name: str = "Echo";
age: int = 25;
scores: list = [95, 85, 75];
// Function with type annotations
fn greet(name: str) -> void {
say("Hello, ${name}!");
}
// Method chaining
result: int = ask("Enter a number:").asInt().toString().length();
// Loop with step
for i: int in 0..10 by 2 {
say("Count:", i);
}
// Variable watching
watch counter;
counter = counter + 1; // Output: WATCH: counter changed to 1// null literal
x: dynamic = null;
say(x); // Output: None
// primitive alias
type Age = int;
age: Age = 5;
say(age); // Output: 5
// object alias + typed function parameter
type User = { id: int, username: str, email: str, isAdmin: bool };
fn greet(user: User) -> void {
say("Hello, ${user['username']}!");
}
user: User = {
"id": 1,
"username": "alice",
"email": "alice@example.com",
"isAdmin": false
};
greet(user); // Output: Hello, alice!
// keyword arguments
fn describe(name: str, age: int) -> void {
say(name, "is", age);
}
describe(age: 21, name: "Alice"); // Output: Alice is 21src/- Core language implementationecho_lexer.py- Token generation and lexical analysisecho_parser.py- Abstract Syntax Tree (AST) constructionecho_interpreter.py- Code execution and runtimemain.py- Entry point for the interpreter
docs/- VitePress documentation site (source + build config)docs-legacy/- Legacy static documentation files*.echo- Example source files
Echo can be installed as a proper CLI command (echo / echolang) like other language runtimes.
- Python 3.10+
pipx installs Echo in an isolated environment and exposes global commands.
- Install
pipx(if needed):
python -m pip install --user pipx
python -m pipx ensurepath- Install Echo from GitHub:
pipx install git+https://github.com/deekshith-poojary98/echo.git- Run Echo:
echolang examples\language_feature_smoke.echoIf you cloned this repo, install it as a package:
pip install .Then run:
echo examples/language_feature_smoke.echoOn PowerShell, use echolang because echo is a built-in alias.
For contributors who want live code updates without reinstall:
pip install -e .After installation, these commands are available:
echo path/to/file.echo
echolang path/to/file.echoIn Windows PowerShell, prefer echolang path/to/file.echo.
You can still run directly from the repository:
.\echolang.bat examples\language_feature_smoke.echochmod +x echolang
./echolang examples/language_feature_smoke.echoYou can also run Echo directly with Python:
python src/main.py examples/language_feature_smoke.echoUse plain error output (no Rich formatting):
python src/main.py examples/language_feature_smoke.echo --plain- Clone the repository
- Check out the documentation
- Try the example files in the repository
[Contribution guidelines to be added]
[License information to be added]