vx-lang / vx-lang/Vx

[Phase 1] Lower Algebraic Data Types (Enums) to MLIR

Open
#98 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

codegen enhancement
Dominant language
Rust
Stars
14
Forks
2
Avg merge
12h 42m
Merged PRs (30d)
61

Description

Currently, the Vx compiler supports Algebraic Data Types (Enums with data payloads) in the Lexer, Parser, AST, and Sema phases. We need to implement the lowering of these Enums to MLIR in src/codegen/generator.rs.

Tasks:

  • Implement tagged union lowering for Enums.
  • Each enum instance should be lowered as a tagged struct/union containing its variants' payloads.
  • Update lower_type to correctly map Type::Enum to an appropriate MLIR tuple/struct type representing the tagged union.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/codegen/generator.rs and inspect the existing MLIR lowering paths, especially lower_type. Trace how enum variants and their payload types are represented before implementing tagged union lowering. Done means enum instances lower to tagged struct/union values and Type::Enum maps to an appropriate MLIR tuple or struct type.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.