September 2023
M T W T F S S
« Jul    
 123
45678910
11121314151617
18192021222324
252627282930  

Categories

Archives

Archives

Nanopass Compiler

Through a friend, I got hold of a provocative paper A Nanopass Framework for Compiler Education, by Sarkar, Waddell, and Dybvig. They describe a compiler written in scheme that makes 50ish passes. Each pass is described as a language transform, where both the starting input and output language must have precise grammars. To reduce the […]

Express yourself: to the compiler and to your fellow developer.

The keynote speaker at CGO 2012 (Chris Lattner, LLVM) put some crazy thoughts into my head.

Want compiler to know about:

memory disjointness aliasing Usage of data structures (array of struct vs struct of arrays) whether arithmetic is done on a pointer (and the bounds) invariants (in loops and between methods)

A language needs to […]

The Good IR: Multiple Returns

This post is part of a seres: The Good IR (BasicBlocks and control flow instructions) The Good IR: Other Control Flow Structures The Good IR: Instructions and Values The Good IR: Reporting Semantic Errors via Type Checking The Good IR: Multiple Returns —–

Why Have Early Returns?

I’ve been meaning for awhile now to do […]

The Good IR: Reporting Semantic Errors via Type Checking

This post is part of a seres: The Good IR (BasicBlocks and control flow instructions) The Good IR: Other Control Flow Structures The Good IR: Instructions and Values The Good IR: Reporting Semantic Errors via Type Checking The Good IR: Multiple Returns —–

It’s actually, quite fascinating: not only is type-checking relatively simple to do, […]

The Good IR: Instructions and Values

This post is part of a seres: The Good IR (BasicBlocks and control flow instructions) The Good IR: Other Control Flow Structures The Good IR: Instructions and Values The Good IR: Reporting Semantic Errors via Type Checking The Good IR: Multiple Returns ——

It’s taken some time, but I think I’ve arrived at a reasonable […]

The Good IR: Other Control Flow Structures

This post is part of a seres: The Good IR (BasicBlocks and control flow instructions) The Good IR: Other Control Flow Structures The Good IR: Instructions and Values The Good IR: Reporting Semantic Errors via Type Checking The Good IR: Multiple Returns —- In my last post on The Good IR, I had arrived at […]

The Good IR

This post is part of a seres: The Good IR (BasicBlocks and control flow instructions) The Good IR: Other Control Flow Structures The Good IR: Instructions and Values The Good IR: Reporting Semantic Errors via Type Checking The Good IR: Multiple Returns —- After parsing, each function can be represented as a ControlFlowGraph of BasicBlocks. […]