Skip to content

Add initial functionality - #1

Merged
tuckermcclure merged 13 commits into
mainfrom
tucker/initial-functionality
Sep 23, 2026
Merged

tuckermcclure merged 13 commits into
mainfrom
tucker/initial-functionality

Conversation

@tuckermcclure

@tuckermcclure tuckermcclure commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

Summary

GradientMicroIDL generates matching Julia and C++ message types for interfaces such as Julia simulations calling C++ through ccall. Generation happens in a separate build step, leaving consumers with ordinary Julia source files and C++ headers.

See the readme.md.

Design

  • Specifications are regular Julia types. Namespaces, messages, fields, enums, and length parameters can be constructed directly in Julia. They describe the intended interface without containing generator bookkeeping.
  • Resolution is a separate step. Shared validation resolves references and calculates layout before either emitter writes files. Sizes, alignments, and physical field ordering remain private implementation details.
  • File formats are input adapters. Dictionaries convert into specification objects; optional YAML and JSON extensions provide file loading. All inputs use the same validation and generation path.
  • Declaration order is explicit. Ordered specification vectors determine constructor argument order. Physical fields are ordered by decreasing alignment, preserving declaration order for ties.
  • Interoperability uses native layout. Generated types support pointer-based interfaces. We have tested pointer-based interoperability. Returning generated structs by value may also work, but we haven’t yet tested and established its supported platform coverage.

File readers support relative namespace includes and reject recursive includes and duplicate keys. Callers explicitly load YAML or JSON to enable the corresponding reader.

Validation

All 348 tests pass, covering specification and file inputs, validation, generated Julia types, compiled C++ layout checks, and mutation through ccall. The README's native specification example also runs successfully.

@tuckermcclure
tuckermcclure marked this pull request as ready for review September 16, 2026 21:02

@CarlOlsson CarlOlsson left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex review

This review was performed by Codex against commit bd8dbf113be80e796499373d9ebd9d6002bf903f.

  1. [P2] Namespace files can silently overwrite each other. Siblings named Sensors and sensors pass validation but resolve to the same files on case-insensitive filesystems. Reproduced on macOS: generation succeeds, but the loaded module has only sensors. Detect path collisions before writing. src/julia.jl:187

  2. [P2] An enum named T produces unloadable Julia code. EnumSpec("T", "uint8", ["ready" => 0]) passes validation, but EnumX's internal type T conflicts with its enclosing module. Loading fails with cannot declare T.T public; it is already declared exported. Reserve T for enum declarations as well as enum members. src/definitions.jl:130

  3. [P3] Julia's special identifiers escape validation. Fields named ccall or cglobal pass Base.isidentifier, but the emitted constructors fail to load because these are invalid argument names. Reject them before writing output. src/definitions.jl:103

@tuckermcclure

Copy link
Copy Markdown
Member Author

Fixed those things. It's ready again.

@tuckermcclure
tuckermcclure merged commit 14fe2b6 into main Sep 23, 2026
4 checks passed
@tuckermcclure
tuckermcclure deleted the tucker/initial-functionality branch September 23, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants