微型 C 编译器
Tiny C Compiler

原始链接: https://bellard.org/tcc/

## Tiny C 编译器 (TCC) 概要 TCC 是一款非常小巧、快速且多功能的 C 编译器,专为资源受限的环境设计——甚至可以放入救援盘(约 100KB)。 与使用字节码的编译器不同,TCC 直接生成 x86 代码,从而显著提高了编译速度——在大型项目(76936 行代码)中,速度可达 GCC 的 9 倍。 TCC 旨在完全符合 ISO C99 标准,并支持动态库。 它允许直接执行 C 源代码,无需单独的链接或汇编步骤,甚至支持带有简单 shebang 行的 C 脚本。 内置的内存和边界检查器增强了代码安全性。 此外,TCC 可以通过 `libtcc` 用作动态代码生成的后端。 虽然开发速度有所放缓,但它仍然是特定用例的强大选择,并采用 GNU Lesser General Public License 许可。

Hacker News 新闻 | 过去 | 评论 | 提问 | 展示 | 工作 | 提交 登录 Tiny C 编译器 (bellard.org) 8 分,guerrilla 发表于 44 分钟前 | 隐藏 | 过去 | 收藏 | 2 条评论 rustyhancock 4 分钟前 [–] TCC 真是一段回忆! 看到它不再维护(8 年前!)并不感到惊讶。即使在太字节 NVMe 驱动器的时代,安装 MSVC 时我的眼睛也会湿润(通常只是为了链接器!) antirez 1 分钟前 | 父评论 [–] 我认为,这正是人工智能和开源的许多联系点所在。 像 TCC 这样的项目,拥有一个好的编码代理和一个关心项目并对其有足够了解的开发者,可以变成一个可以维护的项目,而无需通常所需的大量精力,从而导致项目被放弃。 我正在复活许多我不再有时间处理的项目,比如 dump1090、linenoise…… 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文
TCC : Tiny C Compiler

Tiny C Compiler

News

[Note: I am no longer working on TCC. Check the mailing list to get up to date information.]

Features

  • SMALL! You can compile and execute C code everywhere, for example on rescue disks (about 100KB for x86 TCC executable, including C preprocessor, C compiler, assembler and linker).
  • FAST! tcc generates x86 code. No byte code overhead. Compile, assemble and link several times faster than GCC.
  • UNLIMITED! Any C dynamic library can be used directly. TCC is heading torward full ISOC99 compliance. TCC can of course compile itself.
  • SAFE! tcc includes an optional memory and bound checker. Bound checked code can be mixed freely with standard code.
  • Compile and execute C source directly. No linking or assembly necessary. Full C preprocessor and GNU-like assembler included.
  • C script supported : just add '#!/usr/local/bin/tcc -run' at the first line of your C source, and execute it directly from the command line.
  • With libtcc, you can use TCC as a backend for dynamic code generation.

Compilation Speed

Compilation speed for the Links Browser project. There are 76936 lines (including headers). 1950947 lines (67.2 MBytes) are compiled because the same headers are included in many files. TinyCC is about 9 times faster than GCC.
CompilerTime(s)lines/secondMBytes/second
TinyCC 0.9.22 2.27 859000 29.6
GCC 3.2 -O0 20.0 98000 3.4

Measures were done on a 2.4 GHz Pentium 4. Real time is measured. Compilation time includes compilation, assembly and linking.

More up to date tests are available: 1, 2, 3, 4.

You want to help ?

Here are some suggestions:
  • Report bugs to the mailing list (and eventually fix them).

Links

License

TCC is distributed under the GNU Lesser General Public License.
Copyright (c) 2001-2018 Fabrice Bellard
Fabrice Bellard - https://bellard.org/ - https://bellard.org/tcc/
联系我们 contact @ memedata.com