No laptop. No IDE. Just Termux and a text editor.
Over the past year I shipped five systems from my Android phone:
Here's how the core works.
The pipeline is classic:
source → tokenizer → recursive-descent parser → AST
→ tree-walk interpreter
→ bytecode compiler → stack VM
→ C / WAT transpilers
The bytecode compiler emits a flat instruction list. This is real output
from sahajcore --compile
:
0004 LOAD a
0005 LOAD b
0006 CONST 2
0007 BIN *
0008 BIN +
0009 STORE c
0014 BIN >
0015 JZ 19
The interpreter is written in SahajCore itself. The bootstrap chain:
Python-hosted interpreter
→ runs selfhost.sahaj (interpreter written in SahajCore)
→ runs target.sahaj (user program)
The hardest bug: recursive Fibonacci blew the Python stack because every
target-level call expanded into hundreds of host frames. Fix: rewrote the
demo iteratively and raised the recursion limit.
A tiny relational engine with:
pip install sahajcore
pip install sahajql
GitHub: github.com/sayan9168/SahajCore
Happy to go deep on any part — ask me anything.