HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
drh
lcc
C2012–2023
drh / lcc

lcc

The lcc retargetable ANSI C compiler

6Distinct people
6Mentions
1Explicit recommenders
2.6KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

The lcc retargetable ANSI C compiler

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

I have written the Go arm64 and sparc64 compilers, as well as several other proprietary production compilers for several languages. The Dragon Book is the best, for sure, and…

4ad used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:03:16 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year6 dated mentions

Observed mentions: 2012-07-21 08:45:48 UTC to 2023-08-12 21:09:36 UTC.

0122012-01-01 00:00:00 UTC to 2013-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20122013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20172018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2023

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20122012-01-01 00:00:00 UTC2013-01-01 00:00:00 UTC101
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC000
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC101
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC202
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC000
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC000
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC000
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC101
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC000
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC000
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC000
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC101

What Hacker News says

6 sources
Those aren’t necessarily written as people would do it today, but Knuth’s literate sources for TeX[1] and METAFONT[2] are explicitly meant for reading. The literate program family also includes LCC[3], but A retargetable C compiler is a book that you’d need to buy; and PBRT[4], but Physically based rendering is more exposition than program (even if the program is a perfectly good one). The source for Unix V6[5] with the accompanying commentary by Lions is probably as much of a classic as it’s possible to get. And as an eccentric choice in a similar format, may I suggest cmForth[6], perhaps paired with Footsteps in an empty valley[7]? Also, though this is not precisely what you’re asking for, The architecture of open-source applications and its sequels[8] have the original designers’ reflections on some well-known codebases. [1] http://mir
Read the rest
In Exploring the Internals of Linux v0.01
4ad·Nov 12, 2019Recommendation phrase
I have written the Go arm64 and sparc64 compilers, as well as several other proprietary production compilers for several languages. The Dragon Book is the best, for sure, and in my opinion essential material. Many people find its style too dry. It's basically a reference, not a tutorial. If you want something more hands on, I recommend this book about LCC[1]. It covers LCC, which is a C compiler. It's not a generic book about writing compilers, but I believe to be very useful anyway because it's very hands on. The current version of LCC is here[2]: Not sure if you can regenerate the book out of the current code or not (LCC is written in literate programming style, and the book used to be just the literate part). [1] A Retargetable C Compiler: Design and Implementation (Addison-Wesley, 1995, ISBN 0-8053-1670-1) [2] https://github.com/drh/l
Read the rest
In GNU Compiler Collection Internals [pdf]
From the thesis abstract: >"Included with this thesis is a portable C compiler for stack machines, which incorporates these new register allocation methods. The C compiler and associated tools (assembler, linker and simulator) are included in the CD." I looked at Mark Shannon's page below but didn't find a link to an ISO image of the mentioned CD. http://www.dcs.gla.ac.uk/~marks/ As far as I can tell from a quick (and very casual) skimming, Mark's lcc-s is implemented as a backend for lcc. http://www.cs.princeton.edu/software/lcc/ https://sites.google.com/site/lccretargetablecompiler/ https://github.com/drh/lcc/tree/master If anyone has found the mentioned lcc-s code, please post a link.
In A C Compiler for Stack Machines (2006) [pdf]
This is a technique I first came across in the code for lcc, as described in David R. Hanson's book "A Retargetable C Compiler: Design and Implementation". https://sites.google.com/site/lccretargetablecompiler/ The code in that book feels pretty dated in a lot of places, but this was a neat trick. Every piece of information related to a token is defined in one place: https://github.com/drh/lcc/blob/master/src/token.h Then here's how it's used: https://github.com/drh/lcc/blob/master/src/expr.c#L8 https://github.com/drh/lcc/blob/master/src/output.c#L107
In Show HN: A small virtual machine written in C

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.