Powered by SourceForge   Home | About | Partners | Contact Us

Compiler design

Information about the general design of the compiler

Incremental recompilation with LLVM

I have run into an interesting issue with LLVM when I enabled global optimizations in XLR. It looks like the link-time optimization passes (LTO) in LLVM are not too friendly to incremental recompilation.

XLR with LLVM now closing the performance gap with C

The recent factoring on the XLR version of XL was intended to make it easier to maintain, but also to significantly accelerate it. Results are in, and they are amazing. XLR now handily beats unoptimized C code, being within 15% of optimized C code.

Refactoring the XLR compiler

I am currently working on a rather serious refactoring of the XLR compiler. The objectives are the following:

  • Fix a number of issues with scoping and closures
  • Pave the way for assignments and mutable XLR trees
  • Activate the type system and related optimizations

A number of changes happen in the compiler structure as a result:

  • The Context class is gone
  • Error management (Error and Errors classes) were deeply redefined. Ooops is now in errors.h where it belonged.

This is now well under way.

Low-Level Virtual Machine (LLVM)

LLVM stands for Low-Level Virtual Machine.

The LLVM project (http://llvm.org) is a collection of modular and reusable compiler and toolchain technologies. It started as a research project at the University of Illinois.

It is used in XLR as a back-end for dynamic code generation.

XL Compilers Design and Implementation

There are several XL compilers, but they all follow the same basic architecture:

  • The scanner reads the input file and decomposes it into tokens.
  • The parser takes the sequence of tokens and turns it into a a parse tree (or abstract syntax tree).
  • Rewrite rules are applied on the parse tree, transforming it over time.
  • The transformed parse tree is fed into the back-end

Design differences between XL2 and XLR

The primary difference between the XL2 and XLR implementations are the following:

Syndicate content