Skip to content
Alan Gardner edited this page Feb 26, 2021 · 21 revisions

NAPL Programming Language Wiki

NAPL (Not Another Programming Language) is a programming language built purely for fun and educational purposes.

NAPL Wiki provides the language definitions to illustrate the NAPL language.

Why?

I decided I wanted to educate myself to learn the constructs of a programming language and to challenge myself. Initially I will develop the compiler in Go and my current thought process is to transpile NAPL into Go.

Language Specification

Must Have:

  • Comments // or /* */
  • Statically typed variables, however, type can be inferred. var name: string = "This is NAPL"; or var name = "This is NAPL";
  • Data types: string, number, boolean, null
  • Variables can be defined as arrays. var digits: number[] = [1, 2, 3];
  • (maybe) Tuples - Defined as return (1, "string");
  • Variables are by default immutable, add the keyword mut to make a variable mutable. var mut name = "name";
  • Precedence and grouping var average = (min + max) / 2;
  • A basic standard library containing print() and clock().
  • Control Flow: if/else statements, while loop, for loop
  • Functions

Must Be Able To:

  • Bootstrap - bootstrapping is the technique for producing a self-compiling compiler.

Clone this wiki locally