Skip to content

This project is a tutorial for myself to learn how to create your own programming language.

Notifications You must be signed in to change notification settings

santerijps/programming-language-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pltc: Creating a programming language from scratch

This project is a tutorial for myself to learn how to create my own programming language. I decided to write all the code in C. Below is a list of things that I would like to try:

  • a lexer
  • a parser
  • an interpreter
  • produce native executables

The development compiler is Tiny C Compiler aka. tcc. It compiles code really fast. The name of my programming compiler is pltc, which simply stands for Programming Language Tutorial Compiler.

Getting started

Install tcc if you don't already have it

  1. Go to this URL and download the appropriate version
  2. Extract the downloaded zip file where-ever you like
  3. Add the path to the tcc executable file into your environment
  4. Confirm that it works by running tcc --help

Clone this repository

On the command line (if you have git installed):

git clone https://github.com/santerijps/programming-language-tutorial

Compile the binaries

With make:

cd programming-language-tutorial
make

With tcc:

cd programming-language-tutorial
mkdir bin
tcc src/pltc.c -o bin/pltc

Try the examples

cd programming-language-tutorial
bin/pltc examples/example.py

About

This project is a tutorial for myself to learn how to create your own programming language.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published