English Compiler
The English Compiler is a Proof of Concept (POC) AI-based compiler designed to translate English-based markdown specifications directly into functional code. This project explores the potential of using AI to abstract the coding process, allowing developers to generate code from natural language specifications.
Key Features:
- AI-Powered Compilation: Leverages AI to convert English markdown specs into code.
- Prompt Chaining: Overcomes input/output size limitations of existing AI models through prompt chaining and engineering.
- Full Application Generation: Capable of generating entire applications across multiple files.
- Configuration: Uses a
english-compiler.jsonc
file for settings, including the OpenAI API key, specification directory, and output directories. - Caching: Supports prompt caching to speed up the build process and mitigate OpenAI rate limits.
Use Cases:
- Rapid Prototyping: Quickly generate code from functional specifications.
- Code Generation from Documentation: Convert existing documentation into functional code.
- Exploring AI as a Compiler Layer: Validates the potential of AI as a new abstraction layer in programming.
Installation:
Install the compiler globally using npm:
npm install -g english-compiler
Configuration Example (english-compiler.jsonc
):
{
"openai_apikey": "REPLACE-WITH-YOUR-ACTUAL-KEY-AND-DO-NOT-CHECKIN",
"prompt_cache_dir": "./prompt_cache",
"spec_dir": "./spec",
"code_dir": "./src",
"test_dir": "./test",
"personality": "Sassy & Sarcastic"
}
Note: This is a POC and not production-ready. The successor to this project is smol-dev-js.