Ess.

Eng 0.4 · English that compiles to seven languages

Say it in English. Get the same code every time.

Each clause is one step, applied to the result of the one before. Fixed rules, no model: a clause it can't read is an error that names it. One sentence becomes Python, JavaScript, C, Rust, Go, x86-64 machine code and WebAssembly.

Compiles as you type
    
          

    How a sentence becomes code

    Three rules, applied in order. Everything else is vocabulary.

    Inputs first

    Take a list and a value…

    The first clause can name the inputs. They become the parameters, and the first one becomes "it".

    One clause, one step

    …square each element, find the mean…

    Each later clause is one operation on "it". Its result becomes the new "it". "Each" applies an operation to every element.

    Last value out

    …and take the square root of that.

    Whatever the last clause produces is returned. Writing a file or opening a window returns nothing.

    The mapping

    100 functions, each written three ways. Every sentence was compiled and run against a hand-written Python reference on the same inputs. Where a sentence also compiles to other languages, that code was built and run too: C with gcc, the assembly with the GNU assembler, Rust with rustc, Go with go build, and JavaScript and WebAssembly in Node. Open a row to see which languages passed.

    Words with one meaning

    Precision comes from each phrase meaning exactly one thing. Where a word could mean two things, it gets one, and the other meaning gets its own phrase.