Skip to content

Refactor/hir lazy eval#152

Open
cykna wants to merge 73 commits into
mainfrom
refactor/hir-lazy-eval
Open

Refactor/hir lazy eval#152
cykna wants to merge 73 commits into
mainfrom
refactor/hir-lazy-eval

Conversation

@cykna

@cykna cykna commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR modifies the codebase to work purely with Pools and Dedup pools and lazily.
This refactor implements how HIR is generated, and its internal structure.
This is intended to break some things, such as styles and specialized components. The main reason is that it will be simpler for the backends to define the primitive components(the ones that properly enter the scene graph since components are just views to them). This will grant benefits to the compiler itself since it will need to handle less code, only the ones that make components to be defined.

Scope

  • AST and HIR structure now use Pool and DedupPool internally to avoid Box, and heap allocations everytime
  • Refactored the HIR generation to be lazily evaluated. The HIR now tries to find out a function named main on the entry file, and starts reading from it. It will only get what is needed to make this main function work. So invalid things that are unused can be on a valid file, just not if this invalid thing is related to parsing, since its the only phase that is made fully.
  • Reestructured how type checker works. Type checker used to be more complex and have bidirectional type inference, now its unidirectional and topdown. this makes the type checker simpler because it's now dumber. The main reason for this is to make things really simple and able to read linearly which avoids ambiguity.
  • On HIR removed Specialized components, since they are now being intended to work as a bootstrapped thing on the language defined by the target.

Validation

List the commands, tests, or manual checks you ran.

make check

Documentation Impact

  • No documentation changes were needed
  • I updated the relevant documentation

Checklist

  • My change is focused and reviewable
  • I performed a self-review
  • I added comments only where they help explain non-obvious logic
  • I added or updated tests when applicable
  • I ran the validation listed above
  • I used the existing issue/PR templates where applicable

Related Issues

Closes N/A

cykna added 30 commits June 19, 2026 14:08
…pools, and types context to properly generate these types
cykna added 30 commits July 3, 2026 12:35
…dedup pool) and added new helpers to abstract the old ones
…mented inside hir since it does NOT need any kind of complex inference anymore
feat: dedup pool shouldnt have it because it won't follow the hash, and if another one with same data is already inside, it'd stop being a dedup pool. so it must keep as an append only vector
…d instead of references to nodes, that can be acquired by the id
note: Text and Div components now are being required to be determined, this is mainly because of the bootstrap that is being intendeed. In the future more it'll be able to define how styles should apply and what primitives the language should have in the language itself. This is mainly temporary due to not being finalized the bootstrap fully
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