nowfound

Dev tools · October 22, 2024

Optimizing compiler for a large subset of C, written in Rust

Hello. I wanted to share what I had been working on for the past couple of months or so. It's an optimizing C compiler for a large subset of the C programming language written in Rust. It's basically a Rust implementation of the C compiler from Nora Sandler's book[1]. It has been a great educational exercise and I wholeheartedly recommend it to everyone. [1]: https://nostarch.com/writing-c-compiler

Optimizing compiler for a large subset of C, written in Rust launched on October 22, 2024 with 11 votes, #1,114 of 5,185 launches that month and more than 75% of that year's launches. The site was still online in September 2026, 1 year on.

Visit github.com ↗Alternativestop 21% of October 2024

In plain words

This is an optimizing C compiler written in Rust that supports a large subset of the C language. It is designed for developers and students interested in compiler development and implementation. The compiler is based on the educational approach from Nora Sandler's book "Writing a C Compiler" and serves as a practical learning project demonstrating compiler optimization techniques and C language compilation.

written from the facts on this page · September 2026

From the sources

A micro C compiler for x86-64. Contribute to xqb64/ucc development by creating an account on GitHub.

This is a Rust implementation of the C compiler from Nora Sandler's book. At the forefront is the compiler driver, which orchestrates the compilation process---from lexing and parsing, through several stages of semantic analysis, such as variable resolution, loop labeling, and type checking. After generating an intermediate representation (IR), the compiler passes it through an iterative optimization pipeline. This pipeline leverages forward and backward data-flow analysis, liveness analysis, and address-taken analysis to implement optimizations such as constant folding, unreachable code elimination, copy propagation, and dead store elimination. Finally, it generates and optimizes the…from github.com

Does a similar job

all alternatives →
  • I'm making a dynamic language in Rust2022 · github.com · ▲184

    An implementation of a dynamic programming language in Rust. Includes: Parser/Compiler, REPL, Virtual Machine, Bytecode Disassembler This started out as a learning project to teach myself Rust. It has grown into a decently substantial piece of software and I've learned quite a bit in the process! Some neat things: + A garbage collector that can store dynamically sized types without any double-indirection (i.e. I have my own Box implementation with manual alloc/dealloc) + The smart pointer used to reference GCed data is a thin pointer. The ptr metadata needed for DSTs is stored in…

  • A work-in-progress C compiler from scratch2021 · github.com · ▲159

    Programming language that compiles into a x86 ELF executable. - riicchhaarrd/ocean

  • How to write a tiny compiler2017 · blog.klipse.tech · ▲224

    Write your own compiler: introduction. Code genetation. AST. Abstract syntax tree. lisp. javascript.

  • My own C compiler (just for fun)2016 · github.com · ▲175

    rcor C compiler (under development). Contribute to rcorcs/rcc development by creating an account on GitHub.

  • GI
    Going into freshman year, figured I should build an interpreter2023 · ▲138

    Hi all! I'm going into my freshman year, and figured that the best way to prepare for the intro to programming Racket course would be to implement my own garbage-collected, dynamically typed, functional programming language in C ;) Anyways... here's the repo: https://github.com/liam-ilan/crumb I started learning C over the summer, so I still have a whole lot to learn... Any feedback would be greatly appreciated! :D

  • My C compiler compiled itself2024 · github.com · ▲275

    One of the most challenging projects of my life :)

More dev tools this month

the category →
  • /dev/null▲468

    a social network for devs

    Dev tools · 2d ago · dev-null.sh

  • open-source IDE for thoughtful software design. Contribute to devdotfast/whiteboard development by creating an account on GitHub.

    Dev tools · 27d ago · github.com

  • Contribute to reladraw/reladraw development by creating an account on GitHub.

    Dev tools · 25d ago · github.com

  • OpenBot▲362

    Grok Bot alternative: free, local, open-source, multiplayer

    Dev tools · 22d ago · openbot.run

  • Talanoa▲340

    Hi HN, I’m a fullstack developer, and honestly, I’ve lost count of how many side projects I’ve worked on over the years. But one idea kept coming back to me: a different kind of email client. It first came to me in 2014: “What if we could handle emails more like conversations?” Every year, I’d revisit this concept in my “Build Notes.” Ten years later, no one had built exactly what I had in mind — so I finally decided to do it myself. That’s how Talanoa was born. I wanted something focused on people, not timelines. I was tired of marking messages as unread just to remember to reply later, or…

    Dev tools · 20d ago · talanoa.email

  • CoreSpeed▲332

    One MCP for everything your agents need: apps, memory, tools

    Dev tools · 27d ago · corespeed.io

Source: Show HN post ↗

Launched alongside, October 2024

the whole month →
  • buzzabout▲1,267

    Audience insights from 1B+ online discussions in 2 mins

    AI · 2024 · buzzabout.ai

  • bolt.new▲1,230

    Build and scale high-performing websites & apps using your words. Join millions and start building today.

    AI · 2024 · bolt.new

  • Feta▲1,217

    Run smarter stand-ups, build better products

    AI · 2024 · feta.io

  • Trag▲955

    AI code review companion

    AI · 2024 · usetrag.com

  • Turn Notion databases into portals & apps with no code

    Dev tools · 2024 · softr.io

  • One inbox for all your work discussions

    Work · 2024 · generalcollaboration.com