hn.today

A Partial Evaluator for C

phoenix.labri.fr70 points17 comments
Screenshot of A Partial Evaluator for C

Tempo is an off-line partial evaluator for C: it transforms a general program into a version tailored to inputs known in advance. Its workflow separates analysis from specialization. Users identify static inputs, and an interprocedural analysis tracks how known and unknown values flow through the program, accounting for pointers, aliases, and side effects. The resulting annotations show which operations can be computed early and removed, and which must remain for execution. Once users confirm that the analysis captures the desired opportunities, they supply concrete static values to generate specialized code. A single analysis can support multiple specializations with different values.

Tempo supports both compile-time source-to-source transformation and runtime specialization. For runtime use, it generates a dedicated specializer that produces a function for particular inputs; several tailored versions can coexist. The system has been applied to operating systems and networking, graphics, scientific computing, interpreters, pattern matching, generic libraries, and domain-specific languages, with reported substantial speedups. It has also served as a back end for Java specialization and supported programs translated from Fortran and C++. The project’s account describes Tempo’s public distribution beginning in 1998, with an unrestricted Linux binary available by 2000, and presents its analysis technology as part of the mobile-code system Cyclone.

Read on phoenix.labri.fr17 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.