Engineering
moonbit-lang avatar

moonbit-lang

Official MoonBit language reference, syntax guide, and coding conventions for building high-performance software projects.

Introduction

The MoonBit language skill provides comprehensive access to official documentation, syntax specifications, and community-established best practices for MoonBit development. It is designed for engineers and developers working on projects ranging from standard language utilities to high-performance compiler tools like fastcc. The skill bridges the gap between raw language documentation and practical application, focusing on maintainable, idiomatic code structures and efficient resource management.

  • Full coverage of MoonBit language fundamentals, including methods, packages, attributes, and derive macros.

  • Detailed guidance on advanced topics such as error handling with suberror, FFI (Foreign Function Interface), and asynchronous runtime utilities.

  • Structured coding conventions covering visibility modifiers (priv, pub), pattern matching, memory safety, and deprecated versus current API usage.

  • Best practices for project organization, including moon.pkg.json configuration, test/wbtest-import management, and documentation generation.

  • Specialized guidelines for high-performance parser implementation using MoonBit syntax, drawing from standard implementations like the TOML parser.

  • Use this skill when drafting new MoonBit source files, refactoring existing packages, or troubleshooting compiler warnings and type-system errors.

  • Consult the documentation for official packages such as moonbitlang/x for file I/O operations or moonbitlang/async for TCP/HTTP tasks.

  • Follow the recommended pitfall resolutions to avoid unused variable warnings, deprecated slice indexing (s[i]), and outdated control flow patterns.

  • Refer to the style guidelines when architecting performance-critical systems to ensure code aligns with the ecosystem's internal design patterns, such as centralized error reporting in parsers.

  • Keep in mind that MoonBit is a rapidly evolving language; rely on these prompts to ensure alignment with the latest standard library and toolchain expectations.

Repository Stats

Stars
44
Forks
3
Open Issues
1
Language
C
Default Branch
main
Sync Status
Idle
Last Synced
May 3, 2026, 05:33 AM
View on GitHub