lattner_skill

This skill helps you build modular compiler infrastructure and progressive lowering, enabling reusable libraries and clearer diagnostics for language tooling.
  • Python

3

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill copyleftdev/sk1llz --skill lattner

  • SKILL.md10.9 KB

Overview

This skill captures Chris Lattner's compiler and toolchain design philosophy to help you write modular, reusable, and pragmatic compiler code. It emphasizes progressive lowering, library-first design, clear IR boundaries, and diagnostics-driven developer experience. Use it to shape compilers, language tools, and performance-critical infrastructure with industry-proven patterns.

How this skill works

The skill inspects design decisions and suggests code patterns modeled on LLVM, Clang, Swift, and MLIR: modular pass managers, multi-level IRs, explicit typed SSA, and structured diagnostics. It recommends concrete APIs and transformation flows, prescribes invariants for IR levels, and provides templates for composable passes, diagnostics, and progressive lowering. The guidance focuses on reusable libraries rather than one-off tools.

When to use it

  • Designing a new compiler frontend, midend, or backend
  • Defining one or more intermediate representations (IRs) and lowering strategy
  • Building optimization passes and a composable pass manager
  • Creating language tooling with rich diagnostics and fix-its
  • Refactoring a monolithic compiler into reusable libraries

Best practices

  • Define one clear purpose per IR level and declare lowering contracts
  • Design passes to be composable, declarative, and to declare preserved analyses
  • Prefer SSA for optimization IRs and explicit typed operations
  • Make compilers libraries with APIs for custom tools and integrations
  • Provide structured diagnostics with source snippets and actionable fix-its
  • Document design tradeoffs and evolve features based on real-world feedback

Example use cases

  • Implementing an MLIR-style progressive lowering pipeline from high-level ops to LLVM IR
  • Building a pass manager that composes analyses and optimizations with preserved-analysis semantics
  • Creating a diagnostic engine that emits structured errors, notes, and automatic fix-its
  • Designing an ownership-aware MIR for safe and efficient transformations
  • Refactoring a command-line compiler into a library to enable IDE tooling and custom analysis

FAQ

Pick levels so each has a single clear purpose: parsing/semantics, mid-level optimizations/ownership, low-level target mapping. Avoid mixing responsibilities; add a level when transformations or analyses break semantic invariants.

Should I expose the compiler as a library or keep a CLI?

Expose a library API first and provide a CLI thin wrapper. Library-first design enables tooling, reuse, and testability while the CLI remains a convenient entrypoint.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
lattner skill by copyleftdev/sk1llz | VeilStrat