Menai: an open-source pure functional language designed for LLMs to write safely
davejh69 · reddit · 2026-10-03
The developer of the open-source Humbug AI environment released Menai, a programming language designed primarily for LLMs: pure functional, no I/O, no state mutation, with fast compilation and execution. An external tool framework passes all inputs in and receives results back, enforcing safety rules — no reading sensitive files, no network access, no accidental rm -rf.
Menai started as an LLM tool for deterministic tasks LLMs get wrong (big calculations, counting letters), then grew into file/buffer transformation: the model writes short lisp-like expressions, and dangerous final operations require framework approval. It now ships 20 standard library modules for zip, tar, BMP, PNG, gzip and JSON processing.
Typical expressions compile in tens of milliseconds despite a Python-based optimizing compiler, with Python-level runtime speed. Demo: DeepSeek built tar/gzip stdlib functions in Menai, debugged them itself, then unpacked and analyzed an arj archive — 64 seconds, 10 tool calls, 9 unique programs, with zero human safety approvals needed by design.
More from coding & agent
- Dev ships throwaway Postgres for agents: pg19 via pglite on Cloudflare DO over raw TCP — ritakozlov · 2026-11-29
- Product idea: cloud Android VMs and home WiFi proxies to make agents look human — Darpinian · 2026-11-29
- 38 free agent skills distilled from shipping three live AI products — PawelHuryn · 2026-11-29
- Step 5: run evals on synthetic data pre-launch, watch real traces after — PawelHuryn · 2026-11-29
- Break your agent before attackers do: 6 tests mapped to OWASP LLM Top 10 — PawelHuryn · 2026-11-29
- PM shares playbook for shipping 4 customer-facing Claude agents into production — PawelHuryn · 2026-11-29