Skip to content

C gen: typed locals#274

Closed
osa1 wants to merge 39 commits intomainfrom
c_gen_types
Closed

C gen: typed locals#274
osa1 wants to merge 39 commits intomainfrom
c_gen_types

Conversation

@osa1
Copy link
Member

@osa1 osa1 commented Jan 21, 2026

TODO:

  • The types returned during lowering are not quite right in some cases.. How are they used? Check if we can remove them.

  • If and match expressions are handled in a really hacky way. We don't know their types, try to "infer" them in a hacky way during lowering, and then add a bunch of hacks on top in C gen to handle branches that return different typed, but ignored, values. (i.e. when type of the whole thing is ())

    We should just add types to all front-end expressions (front-end, mono, lowered). It was fine in the past as the interpreter didn't care about the types and the initial C backend had everything as uint64_t, but clearly they're useful and even required in many cases if we want to generate typed code.

@osa1 osa1 marked this pull request as ready for review January 24, 2026 17:02
This was referenced Jan 25, 2026
@osa1 osa1 closed this Jan 26, 2026
@osa1 osa1 deleted the c_gen_types branch January 26, 2026 18:01
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