sui-lang  by TakatoHonda

Error-free code generation for Large Language Models

Created 1 month ago
365 stars

Top 77.1% on SourcePulse

GitHubView on GitHub
Project Summary

Sui (粋) is a novel programming language designed to eliminate syntax errors and typos in code generated by Large Language Models (LLMs). It targets developers and researchers seeking to leverage LLMs for code generation with guaranteed correctness, offering a significant reduction in debugging effort and an improvement in LLM output reliability. The primary benefit is enabling LLMs to produce code that "just works" by design.

How It Works

Sui achieves its error-free guarantee through structural constraints that make common programming mistakes impossible. Bracket mismatches are prevented by limiting {} usage to function definitions without nesting. Variable typos are eliminated by using sequential numeric identifiers (e.g., v0, v1, g0) instead of arbitrary names. Indentation errors are irrelevant as the language is line-based and ignores whitespace. Complex expressions are decomposed into single instructions per line using temporary variables. This "pure logic" approach focuses computation, delegating UI to external frameworks.

Quick Start & Requirements

Installation is available via PyPI (pip install sui-lang), with optional WebAssembly support (pip install sui-lang[wasm]), or via Homebrew (brew install sui-lang). Source installation is also supported. Prerequisites for WebAssembly compilation include wabt (via brew install wabt). Users can try Sui directly in the browser via the Sui Playground or explore a Counter Demo. Basic usage involves an interactive REPL (sui), running files (sui examples/fibonacci.sui), or using transpilers like sui2py and py2sui.

Highlighted Details

  • Zero Syntax Error Rate: Errors like bracket mismatches or incorrect statement structure are structurally impossible.
  • Zero Typo Rate: Variables are identified by sequential numbers (v0, v1), preventing misspellings.
  • Line Independence: Each line is self-contained, simplifying parsing and execution.
  • LLM Integration: Designed for LLMs, with system prompts provided in the prompts/ directory to guide generation.
  • Transpilation: Bidirectional transpilers exist for Python (sui2py, py2sui), aiding human understanding and integration.
  • WebAssembly Support: Compiles to Wasm, enabling execution in browsers or Wasm runtimes.

Maintenance & Community

The project is actively developed, with a roadmap indicating future additions like a package manager, standard math/crypto libraries, and optional type annotations. No specific community channels (e.g., Discord, Slack) or notable contributors/sponsorships are detailed in the provided README.

Licensing & Compatibility

Sui is released under the MIT License, which permits broad use, modification, and distribution, including for commercial purposes, with minimal restrictions.

Limitations & Caveats

Currently, Sui's token efficiency is lower than traditional languages like Python for simple tasks, though future LLM adoption is expected to improve this. Key features such as a package manager and optional type annotations are still under development and listed on the roadmap. The LLM integration relies on users employing the provided prompts and LLMs learning the Sui syntax effectively.

Health Check
Last Commit

3 weeks ago

Responsiveness

Inactive

Pull Requests (30d)
3
Issues (30d)
4
Star History
71 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.