Create a New Language in Less Than 200 Lines of Code

1 min readSep 26, 2016

Have you ever wanted to design your own programming language? It seems like such fun, but if you’ve ever tried you probably got stuck right around the time you read “LLR Decent Parsers and Abstract Syntax Trees.” Traditionally designing your own language was hard because it requires a very specialized set of arcane tools, tools that take a long time to learn and use effectively. But it doesn’t have to be this way. Ohm, a new compact parser toolkit from the team at HARC, lets you build your own languages with simple and clean Javascript.

In this four part series, I’ll show you how to build a complete programming language from scratch in less than 200 lines of code.

  1. Parsing Numbers in Decimal, Floating Point, and Hex
  2. Arithmetic with an AST and Symbols
  3. Boolean Expressions, Code Blocks and Conditionals
  4. Completing the Language with Loops, Comments, and Function Calls

This series doesn’t just give you some code. We’ll go through each concept step-by-step. We will design and build each feature for a simple language I’m calling Meow, teaching you what you need to know as we go. You don’t even need to know anything about parsers to get started, just some basic knowledge of JavaScript.

So what are you waiting for? Let’s go!

More from PubNub

How to Create a Dating App: 7 Steps to Fit Any Design
Insights6 minMar 15, 2023

How to Create a Dating App: 7 Steps to Fit Any Design

There are common underlying technologies for a dating app, and in this post, we’ll talk about the major technologies and designs...

Michael Carroll

Michael Carroll

How to Create a Real-time Public Transportation Schedule App
Build6 minMar 14, 2023

How to Create a Real-time Public Transportation Schedule App

How to use geohashing, JavaScript, Google Maps API, and BART API to build a real-time public transit schedule app.

Michael Carroll

Michael Carroll

How to Create Real-Time Vehicle Location Tracking App
Build2 minMar 9, 2023

How to Create Real-Time Vehicle Location Tracking App

How to track and stream real-time vehicle location on a live-updating map using EON, JavaScript, and the Mapbox API.

Michael Carroll

Michael Carroll

Talk to an expert