C Icon

C

C is a general purpose programming language that first appeared in 1972.
4 Stories
All Topics

Richard Hipp sqlite.org

Richard Hipp's single file webserver written in C

Althttpd is a simple webserver that has run the sqlite.org website since 2004. Althttpd strives for simplicity, security, and low resource usage.

As of 2018, the althttpd instance for sqlite.org answers about 500,000 HTTP requests per day (about 5 or 6 per second) delivering about 50GB of content per day (about 4.6 megabits/second) on a $40/month Linode. The load average on this machine normally stays around 0.1 or 0.2. About 19% of the HTTP requests are CGI to various Fossil source-code repositories.

Richard has a knack for creating simple, high quality tools. When we did our (now legendary) show with him back in 2016, he was quite keen on coming back at some point to discuss Fossil. Should we make that happen?

Ars Technica Icon Ars Technica

“A damn stupid thing to do" (The origins of C)

Ars Technica goes long form for this (abridged) history of the C programming language.

In one form or another, C has influenced the shape of almost every programming language developed since the 1980s. Some languages like C++, C#, and objective C are intended to be direct successors to the language, while other languages have merely adopted and adapted C’s syntax. A programmer conversant in Java, PHP, Ruby, Python or Perl will have little difficulty understanding simple C programs, and in that sense, C may be thought of almost as a lingua franca among programmers.

But C did not emerge fully formed out of thin air as some programming monolith. The story of C begins in England, with a colleague of Alan Turing and a program that played checkers.

If you have some downtime this week[end]… find a comfy spot, a hot drink, and enjoy a history lesson on one of the most influential and still extant programming languages of all times.

C github.com

tic-tac-toe in a single call to printf

This was written for The International Obfuscated C Code Contest 2020 and I have zero idea how it works, but the entirety of the program consists of one call to printf

int main() {
    while(*d) printf(fmt, arg);
}

While its primary purpose is to serve as The One True Debugger, printf also happens to be Turing complete. (See “Control-Flow Bending: On the Effectiveness of Control-Flow Integrity” where we introduced this in an actual, published, academic paper. The things you can get away with sometimes.)

We ab^H^Huse this fact to implement a the logic of tic-tac-toe entirely within this one printf call (and a call to scanf() to read user input).

The code is beautifully formatted, too.

0:00 / 0:00