-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Alan Gardner edited this page Feb 26, 2021
·
21 revisions
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.
- Hello World - A hello world example.
- Primitives - Learn about string, numbers and other primitives.
- Variable Bindings - Mutable bindings.
- Expressions
- Flow of Control - if/else, for, and others.
- Functions - Learn about Methods and High Order Functions.
- Standard Library - Helper methods included as standard.
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.
Must Have:
- Comments
//or/* */ - Statically typed variables, however, type can be inferred.
var name: string = "This is NAPL";orvar 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
mutto make a variable mutable.var mut name = "name"; - Precedence and grouping
var average = (min + max) / 2; - A basic standard library containing
print()andclock(). - Control Flow:
if/elsestatements,whileloop,forloop - Functions
Must Be Able To:
- Bootstrap - bootstrapping is the technique for producing a self-compiling compiler.