moonbit-lang

Solid

MoonBit language reference and coding conventions. Use when writing MoonBit code, asking about syntax, or encountering MoonBit-specific errors. Covers error handling, FFI, async, and common pitfalls.

Code & Development 44 stars 3 forks Updated 2 months ago LGPL-2.1

Install

View on GitHub

Quality Score: 76/100

Stars 20%
55
Recency 20%
75
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# MoonBit Language Reference @reference/index.md @reference/introduction.md @reference/fundamentals.md @reference/methods.md @reference/derive.md @reference/error-handling.md @reference/packages.md @reference/tests.md @reference/benchmarks.md @reference/docs.md @reference/attributes.md @reference/ffi.md @reference/async-experimental.md @reference/error_codes/index.md @reference/toml-parser-parser.mbt ## Official Packages MoonBit has official packages maintained by the team: - **moonbitlang/x**: Utilities including file I/O (`moonbitlang/x/fs`) - **moonbitlang/async**: Asynchronous runtime with TCP, HTTP, async queues, async test, and async main To use these packages: 1. Add the dependency: `moon add moonbitlang/x` or `moon add moonbitlang/async` 2. Import the specific subpackage in `moon.pkg.json`: ```json {"import": ["moonbitlang/x/fs"]} ``` ## Common Pitfalls - Use `suberror` for error types, `raise` to throw, `try! func() |> ignore` to ignore errors - Use `func() |> ignore` not `let _ = func()` - When using `inspect(value, content=expected_string)`, don't declare a separate `let expected = ...` variable - it causes unused variable warnings. Put the expected string directly in the `content=` parameter - Use `!condition` not `not(condition)` - Use `f(value)` not `f!(value)` (deprecated) - Use `for i in 0..<n` not C-style `for i = 0; i < n; i = i + 1` - Use `if opt is Pattern(v) { ... }` for single-branch matching, not `match opt {}` - Use `arr.clear()` not `w...

Details

Author
moonbit-community
Repository
moonbit-community/fastcc
Created
4 months ago
Last Updated
2 months ago
Language
C
License
LGPL-2.1

Similar Skills

Semantically similar based on skill content — not just same category

Code & Development Solid

coding-standards

Universal coding standards, best practices, and patterns for TypeScript, JavaScript, React, and Node.js development.

116 Updated 6 days ago
cloudnative-co
Code & Development Listed

coding-standards

Universal coding standards, best practices, and patterns for TypeScript, JavaScript, React, and Node.js development.

10 Updated 1 months ago
GiorgioBertolotti
Web & Frontend Solid

apple-engineer-superpowers

Use when writing Swift code for Apple platforms - iOS, macOS, visionOS. Covers Swift 6 concurrency, actors, Sendable, async/await, SwiftUI, MVVM architecture, Metal GPU programming, RealityKit ECS, visionOS scenes, interpolation/animation, advanced collection types, property wrappers, Combine bridging, error handling, testing, and API design patterns.

23 Updated 2 months ago
piemonte
Code & Development Featured

swift-concurrency

Diagnose data races, convert callback-based code to async/await, implement actor isolation patterns, resolve Sendable conformance issues, and guide Swift 6 migration. Use when developers mention: (1) Swift Concurrency, async/await, actors, or tasks, (2) "use Swift Concurrency" or "modern concurrency patterns", (3) migrating to Swift 6, (4) data races or thread safety issues, (5) refactoring closures to async/await, (6) @MainActor, Sendable, or actor isolation, (7) concurrent code architecture or performance optimization, (8) concurrency-related linter warnings (SwiftLint or similar; e.g. async_without_await, Sendable/actor isolation/MainActor lint).

1,509 Updated 3 weeks ago
AvdLee
Data & Documents Solid

gleam-erlang-interop

Use when gleam-Erlang interoperability including calling Erlang code from Gleam, using Erlang libraries, external functions, working with Erlang types, NIFs, and leveraging the BEAM ecosystem from Gleam applications.

158 Updated 3 weeks ago
TheBushidoCollective