Labsco
24greyhat logo

VoidLang

from 24greyhat

VoidLang - LLM Native Machine Code MCP

πŸ”₯πŸ”₯βœ“ VerifiedAccount requiredAdvanced setup

VoidLang MCP

A bytecode-style language designed for LLMs. The model writes numeric opcodes as JSON, the server returns a working binary, a React app, an iOS / Android scaffold, or a docker-compose.yml. No syntax. No parsing. No token waste on punctuation.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  LLM  ──[opcode JSON]──▢  voidmcp  ──▢  Go / React / Swift / Kotlin  β”‚
β”‚                                  β”‚                                   β”‚
β”‚                                  └──▢  go build / npm build          β”‚
β”‚                                                                      β”‚
β”‚                                  ──▢  artifact URL (binary / zip)    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  • 9 compilation targets: linux, macos, windows, ios, android, web, pwa, wasm, docker.
  • ~160 opcodes covering HTTP, SQL, Redis, JWT, bcrypt, web UI, mobile UI, file IO, and Docker topology.
  • One-shot ISA endpoint returns the entire instruction set in one call β€” no per-call schema discovery.
  • Two transports: HTTP (any LLM, any IDE, any agent) and MCP stdio JSON-RPC (Claude Desktop / Claude Code).
  • Production-grade: stdlib-only server, multi-stage Dockerfile, healthcheck, Railway-ready.

Why this exists

LLMs are terrible at writing valid syntax in a brand-new language, but they are excellent at outputting JSON arrays. VoidLang flips the contract: the language is a JSON array of [opcode, args…] pairs. The compiler does all of the work β€” formatting, imports, error handling, deployment topology β€” so the model only has to express intent, not boilerplate.

A web API that talks to Postgres, authenticates with JWT, has CRUD on two tables, and deploys to Docker compose, fits in ~80 instructions. A handwritten Go version of the same app is ~1500 lines.


Endpoints

MethodPathWhat it does
GET/Landing page (handy for verifying a deploy).
GET/isaFull ISA β€” give this once to any LLM.
GET/isa/quick~2k-token condensed ISA.
GET/targetsAvailable compilation targets.
POST/compile{void, target?, name?} β†’ artifacts.
POST/runCompile + run locally (opt-in, see below).
GET/artifacts/{id}Download a previously-compiled binary blob.
GET/healthLiveness + toolchain capability report.
GET/mcpLightweight tool manifest.

POST /compile

// request
{
  "void":   { "v": 1, "name": "todo_api", "tgt": ["linux", "docker"], "ins": [/*…*/] },
  "target": "linux",     // optional override
  "name":   "todo_api"   // optional override
}

// response
{
  "ok": true,
  "app": "todo_api",
  "targets": [
    {
      "target": "linux",
      "kind":   "binary",
      "binary_size": 9482240,
      "download_url": "http://localhost:7070/artifacts/3f6a2b1c8e9d4f70",
      "files": { "main.go": "…", "go.mod": "…" }
    },
    {
      "target": "docker-compose",
      "kind":   "text",
      "files": { "docker-compose.yml": "…", ".env.example": "…", "Dockerfile": "…" }
    }
  ]
}

POST /run

Disabled by default. Set VOIDMCP_ALLOW_RUN=1 on the server to enable. The server will compile and execute the generated binary, returning stdout/stderr/exit code. Do not enable this on a public Railway deployment β€” only use it on a sandbox where running arbitrary code is safe.


How an LLM uses it

The expected loop is:

  1. Once per session: GET /isa β€” load the entire instruction set into the model's context. ~30k tokens. (Or GET /isa/quick for ~2k.)
  2. For each user request: emit a void file as a JSON object, send to POST /compile. Stream the response back to the user with a download link.
  3. Optional refinement: if the LLM made a mistake, the server returns build_log with the Go compiler's diagnostic. Feed it back to the LLM and ask for a fixed instruction array.

A complete system prompt template is in docs/LLM_PROMPT.md.

Examples


Architecture

voidLang/
β”œβ”€β”€ cmd/voidmcp/            main entrypoint (HTTP + stdio mode)
β”œβ”€β”€ internal/
β”‚   β”œβ”€β”€ isa/                opcode definitions + metadata
β”‚   β”œβ”€β”€ void/               .void file decoder
β”‚   β”œβ”€β”€ codegen/
β”‚   β”‚   β”œβ”€β”€ golang/         Go backend (linux/macos/windows/docker/wasm seed)
β”‚   β”‚   β”œβ”€β”€ web/            React + Vite project generator
β”‚   β”‚   β”œβ”€β”€ mobile/         iOS (SwiftUI) + Android (Compose) scaffolds
β”‚   β”‚   β”œβ”€β”€ wasm/           WebAssembly build helper
β”‚   β”‚   └── docker/         docker-compose.yml generator
β”‚   └── mcp/                HTTP server + stdio JSON-RPC transport
β”œβ”€β”€ examples/               sample .void files
β”œβ”€β”€ docs/                   ISA reference, deployment, LLM prompt template
β”œβ”€β”€ Dockerfile              multi-stage build for production
β”œβ”€β”€ railway.json            Railway deploy config
β”œβ”€β”€ nixpacks.toml           Railway nixpacks fallback
β”œβ”€β”€ Makefile                build / run / docker helpers
└── go.mod                  stdlib-only (no external deps)

The server has zero external Go dependencies. The generated programs do depend on gin, pgx, go-redis, golang-jwt, and x/crypto β€” those get downloaded on first compile and cached.


Development

make dev        # run via `go run` (no install)
make stdio      # run MCP stdio mode
make test       # run unit tests
make fmt        # gofmt
make docker-run # full Dockerised cycle

The server itself is stateless aside from a 30-minute in-memory cache of compiled artifacts (so /artifacts/{id} links don't expire too fast). Restart-and-go.


Docs