marsha  by alantech

LLM-based programming language compiles to tested Python

created 2 years ago
470 stars

Top 65.7% on sourcepulse

GitHubView on GitHub
Project Summary

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

  • Install via pip: pip install git+https://github.com/alantech/marsha
  • Run compiler: python -m marsha <your_marsha_file.mrsh>
  • Prerequisites: OpenAI API keys (environment variables OPENAI_ORG, OPENAI_SECRET_KEY). Support for local LLMs is planned.
  • Documentation: https://github.com/alantech/marsha

Highlighted Details

  • LLM-driven code generation with automated testing via examples.
  • Syntax supports type safety and aims for minimal, parseable definitions.
  • Generated Python code can be invoked via CLI or run as a REST server.
  • Offers flags for debug logging, quick generation, retry attempts, and parallel LLM execution.

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.

Health Check
Last commit

1 year ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
1 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.