corelib_compiler_sdk
Login Register

Beskid

Jump to a Beskid service

corelib_compiler_sdk

Typed compiler Mod SDK facades (`Beskid.Compiler.*`, `Beskid.Syntax`) for `type: Mod` projects.

Piotr Mikstacki

Library 0 downloadsScore 73%Latest 0.0.2First publish 2026-05-20 23:37:16ZLast publish 2026-05-24 10:08:21Z
0.0.20.0.1
Readme

corelib_compiler_sdk

Typed Mod SDK facades under Beskid.Syntax and Beskid.Compiler.* for compiler mod projects.

Generated surfaces

src/Beskid/Compiler/{Query,Diagnostics,TypedEmitter,Compilation}.bd each combine:

  1. Generated structural mirrors from beskid_analysis (via beskid_ast_reflect_gen), using ReflectStub for payloads where the Rust shape is not mapped field-for-field.
  2. Hand-maintained version tokens and facade helpers at the bottom of each file.

src/Beskid/Compiler/Collect.bd is hand-maintained and declares the Collector, Generator, Analyzer, Rewriter, and AttributeGenerator contracts discovered from AOT-compiled Mod packages.

Syntax is split for stack-friendly consumption:

  • src/Beskid/Syntax.bd — thin entry (pub mod …Nodes, SyntaxFacadeVersion); no ReflectStub here (other hubs like Query.bd may still define a local stub for stitched enums).
  • src/Beskid/Syntax/Nodes.bd — barrel that re-exports one module per AST node type and per generated list/optional helper.
  • src/Beskid/Syntax/Nodes/*.bd — one file per logical syntax node (from beskid_analysis syntax/** scan), with concrete types where the mapping is straightforward (string, bool, i64, cross-references under Beskid.Syntax.Nodes.*), plus {T}List / Optional{T} helpers for typical Vec / Option shapes (Spanned<T> is peeled to T for helper naming). Remaining opaque Rust shapes still collapse to a placeholder type string inside the generator, but checked-in syntax nodes aim to be stub-free.

Syntax node field names (generated)

Regeneration uses beskid_ast_reflect_gen::syntax_nodes::emit_syntax_sdk (see crates/beskid_ast_reflect_gen/README.md).

  • Struct fields: Beskid field names use lowerCamel from Rust snake_case (with keyword escapes); tuple-struct Rust fields use field_0, field_1, … (never f0 / f1).
  • Enum tuple variants: a single payload uses payload; multiple unnamed slots use variant_field_0, variant_field_1, …
  • Beskid keywords / keyword-prefix clashes: names that match a Beskid reserved word, or start with one as the first snake segment (e.g. contract_name, type_name), are escaped as _name so they parse as normal identifiers.
  • Documentation: each node file opens with a structured /// header (mirror path, optional multi-line Rust docs, a generated index using @arg / @variant per beskid_doc.pest, and ReflectStub callouts as @arg where needed). Each field and enum variant has its own /// run (Rust docs when present, plus directive lines). List/optional helpers use the same @variant / @arg style.
  • src/Beskid/Syntax/Nodes/_inventory.txt — sorted type names (checked in tests) kept in sync with ReflectSdkNodeKind plus documented extras (FieldKind, AssignOp).

src/Prelude.bd is hand-maintained and only re-exports the modules above.

Regenerating

From the compiler repository root (directory containing crates/ and corelib/):

./corelib/packages/compiler-sdk/regen_mod_sdk_surfaces.sh

Equivalent manual invocation uses cargo run -p beskid_ast_reflect_gen with --no-banner and --no-reflect-stub when stitching into the checked-in files; see the script for exact allowlists.

After changing reflected Rust sources (compiler_sdk_reflect.rs, any crates/beskid_analysis/src/syntax/** AST struct or enum, hir/item.rs, or diagnostic enums), re-run the script and commit the updated .bd files (including Syntax/Nodes/ and tests/expected/syntax_nodes_inventory.txt in beskid_ast_reflect_gen when the inventory changes).

Versions

Versions

Version
Status
Size
Published
Actions
0.0.2Active262.7 KB2026-05-24 10:08:21Z
0.0.1Active265.3 KB2026-05-20 23:37:16Z
Badges

Badges & external sites

GitHub-friendly badge (SVG) and an optional iframe card. Scoped names such as @pckg/… use the package= query parameter so paths stay valid everywhere.

Badge (markdown, links to this package)
[![corelib_compiler_sdk on Beskid registry](http://depckg.beskid-lang.org/api/embed/badge.svg?package=corelib_compiler_sdk)](http://depckg.beskid-lang.org/packages/corelib_compiler_sdk)
Badge (markdown, image only)
![Beskid registry](http://depckg.beskid-lang.org/api/embed/badge.svg?package=corelib_compiler_sdk)
Widget (HTML iframe)
<iframe src="http://depckg.beskid-lang.org/api/embed/card?package=corelib_compiler_sdk" title="corelib_compiler_sdk on Beskid registry" width="480" height="200" style="border:0;border-radius:8px;max-width:100%;" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>

Many README hosts render images reliably; iframes may be stripped or sandboxed.

Preview
pckg registry badge
Dependencies

Dependencies

No dependency metadata published yet.

Dependents

Dependents

This package currently has 1 dependent package(s) based on latest published manifests.

Documentation

Documentation

Open full page
schema 4graph-v1

Prelude.bd

corelib_compiler_sdk

0.0.2

Beskid__alloc__array_len__array_new__channel_close__channel_create__channel_receive__channel_receive_value__channel_send__channel_try_receive__channel_try_send__fiber_cancel__fiber_current_id__fiber_detach__fiber_join__fiber_join_value__fiber_now_millis__fiber_processor_count__fiber_spawn__fiber_spawn_with_cancel_slot__fiber_yield__gc_register_root__gc_root_handle__gc_unregister_root__gc_unroot_handle__gc_write_barrier__hub_create__hub_register__hub_unregister__hub_wait_receive__hub_wait_receive_index__hub_wait_receive_value__interop_dispatch_ptr__interop_dispatch_unit__interop_dispatch_usize__mutex_create__mutex_lock__mutex_try_lock__mutex_unlock__panic_str__str_len__str_new__syscall_read__syscall_write__test_bytes_len__test_bytes_ptr__wait_group_add__wait_group_create__wait_group_done__wait_group_wait

Beskid

Beskid
Copy link
modulepublic

Prelude.bd:6

Members

Name
Type
Kind
Syntaxmodule
Compilermodule

No description.

Source

Source

Json .beskid/docs/api.json
Ratings

Ratings & quality

Quality score
73%
rising • strong
0 review(s)
Review distribution
5
0
4
0
3
0
2
0
1
0
Score decomposition
Update cadence 93% · w 0.42
Downloads momentum 70% · w 0.35
Review confidence 40% · w 0.23
Community

Community board

Community

Report issues, request features, and discuss this package with the community.

No threads yet. Start the first discussion for this package.

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please reload the page.