Skip to content

Experiment: Compile down to machine instructions - #474

Merged
JSAbrahams merged 16 commits into
developfrom
feat-llvm-in-env
Aug 26, 2026
Merged

Experiment: Compile down to machine instructions#474
JSAbrahams merged 16 commits into
developfrom
feat-llvm-in-env

Conversation

@JSAbrahams

@JSAbrahams JSAbrahams commented Jun 23, 2025

Copy link
Copy Markdown
Owner

Summary

For fun, lets see how far we can get.

Doing this we also uncover some scoping bugs in our outputted Python.
Note that Mamba is stricter than Python with regards to scoping rules, so we need to take care of this in our output.

Added Tests

  • We now have some proper tests in execution.rs which check the output of our Mamba program via Python
  • And additionally check the output of our program if compiled

For both we execute and check the output via stdout.
Python output we run via a Python interpreter.

We test on MacOS, Windows, and Linux to see if compilation works as expected.

@JSAbrahams JSAbrahams self-assigned this Jun 23, 2025
@JSAbrahams JSAbrahams added the enhancement: generate New feature in the core module label Jun 23, 2025
@codecov

codecov Bot commented Jul 6, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.20810% with 139 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.31%. Comparing base (aa8541d) to head (9696562).

Files with missing lines Patch % Lines
src/backend/python/convert/class.rs 75.65% 28 Missing ⚠️
src/backend/cranelift/convert/definition.rs 90.00% 18 Missing ⚠️
src/backend/cranelift/convert/mod.rs 87.60% 15 Missing ⚠️
src/backend/cranelift/convert/call.rs 89.92% 13 Missing ⚠️
src/main.rs 0.00% 10 Missing ⚠️
src/backend/python/convert/mod.rs 94.97% 9 Missing ⚠️
src/backend/cranelift/convert/control_flow.rs 92.85% 8 Missing ⚠️
src/backend/cranelift/mod.rs 94.81% 7 Missing ⚠️
src/backend/python/ast/mod.rs 90.66% 7 Missing ⚠️
src/backend/cranelift/convert/operation.rs 93.68% 6 Missing ⚠️
... and 8 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #474      +/-   ##
===========================================
+ Coverage    90.73%   91.31%   +0.57%     
===========================================
  Files          103      113      +10     
  Lines        14746    15823    +1077     
===========================================
+ Hits         13380    14448    +1068     
- Misses        1366     1375       +9     
Files with missing lines Coverage Δ
src/backend/cranelift/result.rs 100.00% <100.00%> (ø)
src/backend/python/ast/node.rs 94.64% <ø> (ø)
src/backend/python/convert/builder.rs 91.66% <100.00%> (ø)
src/backend/python/convert/call.rs 75.00% <100.00%> (ø)
src/backend/python/convert/common.rs 100.00% <100.00%> (ø)
src/backend/python/convert/handle.rs 79.16% <100.00%> (ø)
src/backend/python/convert/range_slice.rs 92.15% <100.00%> (ø)
src/backend/python/convert/state.rs 97.10% <100.00%> (ø)
src/backend/python/result.rs 36.00% <ø> (ø)
src/backend/cranelift/primitive.rs 96.87% <96.87%> (ø)
... and 17 more

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Joel Abrahams added 2 commits August 26, 2026 12:27
The body should never leak out.
We do not override outer variable.
This is stricter than Python, if we define a new variable then it is
only scoped there.
We are, however, allowed te reassign to outer variables,
if mutable, of course.
This is required for MacOS.
Joel Abrahams added 2 commits August 26, 2026 13:13
Deal with some complex edge cases for min and max.
Relied heavily on Claude here in this case.
@JSAbrahams
JSAbrahams deployed to development August 26, 2026 11:55 — with GitHub Actions Active
@JSAbrahams
JSAbrahams deployed to development August 26, 2026 11:55 — with GitHub Actions Active
@JSAbrahams
JSAbrahams marked this pull request as ready for review August 26, 2026 11:55
@JSAbrahams
JSAbrahams deployed to development August 26, 2026 11:55 — with GitHub Actions Active
@JSAbrahams
JSAbrahams deployed to development August 26, 2026 11:55 — with GitHub Actions Active
@JSAbrahams
JSAbrahams deployed to development August 26, 2026 11:55 — with GitHub Actions Active
@JSAbrahams
JSAbrahams merged commit 383d3ed into develop Aug 26, 2026
6 checks passed
@JSAbrahams
JSAbrahams deleted the feat-llvm-in-env branch August 26, 2026 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement: generate New feature in the core module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant