Skip to content

Simplify native aggregate initialization and lookups - #73

Merged
mentaljam merged 3 commits into
mainfrom
simplify-c-struct-initialization
Sep 9, 2026
Merged

Simplify native aggregate initialization and lookups#73
mentaljam merged 3 commits into
mainfrom
simplify-c-struct-initialization

Conversation

@mentaljam

@mentaljam mentaljam commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • replace the C/C++ preprocessor branch used for generated struct returns with a shared positional aggregate initializer
  • canonicalize semantic lookup rows to enum declaration order
  • generate native lookup helpers as dense aggregate tables indexed by enum ordinal instead of switch statements
  • keep a bounds check with an all-NAN fallback in C headers while C++ modules use direct enum-to-index lookup
  • remove generated-code dependence on PTFKIT_RECORD_LITERAL, detail/record.h, and C++ std::unreachable() for lookups

@mentaljam mentaljam changed the title Simplify C struct result initialization Simplify native aggregate initialization and lookups Sep 5, 2026
@mentaljam
mentaljam force-pushed the simplify-c-struct-initialization branch from beb6571 to 9203d76 Compare September 5, 2026 12:01
@mentaljam
mentaljam force-pushed the simplify-c-struct-initialization branch from 9203d76 to bdc6be4 Compare September 5, 2026 12:03
@mentaljam
mentaljam marked this pull request as ready for review September 5, 2026 12:04
@mentaljam
mentaljam merged commit 2bf7eab into main Sep 9, 2026
12 checks passed
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.

1 participant