The Vix REPL is an interactive shell built directly into the vix binary.
Just like python, node, or deno, you start it simply by typing:
vixNo subcommand. No flags.
This is the default interactive mode of Vix.
The Vix REPL is a developer-friendly interactive environment designed to:
- Experiment with C++-like expressions
- Test runtime logic quickly
- Evaluate math expressions
- Manipulate variables and JSON data
- Call built-in Vix runtime APIs
- Prototype logic before moving to real code
It feels familiar if you’ve used:
- Python REPL
- Node.js REPL
- Deno REPL
…but adapted to the Vix.cpp philosophy.
vixExample startup:
Vix.cpp v1.x (CLI) — Modern C++ backend runtime
[GCC 13.3.0] on linux
Exit: Ctrl+C / Ctrl+D | Clear: Ctrl+L | Type help for help
vix>
You can type expressions directly:
1 + 2
10 * (3 + 4)
With variables:
x = 3
x + 1
x * 10
x = 42
name = "Gaspard"
x
name
The REPL supports strict JSON using nlohmann::json.
user = {"name":"Gaspard","age":10}
user
nums = [1,2,3,4]
nums
profile = {
"name":"Gaspard",
"meta":{"country":"UG","verified":true},
"tags":["cpp","vix","repl"]
}
profile
⚠️ JSON must be valid
❌{ "name", "Gaspard" }
✅{ "name": "Gaspard" }
print("Hello")
println("Hello world")
x = 3
println("x =", x)
println("x+1 =", x+1)
The REPL exposes a built-in Vix object.
cwd()
Vix.cwd()
Vix.cd("..")
pid()
Vix.pid()
Vix.env("HOME")
Vix.env("PATH")
Vix.args()
Vix.mkdir("tmp")
Vix.mkdir("tmp/logs", true)
You can run CLI commands from inside the REPL:
Vix.run("version")
Vix.run("help")
Vix.run("check", "--help")
clear
or:
Ctrl + L
exit
or:
Ctrl + D
Ctrl + C
- Use the REPL to prototype logic
- Validate math & JSON before writing C++
- Use
println()for debugging expressions - Treat the REPL as your scratchpad
Planned features:
- Property access:
user.name - Function definitions
- History persistence
- Autocomplete for variables
- Structured error hints
- Module imports
MIT License © Gaspard Kirira
Part of the Vix.cpp ecosystem