nanolang  by jordanhubbard

Minimal language for AI code generation

Created 4 months ago
557 stars

Top 57.6% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

NanoLang is an experimental programming language engineered for LLM code generation, featuring a minimal, unambiguous syntax and mandatory testing. It transpiles to C, offering native performance and enhanced code quality for developers and AI systems alike.

How It Works

NanoLang employs prefix notation (e.g., (+ a (* b c))) to eliminate operator precedence ambiguity, simplifying parsing for both humans and AI. The language transpiles to C, ensuring native performance and broad compatibility. A core design tenet is mandatory testing, requiring every function to have an associated shadow test block, enforcing disciplined code quality.

Quick Start & Requirements

  • Install: Clone the repository, cd nanolang, then run make build to compile the compiler.
  • Platform Support: Tier 1 includes Ubuntu 22.04+, macOS 14+ (ARM64), and FreeBSD. Tier 2 supports Windows via WSL2. Tier 3 is experimental (macOS Intel, other Linux, OpenBSD).
  • Prerequisites: For module usage, dependencies like SDL2, ncurses, and pkg-config may be required (managed via package managers like Homebrew or apt). WSL2 is recommended for Windows users.
  • Links: User Guide (HTML), Getting Started, Quick Reference, Language Specification, Examples.

Highlighted Details

  • Prefix notation for unambiguous expression evaluation.
  • Mandatory shadow test blocks for every function.
  • Static typing with type inference and support for generic types (e.g., Result<T, E>).
  • Transpiles to C for native performance and compatibility.
  • Module system with automatic dependency management for libraries like ncurses and sdl.
  • Foreign Function Interface (FFI) for seamless C library integration.

Maintenance & Community

The project welcomes contributions, with specific areas for improvement outlined in CONTRIBUTING.md. No specific community links (e.g., Discord, Slack) or notable sponsors are detailed in the provided README.

Licensing & Compatibility

Licensed under the Apache License 2.0. This license generally permits commercial use and integration into closed-source projects without significant restrictions.

Limitations & Caveats

Native Windows binary generation (.exe) is not currently supported; users must utilize WSL2. Full support for generic functions, particularly for standard library helpers like Result unwrapping, is still under development.

Health Check
Last Commit

17 hours ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
4
Star History
142 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.