ArticleslgStudy

science

LCC (compiler)

LCC (compiler) is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand LCC (compiler) rather than just read about it. In short: LCC ("Local C Compiler" or "Little C Compiler") is a small, retargetable compiler for the ANSI C programming language. Although its source code is available at no charge for personal use, it is not open-source or free software according to the usual definitions because products derived from LCC may not be sold, although components not derived from LCC may be sold.

Key takeaways

  • LCC (compiler) belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect LCC (compiler) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of LCC (compiler) from memory before moving on to harder problems.

Reference excerpt

LCC ("Local C Compiler" or "Little C Compiler") is a small, retargetable compiler for the ANSI C programming language. Although its source code is available at no charge for personal use, it is not open-source or free software according to the usual definitions because products derived from LCC may not be sold, although components not derived from LCC may be sold. It was developed by Chris Fraser and David Hanson.

LCC LCC is intended to be very simple to understand and is well-documented; its design is described in Fraser and Hanson's book A Retargetable C Compiler: Design and Implementation. The book includes most of the source code for version 3.6 of the compiler, which was written as a literate program using noweb. As of July 2011 the current version of LCC is 4.2, but much of the book still applies to this version. The major change since the book was published is in the code-generator interface, which is described in a separate document. The source code for LCC is around 20,000 lines, which is much smaller than many major compilers. LCC can generate code for several processor architectures, including Alpha, SPARC, MIPS, and x86; there is also an LCC backend that generates Microsoft's Common Intermediate Language.

Projects incorporating LCC

Quake 3 id Software's id Tech 3 engine relies on a modified version of LCC to compile the source code of each game module or third-party mod into bytecode targeting its virtual machine. This means that modules are oblivious to the system beyond the limited functionality made available by the engine, which is intended to reduce the threat posed by malicious mod authors. Another consideration is that games and mods written for the engine are portable without recompilation; only the virtual machine needs to be ported to new platforms in order to execute the modules.

lcc-win lcc-win32 is an integrated development environment package for Microsoft Windows which includes a fork of LCC. An amd64 counterpart named lcc-win64 exists, which has been available since April 15, 2012.

Pelles C Pelles C is a heavily modified version of LCC providing C11 as well as C17 and C23 support, amd64 support, additional optimisation techniques such as inline expansion and an IDE.

MathWorks For Windows machines, Lcc was used as a default if no other compiler was installed for MathWorks MATLAB and related products up to version R2023b.

License LCC is free for personal use and may be redistributed provided all distribution media and product documentation acknowledges it. The LCC license relies on examples in multiple cases. LCC may not be sold for profit, but it may be included with other software that is sold for profit, provided LCC itself is distributed for free. Per user and unlimited use licenses are available by contacting Addison-Wesley, in particular for compilers of languages such as C++ for which a C compiler may constitute much of its work.

See also Tiny C Compiler Portable C compiler Small-C Comparison of integrated development environments

References

External links Official Pelles C IDE homepage

Bibliography Fraser, Christopher W.; Hanson, David R. (1995). A Retargetable C Compiler: Design and Implementation. Addison-Wesley. ISBN 0-8053-1670-1.

Worked examples

Example 1 — a first encounter with LCC (compiler)

Start with the simplest possible case. Write down what LCC (compiler) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to LCC (compiler) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about LCC (compiler) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of LCC (compiler)

In research
LCC (compiler) appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses LCC (compiler) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
LCC (compiler) is common in secondary-school and first-year university syllabi. It links to neighbouring topics C (programming language) compilers, so understanding it makes those chapters shorter.
In everyday life
Look for LCC (compiler) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “LCC (compiler)” →

How to study LCC (compiler) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what LCC (compiler) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain LCC (compiler) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is LCC (compiler) in simple terms?

LCC ("Local C Compiler" or "Little C Compiler") is a small, retargetable compiler for the ANSI C programming language. Although its source code is available at no charge for personal use, it is not open-source or free software according to the usual definitions because products derived from LCC may…

Why does LCC (compiler) matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study LCC (compiler)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on LCC (compiler).

Tags

  • C (programming language) compilers

Keep exploring