Create a Basic Programming Language and Interpreter in Under 10 Minutes

Learn how to develop a simple programming language and its interpreter quickly. This tutorial guides you through the fundamental steps to bring your own language to life in just a few minutes.

Create a Basic Programming Language and Interpreter in Under 10 Minutes
bvdl․io
79.6K views • Jun 27, 2023
Create a Basic Programming Language and Interpreter in Under 10 Minutes

About this video

Creating a programming language is a dream for many programmers. In this video I go over how you can create a simple programming language and in interpreter for that language so you can run programs written in your own programming language. This will help you get started creating and understanding how make your own (more complex) programming language.

Make sure to let me know in the comments if you want to see this language being expanded. For the ability to do things such as assign variable or call functions.

Making the compiler: https://youtu.be/GsCWivTeFpY

Code: https://github.com/basvdl97/OLL-Interpreter

Disclaimer:
The language (Our Little Language (.oll)) is by far not a complete language, and the interpreter only expects perfectly written code. Don't use this for production purposes, and only use it for the educational purpose of learning about creating and interpreting programming languages.

The Instruction in Our Little Language (.oll) are:
PUSH
POP
ADD
SUB
PRINT
READ
JUMP.EQ.0
JUMP.GT.0

_____________
program1.oll:
_____________
READ
READ
SUB
JUMP.EQ.0 L1
PRINT "not equal"
HALT

L1:
PRINT "equal"
HALT
_____________

_____________
program2.oll:
_____________
READ
JUMP.EQ.0 L1

LOOP:
PUSH 2
SUB
JUMP.EQ.0 L1
JUMP.GT.0 LOOP
PRINT "odd"
HALT

L1:
PRINT "even"
HALT
_____________


- Music -
Link: https://www.youtube.com/watch?v=HryvNaqGnXc

- Time Codes -
0:00 - Intro
0:04 - What is an interpreter
0:37 - Stack based languages
1:31 - Our Language Instructions
2:58 - Example .oll programs
4:16 - Writing two .oll programs
4:26 - Creating interpreter - parsing
6:40 - Creating interpreter - stack
7:28 - Creating interpreter - execution
9:22 - Running our programming language
10:10 - Outro

- Hashtags -
#programming
#coding
#interpreter
#programminglanguage
#python
#compiler

- Search Terms -
making a programming language
making my own programming language
programming language interpreter
write a program
computer program
python tutorial for beginners

Tags and Topics

Browse our collection to discover more content in these categories.

Video Information

Views

79.6K

Likes

2.3K

Duration

10:28

Published

Jun 27, 2023

User Reviews

4.7
(15)
Rate:

Related Trending Topics

LIVE TRENDS

Related trending topics. Click any trend to explore more videos.