Repository navigation
native: typed emit and pyfun build for projects - #158
Merged
Merged
Conversation
Project lowering now receives each module's resolved types (already computed in the per-module pass for float literals), so every module's top-level functions are annotated in native mode, and Option/Result spell through the classes a project imports from _pyfun_rt. pyfun build --native accepts a project: every module is built by mypyc in one go and the shared _pyfun_rt.py stays Python. native-bench gains a step that builds examples/modules natively and diffs its output against pyfun run.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extends #155/#156 from single files to multi-file projects.
project::compile_withalready type-checks each module in topological order (for float literals and codecs); in native mode it now also keeps each module's resolved types and hands them tolower_in_project, so every module's top-level functions get annotations.Option/Resultspell through the classes a project imports from_pyfun_rt(def lookup(key: int) -> Some | None_:).pyfun build --nativefor projects: every module is written to<dir>, all but_pyfun_rt.pygo through one mypyc invocation, and the runtime stays Python (the compiled modules import it like any other module).__main__.pyimports the entry module.native-benchgains a step that buildsexamples/modulesnatively on Linux and diffs its output againstpyfun run.Locally (Windows): the project passes mypy and reaches mypyc's
build_extfor a shared extension of all three modules, stopping only for the missing MSVC Build Tools. The Linux run is in this PR's checks. DESIGN §5.6, ROADMAP and the README section updated.