LLM-based programming language compiles to tested Python
Top 65.7% on sourcepulse
Marsha is a functional, higher-level programming language designed to simplify software development by translating human-readable descriptions into tested Python code using an LLM. It targets developers and researchers seeking to rapidly prototype or generate boilerplate code, offering a more structured and verifiable approach than direct LLM prompting.
How It Works
Marsha utilizes a unique syntax, resembling Markdown with English and mathematical notation, to define functions. Each function definition includes a declaration (name, input/output types), a descriptive text explaining the logic, and concrete examples of input-output pairs. This structured input guides an LLM to generate Python code, with the provided examples serving as an automated test suite to validate the output, creating a feedback loop for improved accuracy.
Quick Start & Requirements
pip install git+https://github.com/alantech/marsha
python -m marsha <your_marsha_file.mrsh>
OPENAI_ORG
, OPENAI_SECRET_KEY
). Support for local LLMs is planned.Highlighted Details
Maintenance & Community
The project is in an alpha state. Further community engagement and roadmap items are listed in the README, including support for visualizations, syntax highlighting, module systems, and a GUI mode.
Licensing & Compatibility
The repository does not explicitly state a license in the README. Compatibility for commercial use or closed-source linking is not specified.
Limitations & Caveats
Marsha is in alpha, with syntax subject to change. The LLM compiler is best-effort and may fail to generate code, with accuracy dependent on description and example detail. Current LLM support is limited to OpenAI; local LLM support is planned. Web scraping behavior may be outdated due to LLM training data limitations.
1 year ago
1 day