It's been over a year since my last post here. Since the end of the MicroC series, I've been hard at work on my thesis, Open Strings, a platform for string players to share fingerings for complex passages. In addition to allowing musicians to share fingerings, the Open Strings website includes an inference engine which, given a passage, will automatically come up with decent fingerings for it (currently violin only).
Announcing Open Stringshttps://blog.josephmorag.com/posts/thesis/ 2021-06-01
In our last post, we completed the backend stage of the compiler by emitting llvm assembly using llvm-hs-pure and llvm-hs-pretty and then calling clang on the file output. Here, we'll get a taste of how to use the ffi bindings in llvm-hs to do the same thing and also to perform stricter checks on our generated llvm code.
Micro C, Part 4: Integrating the LLVM FFIhttps://blog.josephmorag.com/posts/mcc4/ 2020-05-13
In part 2, we completed the user facing part of the compiler with semantic analysis. Now we're free to focus on the backend, generating LLVM. To do so, we'll use the llvm-hs-pure library, which embeds LLVM into a Haskell ADT, allowing us to manipulate it without having to set up any FFI.
Micro C, Part 3: Generating LLVMhttps://blog.josephmorag.com/posts/mcc3/ 2020-04-17
Having written the parser for our C dialiect in part 1, we now proceed to the semantic analysis pass. Here, our goal is to catch as many errors as possible before going on to code generation. In particular, we will be somewhat stricter than real C compilers and disallow implicit conversions because they are both annoying to implement and lead to subtle bugs.
Micro C, Part 2: Semantic Analysishttps://blog.josephmorag.com/posts/mcc2/ 2020-04-15
Welcome to the beginning of the compiler proper! If you haven't yet, check out part 0 for a description of the project and help setting up the development environment. A note about the presentation structure: We will be going through each phase of the compiler mostly in its entirety before moving onto the next phase.
Micro C, Part 1: Parsinghttps://blog.josephmorag.com/posts/mcc1/ 2020-04-10
In this series, we will explore how to write a compiler for a small subset of C to LLVM in Haskell. Our language, Micro C, is basically a small subset of real C. We'll have basic numeric types, a real bool type, pointers, and structs. At the end of the series, we'll have a beautiful executable, mcc (Micro C Compiler), that takes one .
Micro C, Part 0: Introductionhttps://blog.josephmorag.com/posts/mcc0/ 2020-04-08
I am a proud owner of both the Atreus and Keyboardio Model01 keyboards. They are both excellent pieces of hardware - wooden enclosures, mechanical switches, the works. With QMK, they are infinitely configurable. The creators are also very responsive. In the course of replacing the Matias Quiet Click switches with linear ones on my Atreus, I broke a couple keycaps and shorted part of the PCB.