Skip to content

runtime: harm! macro#55

Merged
monoid merged 2 commits into
masterfrom
runtime/harm-macro
May 11, 2026
Merged

runtime: harm! macro#55
monoid merged 2 commits into
masterfrom
runtime/harm-macro

Conversation

@monoid
Copy link
Copy Markdown
Owner

@monoid monoid commented May 11, 2026

A convenience harm! macro.

Summary by CodeRabbit

  • New Features

    • Added a new harm! macro for streamlined instruction assembly with built-in error propagation and support for trailing commas.
  • Chores

    • Re-exported core assembler types at the crate root for easier access.

Review Change Stack

@monoid monoid self-assigned this May 11, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3535d697-16ed-4960-88c0-1c25f52c83a9

📥 Commits

Reviewing files that changed from the base of the PR and between ae1f9fb and 19e5859.

📒 Files selected for processing (1)
  • harm-runtime/src/macros.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • harm-runtime/src/macros.rs

📝 Walkthrough

Walkthrough

A new harm! macro sequences instruction appends on an assembler and returns the first error or Ok(()). The macro is exported and re-exports Assembler and AssemblerError at crate root; two unit tests were updated to use the macro. A minor enum formatting change was made.

Changes

Instruction Sequencing Macro

Layer / File(s) Summary
Macro Definition and Test
harm-runtime/src/macros.rs
harm! macro accepts an assembler and instruction sequence, appends each instruction, and propagates the first error or returns Ok(()). Dedicated feature-gated test exercises the macro with two instructions.
Crate-Level Re-exports
harm-runtime/src/lib.rs
Module macros declared with #[macro_use]; Assembler and AssemblerError re-exported from runtime at crate root.
Test Refactoring
harm-runtime/src/runtime.rs
Two unit tests (test_assembler_build, test_assembler_aarch64_execute) replace explicit asm.append() chains with single harm! { asm; ... } blocks followed by .unwrap().
Formatting
harm-runtime/src/runtime.rs
Blank line added in AssemblerError enum between PositionedMemory and ExecutableMemory variants.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested labels

harm

"A rabbit tapped the keyboard bright,
Lined up insts to stream them right,
One macro call to bind the queue,
Errors surface, builds run true,
🐇✨"

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'runtime: harm! macro' directly and concisely describes the main change: introduction of a new harm! macro in the runtime module.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch runtime/harm-macro

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@monoid monoid added enhancement New feature or request runtime The `harm`'s runtime: memory mappings, applying relocations, etc. labels May 11, 2026
@monoid
Copy link
Copy Markdown
Owner Author

monoid commented May 11, 2026

@coderabbitai please, review.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

@monoid Sure! I'll start reviewing the PR right away.

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@monoid monoid merged commit a6edde4 into master May 11, 2026
2 checks passed
@monoid monoid deleted the runtime/harm-macro branch May 11, 2026 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request runtime The `harm`'s runtime: memory mappings, applying relocations, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant