Simple code generator and CLI redesign #10

Merged
HEL merged 5 commits from feat/code-generator into main 2026-06-15 12:29:22 +00:00
Owner

This PR implements a simple code generator which simply removes type annotations and unwraps cast expressions to produce interpretable Python code.
It also includes a complete redesign of the CLI, cleanly separating commands in different files, and simplifying the overloaded ones.
The new CLI includes the following commands:

CommandDescription
midas check <file.py> [--types <file.midas>]
Run type checker and report diagnostics
midas types <file.py> [--types <file.midas>]
Print typing judgements for all expressions
midas dump-registry [--types <file.midas>]
Show the whole types registry
midas parse <file.{midas,py}>
Parse and pretty-print AST
midas validate <file.midas>
Validate Midas definitions
midas compile <file.py> [--types <file.midas>]
Compile source
This PR implements a simple code generator which simply removes type annotations and unwraps cast expressions to produce interpretable Python code. It also includes a complete redesign of the CLI, cleanly separating commands in different files, and simplifying the overloaded ones. The new CLI includes the following commands: <table> <thead><tr><th>Command</th><th>Description</th></tr></thead> <tbody> <tr> <td> ```shell midas check <file.py> [--types <file.midas>] ``` </td> <td>Run type checker and report diagnostics</td> </tr> <tr> <td> ```shell midas types <file.py> [--types <file.midas>] ``` </td> <td>Print typing judgements for all expressions</td> </tr> <tr> <td> ```shell midas dump-registry [--types <file.midas>] ``` </td> <td>Show the whole types registry</td> </tr> <tr> <td> ```shell midas parse <file.{midas,py}> ``` </td> <td>Parse and pretty-print AST</td> </tr> <tr> <td> ```shell midas validate <file.midas> ``` </td> <td>Validate Midas definitions</td> </tr> <tr> <td> ```shell midas compile <file.py> [--types <file.midas>] ``` </td> <td>Compile source</td> </tr> </tbody> </table>
HEL self-assigned this 2026-06-15 12:29:10 +00:00
HEL added 5 commits 2026-06-15 12:29:10 +00:00
HEL merged commit 119c262da4 into main 2026-06-15 12:29:22 +00:00
HEL deleted branch feat/code-generator 2026-06-15 12:29:23 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: HEL/midas#10