Skip to content

Introduction

Welcome to the Toy Programming Language, a simple compiler with simple and readable syntax! Toy Programming Language (tpl-lang) provides fast and lightweight code with basic functionality.
The style of language is similar as C, but with more simplified rules and principles

What Is This?

Toy Programming Language - is a simple compiling language, based on LLVM.
Project created to learn and show other people how to create compilers in Rust 🦀

Project Architecture

INFO

  • Main Programming Language: Rust
  • Code Generator: LLVM
  • LLVM Wrapper Library: Inkwell
  • Colored Terminal Library: Colored

  • Latest compiler version: v0.3.6
  • LLVM version: 18.1.6
  • Inkwell version: 0.5.0

Code is separated to 4 tasks and modules for structured code processing and error handling:

  1. tpl-lexer - Lexical Analyzer with abstracted functionality of processing source code into tokens.
  2. tpl-parser - Parsing Analyzer, a tool which turns tokens into distributed abstract syntax tree with priorities.
  3. tpl-ir - Code Generator with type checker and LLVM wrapper for compiling AST into module.
  4. tplc - Main part of all project, which contains user-side tools: cli, config parser, llvm module compiler and object linker

Others