This repository is a Haskell port of the classic LLVM “Kaleidoscope” tutorial that walks you through building a tiny programming language from scratch. It covers the complete pipeline: tokenizing and parsing a simple, expression-oriented language, constructing an AST, and generating LLVM IR with a JIT so you can execute code interactively. Along the way it adds language features like user-defined functions, conditionals, loops, and operator precedence, demonstrating how each addition impacts parsing and codegen. Because it uses Haskell idioms, the code clearly separates pure syntax handling from effectful JIT operations, making the architecture easy to reason about. The examples double as a hands-on introduction to LLVM’s APIs without drowning you in infrastructure. As a result, the project is both a compact compiler course and a practical template for experimenting with language design in Haskell.

Features

  • Simple parser / lexer for the language grammar
  • AST representation and semantic analysis
  • Expression evaluation with variables, functions, control flow
  • Integration with LLVM IR emission
  • JIT compilation and execution via LLVM engine
  • Examples and tutorial code demonstrating incremental compiler design

Project Samples

Project Activity

See All Activity >

Categories

Education

License

MIT License

Follow Kaleidoscope

Kaleidoscope Web Site

Other Useful Business Software
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Kaleidoscope!

Additional Project Details

Programming Language

Haskell

Related Categories

Haskell Education Software

Registered

2025-09-26