Machines don't speak Java, Python, or JavaScript — they speak native binary.
High-level languages were invented for humans, not machines. Every line of Python or Java you write gets compiled down to the binary that the CPU actually executes. The native code is the real code. Everything else is a translation.
With AI agents, you can now write native binary directly — the way machines actually think. No compiler, no runtime, no abstraction layers. Just raw instructions the CPU understands.
bin2prev bridges the gap: write native with your agent, then preview it in your preferred language — Java, JavaScript, Python, Ruby, Go — so you can read what the machine already understands.
Write native. Preview human.
┌──────────────────────────────────────────────────────────┐
│ VS Code │
│ │
│ Explorer Preview Panel │
│ ┌──────────┐ ┌──────────────────────────┐ │
│ │ 📁 bin2prev │ Raw | Java | JS | Python │ │
│ │ ├── hello│ ──dbl-click─▶│─────────────────────────-│ │
│ │ └── greet│ │ public class Hello { │ │
│ └──────────┘ │ public static void │ │
│ │ main(String[] args) { │ │
│ │ System.out.print( │ │
│ │ "Hello, World!\n");│ │
│ │ System.exit(0); │ │
│ │ } │ │
│ │ } │ │
│ └──────────────────────────┘ │
└──────────────────────────────────────────────────────────┘
- Open — Double-click any binary file — bin2prev opens it automatically
- Analyze — Parses Mach-O/ELF headers, decodes ARM64 instructions, detects syscalls
- Preview — Shows equivalent code in 6 tabs: Raw Binary, Java, JavaScript, Python, Ruby, Go
- Open VS Code
- Go to Extensions (
Cmd+Shift+Xon Mac /Ctrl+Shift+Xon Windows/Linux) - Search for
bin2prev - Click Install
That's it — you're ready to preview binaries.
git clone https://github.com/Ahsan-Hoque/bin2prev.git
cd bin2prev/vscode-ext
npm install
npx @vscode/vsce package --allow-missing-repository
code --install-extension bin2prev-0.0.4.vsixJust double-click any binary file in VS Code's explorer — bin2prev opens it automatically with a raw hex view and language preview tabs.
Right-click any file → "bin2prev: Preview Binary as Source Code"
Cmd+Shift+P → type "bin2prev" → select "Preview Binary as Source Code"
# "Hello, World!" — prints and exits
./examples/hello
# Interactive greeter — asks your name in a loop, Ctrl+C to exit
./examples/greetOpen either binary in VS Code to see it previewed as Java, JavaScript, Python, Ruby, or Go.
bin2prev/
├── README.md
├── examples/ # Example native ARM64 binaries
│ ├── hello # prints "Hello, World!" and exits
│ └── greet # interactive name prompt loop
└── vscode-ext/ # VS Code extension
├── package.json # extension manifest
└── src/
├── extension.js # command registration + webview panel
├── analyzer.js # binary parser (Mach-O, ELF, ARM64 decoder)
└── webview.js # HTML/CSS/JS for the preview panel
| Binary Format | Instruction Set | Syscalls |
|---|---|---|
| Mach-O 64-bit | ARM64 (MOVZ, ADR, SVC) | write, read, exit |
| Mach-O 32-bit | — (string fallback) | — |
| ELF 32/64-bit | — (string fallback) | — |
| PE (Windows) | — (string fallback) | — |
Native ARM64 Mach-O binary — prints "Hello, World!" using raw kernel syscalls (write + exit). No compiler, no runtime.
Interactive ARM64 binary — prompts "Enter your name (^C):", reads input, prints "Hello, <name>", loops until Ctrl+C. Uses write + read syscalls.
MIT