A tiny REPL for bitwise arithmetic and expression evaluation.
Xod is a minimal scripting language and interactive REPL designed for experimenting with bitwise logic and integer math. Think of it as a scratchpad for systems engineers, embedded developers, and anyone who needs to test bitwise operations in a focused, rule-consistent environment.
- Evaluate bitwise and arithmetic expressions interactively.
- Integer-only logic with no floating point or negative values.
- Support for basic list manipulation and iteration.
- Familiar control flow with if, while, and for blocks.
- Hex, octal, binary, and decimal formatting.
- Simple built-in commands like
help(),clear(), andhistory().
- Operators:
&,|,^,~,<<,>>,+,-,*,/,%,** - Booleans:
==,!=,<,<=,>,>= - List Methods:
append,prepend,front,back,index - Builtin Commands:
hex(),bin(),log(base,value),range(start, end), etc. - Control Flow:
for(x in range(1, 5)) { bin(x) }
if(3 & 1) { hex(3) }
while(x < 8) { x = x + 1 }🛑 Floating point values and negative integers are not supported.
To avoid ambiguity in bitwise expressions, parentheses are required to define precedence. For example:
(a & b) | c // ✅ Clear
a & b | c // ❌ Error: ambiguous expressionLaunch the REPL:
xodThen type any expression:
>> 3 & 6
2
>> hex(255)
0xff
>> for(x in range(0, 4)) { bin(x) }
0b0
0b1
0b10
0b11help()– Show help messagehistory()– Show input historyclear()– Clear the screenquit()– Exit the REPL
Coming soon! For now, clone the repo and run it directly:
cargo install xodContributions, feedback, and bitwise rants are welcome! Feel free to open an issue or PR. If you’re interested in improving the parser, extending list functionality, or adding file I/O support—let’s chat.