Build

Create a New Language in Less Than 200 Lines of Code

1 min readPubNub Staff on Sep 26, 2016
Try PubNub Today

Free up to 1MM monthly messages. No credit card required.

Subscribe to our newsletter

By submitting this form, you are agreeing to our Terms and Conditions and Privacy Policy.

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 Sy...

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

Can Empathy Exist in the Metaverse
News May 16, 20221 min read

Can Empathy Exist in the Metaverse

A roundtable discussion led by PubNub’s COO, Casey Clegg, exploring the topics of what it means to be human in a virtual world.

PubNub Staff

PubNub Staff

How to Advance Telehealth and Virtual Care Technologies
News May 2, 20221 min read

How to Advance Telehealth and Virtual Care Technologies

Dr. Joe Kvedar, Chair of the Board for the American Telemedicine Association, joins our COO, Casey Clegg, to discuss why...

PubNub Staff

PubNub Staff

Another Step Towards Data Security: ISO-27001 Implementation
BuildMay 2, 20221 min read

Another Step Towards Data Security: ISO-27001 Implementation

Today, we are glad to announce that we are currently in the process of implementing ISO-27001 security standards.

PubNub Staff

PubNub Staff