Welcome to Engage, a natural language programming language designed for readability and power.
-
Run your first program:
python engage_interpreter.py examples/hello_world.engage
-
Try the interactive REPL:
python engage_vm.py
-
Compile to C++:
python engage_transpiler.py examples/hello_world.engage cl /std:c++latest /EHsc /Fe:hello.exe hello_world.cpp
let name be "Alice".
let age be 25.
let height be 5.6.
to greet with person_name:
let message be "Hello, " concatenated with person_name.
print with message.
end
greet with "World".
let score be 85.
if score is greater than 90 then
print with "Excellent!".
otherwise
print with "Good job!".
end
// Tables (hash maps)
let inventory be Table.
set inventory["sword"] to 1.
set inventory["potion"] to 5.
// Vectors (arrays)
let numbers be Vector.
let len1 be push with numbers, 10.
let len2 be push with numbers, 20.
to define Person:
property name with "Unknown".
property age with 0.
to introduce:
print with "Hi, I'm " concatenated with self.name.
end
end
let alice be new Person with name: "Alice", age: 30.
alice.introduce.
Engage includes comprehensive standard library modules:
import "strings" as str.
import "math" as math.
import "files" as files.
import "collections" as coll.
import "types" as types.
let text be "Hello World".
let length be str.length with text.
let upper_text be str.to_upper with text.
let result be math.sqrt with 16.
let power be math.pow with 2, 3.
examples/hello_world.engage- Your first Engage programexamples/simple_math.engage- Basic arithmeticexamples/simple_fibonacci.engage- Recursive functions
examples/working_comprehensive_demo.engage- All featuresexamples/records_demo.engage- Object-oriented programmingexamples/standard_library_showcase.engage- Complete standard library
python engage_interpreter.py examples/hello_world.engagepython run_engage.py examples/hello_world.engagepython engage_vm.pyThen use commands like:
_run examples/hello_world.engage- Execute a file_load examples/fibonacci.engage- Load and execute- Type Engage code directly for immediate execution
Generate optimized C++ code:
# Generate C++ code
python engage_transpiler.py examples/hello_world.engage
# Compile with Visual Studio (Windows)
cl /std:c++latest /EHsc /Fe:hello.exe hello_world.cpp
# Compile with GCC/Clang (Linux/macOS)
g++ -std=c++latest -o hello hello_world.cpp
clang++ -std=c++latest -o hello hello_world.cppRun the test suite to verify everything works:
python -m pytest tests/engage_tests.py -v- Explore Examples: Start with
examples/hello_world.engageand work your way up - Read the Documentation: Check out the main README.md for comprehensive features
- Try the REPL: Use
python engage_vm.pyfor interactive development - Build Something: Create your own
.engagefiles using the examples as templates
- Natural Syntax: Code reads like instructions
- Multiple Execution: Interpreter, VM, and C++ transpiler
- Rich Data Types: Tables, Vectors, Records, and more
- Standard Library: Strings, Math, Files, Collections, Types
- Error Handling: Result types with explicit error propagation
- Concurrency: Tasks and channels for parallel programming
- Module System: Import/export with namespace isolation
- Check the examples directory for working code
- Read error messages carefully - they include helpful suggestions
- Use the REPL for quick testing and experimentation
- Review the comprehensive README.md for detailed documentation