HeadlinesBriefing favicon HeadlinesBriefing.com

Riscrithm: Macro-Assembly Language Bridges High-Level Syntax to RISC-V

Hacker News •
×

Riscrithm emerged as a lightweight macro-assembly dialect that transforms readable code into pure RISC-V assembly. The project targets developers needing deterministic hardware control without sacrificing high-level expressiveness. Its design philosophy centers on minimal boilerplate while maintaining direct compilation to human-readable assembly output.

The toolchain uses a straightforward CLI interface: `riscrithm source.rthm output.s [-o]` handles compilation with optional optimization passes. Files require explicit header and entrypoint declarations at the top, followed by indented instruction blocks. Macros defined with the `define` keyword enable register aliasing and inline function creation, supporting cleaner abstraction layers.

Code organization relies on strict indentation rules, with labels ending in colons and raw assembly blocks prefixed by `!!`. The language supports arithmetic operators, bitwise operations, and stack/heap memory access through intuitive syntax that maps directly to underlying hardware instructions. Branching uses ternary-style conditionals that compile to appropriate RISC-V branch instructions.

This approach appeals to embedded systems developers who want high-level readability without runtime overhead. By eliminating abstraction layers between source and assembly, Riscrithm provides the control of hand-written assembly with significantly improved developer experience.