LCC (compiler)

Last updated
LCC
Developer(s) Dave Hanson and Chris Fraser
Initial release1994;30 years ago (1994)
Stable release
4.2 / September 4, 2002;21 years ago (2002-09-04)
Written in C
Operating system Cross-platform
Type Compiler
License LCC License [1]
Website drh.github.io/lcc/

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, [2] 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. [1] It was developed by Chris Fraser and David Hanson.

Contents

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. [3]

The source code for LCC is around 20,000 lines, which is much smaller than many major compilers. [4]

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. [5]

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. [6] This means that modules are oblivious to the system beyond the system calls and limited file system scope offered 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. [7]

Pelles C

Pelles C's compiler is a heavily modified version of LCC providing C11 as well as C17 support, amd64 support, additional optimisation techniques such as inline expansion [8] and an IDE.

MathWorks

For 32-bit Windows machines, Lcc is used as a default if no other compiler is installed for MathWorks MATLAB and related products. [9]

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. [1]

See also

Related Research Articles

<span class="mw-page-title-main">Blitz BASIC</span>

Blitz BASIC is the programming language dialect of the first Blitz compilers, devised by New Zealand-based developer Mark Sibly. Being derived from BASIC, Blitz syntax was designed to be easy to pick up for beginners first learning to program. The languages are game-programming oriented but are often found general purpose enough to be used for most types of application. The Blitz language evolved as new products were released, with recent incarnations offering support for more advanced programming techniques such as object-orientation and multithreading. This led to the languages losing their BASIC moniker in later years.

<span class="mw-page-title-main">Qt (software)</span> Object-oriented framework for software development

Qt is cross-platform software for creating graphical user interfaces as well as cross-platform applications that run on various software and hardware platforms such as Linux, Windows, macOS, Android or embedded systems with little or no change in the underlying codebase while still being a native application with native capabilities and speed.

<span class="mw-page-title-main">D (programming language)</span> Multi-paradigm system programming language

D, also known as dlang, is a multi-paradigm system programming language created by Walter Bright at Digital Mars and released in 2001. Andrei Alexandrescu joined the design and development effort in 2007. Though it originated as a re-engineering of C++, D is now a very different language drawing inspiration from other high-level programming languages, notably Java, Python, Ruby, C#, and Eiffel.

The Microsoft Macro Assembler (MASM) is an x86 assembler that uses the Intel syntax for MS-DOS and Microsoft Windows. Beginning with MASM 8.0, there are two versions of the assembler: One for 16-bit & 32-bit assembly sources, and another (ML64) for 64-bit sources only.

In software engineering, retargeting is an attribute of software development tools that have been specifically designed to generate code for more than one computing platform.

David R. Hanson is a software engineer who worked at Google until he retired in January 2012, working in programming languages, compilers, software tools, and programming environments. Before joining Google, he was with Microsoft Research, Princeton, University of Arizona, and Yale. He has written many journal and conference papers and two books: A Retargetable C Compiler: Design and Implementation with Christopher Fraser, which describes lcc, a widely used compiler for Standard C, and C Interfaces and Implementations: Techniques for Creating Reusable Software.

mod_mono is a module for the Apache HTTP Server that allows for hosting of ASP.NET pages and other assemblies on multiple platforms by use of the Mono development platform.

<span class="mw-page-title-main">Watcom C/C++</span>

Watcom C/C++ is an integrated development environment (IDE) product from Watcom International Corporation for the C, C++, and Fortran programming languages. Watcom C/C++ was a commercial product until it was discontinued, then released under the Sybase Open Watcom Public License as Open Watcom C/C++. It features tools for developing and debugging code for DOS, OS/2, and Windows, Linux operating systems, which are based upon x86, IA-32, x86-64 compatible processors.

<span class="mw-page-title-main">Code::Blocks</span> Free and open source, cross-platform IDE

Code::Blocks is a free, open-source cross-platform IDE that supports multiple compilers including GCC, Clang and Visual C++. It is developed in C++ using wxWidgets as the GUI toolkit. Using a plugin architecture, its capabilities and features are defined by the provided plugins. Currently, Code::Blocks is oriented towards C, C++, and Fortran. It has a custom build system and optional Make support.

The following tables list notable software packages that are nominal IDEs; standalone tools such as source-code editors and GUI builders are not included. These IDEs are listed in alphabetic order of the supported language.

TypeScript is a free and open-source high-level programming language developed by Microsoft that adds static typing with optional type annotations to JavaScript. It is designed for the development of large applications and transpiles to JavaScript. Because TypeScript is a superset of JavaScript, all JavaScript programs are syntactically valid TypeScript, but they can fail to type-check for safety reasons.

Web2py is an open-source web application framework written in the Python programming language. Web2py allows web developers to program dynamic web content using Python. Web2py is designed to help reduce tedious web development tasks, such as developing web forms from scratch, although a web developer may build a form from scratch if required.

<span class="mw-page-title-main">Node.js</span> JavaScript runtime environment

Node.js is a cross-platform, open-source JavaScript runtime environment that can run on Windows, Linux, Unix, macOS, and more. Node.js runs on the V8 JavaScript engine, and executes JavaScript code outside a web browser.

<span class="mw-page-title-main">PyCharm</span> Python IDE

PyCharm is an integrated development environment (IDE) used for programming in Python. It provides code analysis, a graphical debugger, an integrated unit tester, integration with version control systems, and supports web development with Django. PyCharm is developed by the Czech company JetBrains.

<span class="mw-page-title-main">Mono (software)</span> Computer software project

Mono is a free and open-source .NET Framework-compatible software framework. Originally by Ximian, it was later acquired by Novell, and is now being led by Xamarin, a subsidiary of Microsoft and the .NET Foundation. Mono can be run on many software systems.

<span class="mw-page-title-main">Cloud9 IDE</span> Online integrated development environment

Cloud9 IDE is an Online IDE, published as open source from version 2.0, until version 3.0. It supports multiple programming languages, including C, C++, PHP, Ruby, Perl, Python, JavaScript with Node.js, and Go.

The Game Creators Ltd is a British software house based in Macclesfield, Cheshire, England, which specialises in software for video game development, originally for the Microsoft Windows platform. The company was established in March 1999 through a partnership between programmers Lee Bamber and Richard Vanner, who were joined by Meash Meakin in 2011 and Deborah Ascott-Jones in 2013.

References

  1. 1 2 3 "LCC License". GitHub . Retrieved 5 July 2011.
  2. "Official Github Repository". GitHub .
  3. Fraser, Christopher W.; Hanson, David R. (July 2001). "The lcc 4.x Code-Generation Interface" (PDF). Microsoft Research. Technical Report MSR-TR-2001-64. Retrieved 5 July 2011.
  4. Sao-Jie Chen, Guang-Huei Lin, Pao-Ann Hsiung, Yu-Hen Hu. "Hardware software co-design of a multimedia SOC platform". Section 5.6.1: LCC Compiler Infrastructure.
  5. Hanson, David R. (March 2004). "Lcc.NET: Targeting the .NET Common Intermediate Language from Standard C" (PDF). Microsoft Research. Retrieved 22 July 2012.
  6. "John Carmack's .plan file, 24 July, 1999". Archived from the original on 2008-05-12.
  7. lcc-win: A Compiler system for Windows
  8. Pelles C Overview
  9. "Build MEX-Files". Archived from the original on 14 September 2012. Retrieved 6 November 2013.

Bibliography