HackerTrans
TopNewTrendsCommentsPastAskShowJobs

patrick-ghetea

no profile record

Submissions

Riscrithm (v1.1) – An intuitive RISC-V assembler and optimizer written in Go

github.com
4 points·by patrick-ghetea·letzten Monat·2 comments

Riscrithm – An intuitive RISC-V assembler and optimizer coded in Go

github.com
32 points·by patrick-ghetea·vor 2 Monaten·13 comments

Show HN: Filorithm – Expressive eDSL for File and Folder Management in Python

github.com
3 points·by patrick-ghetea·vor 2 Monaten·0 comments

comments

patrick-ghetea
·letzten Monat·discuss
Hi Benji, I tried to reply to your comment earlier, but it seems it didn’t go through, so I’m trying again to say that you’re right. I hope you enjoyed exploring (and maybe even using) Riscrithm. My goal was to make writing assembly cleaner while still giving developers full control. Sure, C is the standard now, but I hope Riscrithm can offer a fresh perspective on low-level coding.
patrick-ghetea
·letzten Monat·discuss
Riscrithm v1.1 is now available on GitHub, bringing a bunch of much-needed features to the language. You can check out the repository’s README.md for an in-depth presentation of the syntax, complete with code snippets for each section, as well as actual scripts alongside their respective assembly outputs (both with and without optimization). This version is built on top of v1.0, so the parser might look a bit rough. I plan to refactor and clean it up, but it may take a while before another release comes out. Riscrithm v1.1 is designed to provide everything a developer needs for writing low-level code, especially assembly. If you have questions about the syntax or design choices, feel free to ask, though there might be some delays in my replies. Lastly, this release includes compiled binaries of the parser for Windows, Linux, and Apple (both Intel and Apple Silicon), so you can just clone the repository and start using it. Enjoy writing assembly without the boilerplate!
patrick-ghetea
·letzten Monat·discuss
[dead]
patrick-ghetea
·letzten Monat·discuss
To answer this follow-up, Benji, the syntax was designed so the learning curve isn’t too steep for people coming from languages like C/C++, even if I think that analogy is wrong, Riscrithm isn’t trying to be another C, as that would just be a cheap and worse copy. My goal is to allow people writing drivers or high-performance code to focus on structuring their logic without the compiler abstracting it into ambiguous implementations. Also, it’s great seeing you using a Pico; working with microcontrollers is fantastic, and I think it would be nice if you considered running Riscrithm on it—especially v1.1. Let’s be honest, v1.0 was an MVP, while v1.1 aims to bring all the features that will appear in v2.0, which will largely improve the compiler’s structure and make the language cleaner. I also appreciate your curiosity about what might emerge, and I want to assure you that I’ll do my best to make it a great language!
patrick-ghetea
·letzten Monat·discuss
Hi Benji, sorry for the late reply. I saw you were really interested in it, and I hope my comment answers your questions. Strict macro checking (using the 'define' keyword) and register validation (including case checks to ensure consistent coding) will be implemented in version 2.0. Right now, it doesn’t strictly throw an error if a line is wrong in all contexts, but in the final assembly, the invalid lines won’t compile anyway. You’re right, and I’ll definitely include such checks in Riscrithm v2.0. Also, if you want to check out my new release, Riscrithm v1.1 is now available on GitHub.

For your second point, yes, RISC-V assemblers sometimes transform written assembly into their equivalent instructions (e.g., 'mv foo, bar' becomes 'addi foo, bar, 0'). Riscrithm uses normal RISC-V syntax (like 'ret' or 'nop' keywords rather than the true on-metal command). This doesn’t mean we lose assembly’s flexibility—commands are always as close to the metal as possible. Keywords like 'swap' of course expand into more lines of code, but these are always clear expansions the developer can understand and verify anytime. The goal of Riscrithm is to make writing assembly simpler and cleaner, which is why I focus on mapping instructions clearly to their true on-metal equivalents. If you want to see which instructions expand into what, you can check the Developer Manual, which now includes four Riscrithm v1.1 examples with their corresponding assembly. Again, great points and comments—I really appreciate them!
patrick-ghetea
·letzten Monat·discuss
Hi 'sph', sorry for the late reply, but I’ve been working on version 1.1. You’re absolutely right about cleaning up the code. Honestly, I’m not a Go programmer with extensive experience in the language, but that doesn’t mean I made it just for the sake of it! The code is admittedly rough, having been put together over a weekend—it’s more of a Minimum Viable Product than anything else. Version 2.0 will be a more professional implementation with a much cleaner codebase. If you’d like to check out or use Riscrithm v1.1 (which has many more useful features), I highly recommend visiting the repository!
patrick-ghetea
·vor 2 Monaten·discuss
Hi Joker_vD, I really appreciate the comment and you’re mostly right—C was meant to be a portable assembly language that abstracts developers from machine instructions. Riscrithm isn’t trying to be a worse copy of C; it would be impossible for a single developer to match it. Instead, Riscrithm is meant to make writing RISC-V assembly simpler while maintaining a 1:1 relationship between Riscrithm lines and assembly lines. When writing a driver, you often need to use assembly, and with Riscrithm, you know exactly what each line does and how it’s translated. In contrast, with C/C++ or others, a single line of code can expand into many more assembly lines. This is just v1.0.0 (which I wrote in my free time this weekend), and v1.1.0 is coming soon with better features—I hope you’ll check it out! I should also apologize for the delay in my reply, but the time difference is quite the buzzkill!
patrick-ghetea
·vor 2 Monaten·discuss
Riscrithm is an intuitive RISC-V assembler designed to make writing assembly simpler. Its syntax is meant to be clean while staying strictly aligned with native machine instructions. The GitHub repository offers a detailed description of Riscrithm v1.0.0, along with a Developer Manual in the README.md for an deep dive into its syntax (the README.md also includes a short summary of what v1.1.0 will include). While v1.0.0 isn’t perfect, work is underway on version 1.1.0, which will add important new features to the language. The compiler is written in Go, with versions available for Windows, Linux, and Apple (both AMD64 and ARM64). For any further questions, feel free to leave a comment on the post.
patrick-ghetea
·vor 2 Monaten·discuss
[flagged]