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.

Original post →

More from coding & agent

coding & agent channel →