Skip to content

Type Inference#58

Open
JTrenerry wants to merge 152 commits into
mainfrom
type-inference
Open

Type Inference#58
JTrenerry wants to merge 152 commits into
mainfrom
type-inference

Conversation

@JTrenerry

@JTrenerry JTrenerry commented Feb 23, 2026

Copy link
Copy Markdown
Collaborator

Progress

  • Type inferencing
    • Constraint generation (Relies on SVA)
    • Type coalescing
    • Type Automata
    • Type lowering
      • Remove Ep
      • Merge Nodes (old code in git so should be simple)
      • mini Unsure if this does anything of value
    • Transform
      • Add in new expressions
      • Type transform
        • type decls
        • Exprs
        • stmts
        • function in / out
          attrib
(load-il "examples/irreducible_loop_1.il")
(run-transforms "ssa")
(run-transforms "cf-expressions")
(run-transforms "simplify")
(run-transforms "cf-expressions")
(dump-il "before.il")
(run-transforms "type-check")
(run-transforms "type-inference")
(run-transforms "type-check")
(dump-il "after.il")

Note: SVA does not net very good results in most cases

I ticked everything off mainly to feel good, it does not work amazingly atm

Testing

The current testing is just, type inference loops and does it type check and look the same as the last time I type inferred.

There are some functions that have test cases, but I want to add some more to this.

Since analyse is in its own function, I should be able to do cram tests without needing diff, and possibly using leq instead of equal, but that might not be amazing

@JTrenerry JTrenerry self-assigned this Feb 23, 2026
@JTrenerry JTrenerry added the enhancement New feature or request label Feb 23, 2026
@JTrenerry JTrenerry force-pushed the type-inference branch 4 times, most recently from 8489b31 to 6bab69a Compare March 2, 2026 03:42
@JTrenerry JTrenerry marked this pull request as ready for review March 2, 2026 07:15
@JTrenerry JTrenerry requested a review from agle March 2, 2026 07:15
@agle agle changed the title Type Inferencing & SVA Type Inference & SVA Mar 4, 2026
@JTrenerry JTrenerry mentioned this pull request Mar 5, 2026
@JTrenerry JTrenerry marked this pull request as draft March 5, 2026 01:02
@JTrenerry JTrenerry force-pushed the type-inference branch 3 times, most recently from 4e2f24d to deb3282 Compare March 13, 2026 04:22
@JTrenerry JTrenerry force-pushed the type-inference branch 3 times, most recently from 6fedca3 to 977c758 Compare March 20, 2026 00:02
@JTrenerry JTrenerry force-pushed the type-inference branch 2 times, most recently from 8b595f2 to 6da8e42 Compare April 9, 2026 01:49
@JTrenerry JTrenerry mentioned this pull request Apr 9, 2026
Merged
@JTrenerry JTrenerry force-pushed the type-inference branch 2 times, most recently from 784f8d9 to d3a43d2 Compare April 14, 2026 01:01
@JTrenerry JTrenerry changed the title Type Inference & SVA Type Inference Apr 14, 2026
@JTrenerry JTrenerry force-pushed the type-inference branch 4 times, most recently from db9bcd9 to 6e9cf45 Compare April 17, 2026 03:21
@JTrenerry JTrenerry force-pushed the type-inference branch 2 times, most recently from 3e304cd to 2c129dd Compare April 26, 2026 23:29
@JTrenerry JTrenerry requested a review from katrinafyi as a code owner May 27, 2026 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant