1. Kaleidoscope: Kaleidoscope Introduction and the Lexer — LLVM 20.0.0git documentation
This tutorial is illustrated with a toy language called “Kaleidoscope” (derived from “meaning beautiful, form, and view”). Kaleidoscope is a procedural language that allows you to define functions, use conditionals, math, etc. Over the course of the tutorial, we’ll extend Kaleidoscope to support the if/then/else construct, a for loop, user defined operators, JIT compilation with a simple command line interface, debug info, etc. We want to keep things simple, so the only datatype in Kaleidoscope is a 64-bit floating point type (aka ‘double’ in C parlance). As such, all values are implicitly double precision and the language doesn’t require type declarations. This gives the language a very nice and simple syntax. For example, the following simple example computes Fibonacci numbers: We also allow Kaleidoscope to call into standard library functions - the LLVM JIT makes this really easy. This means that you can use the ‘extern’ keyword to define a function before you use it (this is also u
1. Kaleidoscope: Kaleidoscope Introduction and the Lexer — LLVM 23.0.0git documentation Navigation index next | previous | LLVM Home | Documentation >> Getting Started/Tutorials » LLVM Tutorial: Table of Contents » My First Language Frontend with LLVM Tutorial » 1. Kaleidoscope: Kaleidoscope Introduction and the Lexer Documentation Getting Started/Tutorials User Guides Reference Getting Involved Contributing to LLVM Submitting Bug Reports Mailing Lists Discord Meetups and Social Events Additional Links FAQ Glossary Publications Github Repository This Page Show Source Quick
Explore this link on the map →saved by
related reading
- 2. Kaleidoscope: Implementing a Parser and AST — LLVM 23.0.0git documentationllvm.org
- 9. Kaleidoscope: Adding Debug Information — LLVM 23.0.0git documentationllvm.org
- A Gentle Introduction to LLVM IR · mcyoungmcyoung.xyz
- Learn X in Y Minutes: Scenic Programming Language Tourslearnxinyminutes.com
- Scanning · Crafting Interpreterscraftinginterpreters.com
- Learnable Programmingworrydream.com
- Introduction · Crafting Interpreterscraftinginterpreters.com
- Learnable Programmingworrydream.com
- Let’s Build A Simple Interpreter. Part 1. - Ruslan's Blogruslanspivak.com
- Overview ‹ λ-2D: An Exploration of Drawing as Programming Language, Featuring Ideas from Lambda Calculus - MIT Media Labmedia.mit.edu
- Jargon: an LLM-based pseudolanguage for prompt engineering — Jake Brukhmanjake.mirror.xyz
- Writing a C compiler in 500 lines of Pythonvgel.me