The English to Anything Transpiler

4 months ago 11

the english to anything transpiler

inspired by https://github.com/theletterf/english-lang

enc is self hosting and the english definition is at ./src/enc.en

enc transpiles plain english description of code to any other programming language, using LLMs.

enc asciicast

for example:

$ enc ./examples/hello.en -o ./examples/hello.rs

provided the following examples/hello.en:

hello: output the string "hello, <input>!" based on the user's input main: call the hello function with the first argv. default to "world"

will produce the following examples/hello.rs:

use std::env; // hello: output the string "hello, <input>!" based on the user's input fn hello(name: &str) { println!("hello, {}!", name); } // main: call the hello function with the first argv. default to "world" fn main() { let name = env::args().nth(1).unwrap_or_else(|| "world".to_string()); hello(&name); }

there are three editions of enc here:

  • the original bootstrap python
  • the python version built from enc.en using the bootstrap edition
  • the rust version built from enc.en using the python edition

the default edition is the rust edition

  1. copy .enc.env.example to .enc.env

  2. modify your LLM provider and API keys as needed

  3. make build

  4. make hello

there are also make targets for the -bootstrap and -python editions, such as make hello-bootstrap or make hello-python

mise is recommended for a more contained/reproducible build

$ cat examples/hello.en $ make examples/hello $ cat examples/hello.c $ ./examples/hello

the bootstrap version of enc was one-shot vibe coded with aider and gemini-2.5-pro

subsequent releases were transpiled from english by enc and gemini-2.5-pro

model prices were pulled from aider

Read Entire Article