Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Compile-time reflection #108

Merged
merged 9 commits into from
Sep 27, 2024
Merged

feat: Compile-time reflection #108

merged 9 commits into from
Sep 27, 2024

Conversation

tibordp
Copy link
Member

@tibordp tibordp commented Sep 27, 2024

That's a fairly big bundle of changes I didn't bother splitting up, but basically

  • Constant expression tuple indexing tup.(1 + 1)
  • Static for (unrolled in mono and lowered separately for each iteration) - you can now loop over tuples!
  • A much more full-featured reflection system
    • typestated Type descriptor in std::typing that has basic info (size, align, name, is_X, ...)
    • struct field descriptors (really fancy with static for - you can basically build e.g. JSON parser into a struct)
  • JSON implementation of unmarshalling using reflection
  • A whole bunch of refactoring
    • Ripped out most of the unit test machinery from mono - it's now just "monomorphize all items with this attribute"
    • A whole lot of cleanup / renaming / splitting
    • Remove unneeded IR node types
    • etc.

Copy link

codecov bot commented Sep 27, 2024

Codecov Report

Attention: Patch coverage is 87.82609% with 196 lines in your changes missing coverage. Please review.

Project coverage is 88.70%. Comparing base (806ddb4) to head (f990e9d).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/alumina-boot/src/ir/mono/intrinsics.rs 91.41% 75 Missing ⚠️
src/alumina-boot/src/ast/pretty.rs 58.73% 26 Missing ⚠️
src/alumina-boot/src/visitors.rs 70.88% 23 Missing ⚠️
src/alumina-boot/src/ast/expressions.rs 76.05% 17 Missing ⚠️
src/alumina-boot/src/ast/macros.rs 48.00% 13 Missing ⚠️
src/alumina-boot/src/ast/rebind.rs 60.60% 13 Missing ⚠️
src/alumina-boot/src/ir/mod.rs 78.18% 12 Missing ⚠️
src/alumina-boot/src/diagnostics.rs 70.00% 9 Missing ⚠️
src/alumina-boot/src/codegen/elide_zst.rs 80.00% 3 Missing ⚠️
src/alumina-boot/src/compiler.rs 75.00% 2 Missing ⚠️
... and 3 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #108      +/-   ##
==========================================
- Coverage   88.94%   88.70%   -0.24%     
==========================================
  Files          35       34       -1     
  Lines       16565    16827     +262     
==========================================
+ Hits        14734    14927     +193     
- Misses       1831     1900      +69     
Flag Coverage Δ
88.70% <87.82%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tibordp tibordp merged commit 44a7dd0 into master Sep 27, 2024
9 checks passed
@tibordp tibordp deleted the reflection branch September 27, 2024 22:46
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