How to design a programming language

semantic design

Type System

Weak Type

Strong Type

Static Type

Dynamic Type

Do we have type inference?

Which formal system based on

Is subtype allowed?

Is recusive type allowed?

Type casting mechansim

Sub-type

Programming Paradigm

Imperative

Declarative

Functional Language

Logical Language

Both?

some features

meta-programming

reflection

Storage

Programmer know the detail or not?

Is pointer allowed?

Is memory management by programmer allowed?

Scoping

Lexical Scoping

Dynamic Scoping

Both?

So-called Stackless Language

Sub Program

Is sub program allowed?

First Class?

Call Strategy

Call by name

Call by value

Is call by referance allowed?

Evaluation Strategy

Eager Evaluation

Lazy Evaluation

The sequence of Evaluation

lambda

closure

Flow Control

Is non-structure jump allowed?

build-in exception

continuation

coroutine

grammer design
Grammer is the so-called syntax

There can be SEVERAL grammers according to ONE sematics

I love lisp.... who has NO grammer at all.

Syntactic Sugar

compiler implementation
There DO exist some great compiler frontend, backend and library, so reinvent the wheel is lame...And it is even easier to use some VM as the running platform like JVM, CLI.

Grammer Analyse
u can get a parse tree from this analyse

YACC

Parser Combinator

Type Checking and Inferencing for static language

several inference algorithm

Hindley-Milner

Optimization

Especially for Functional language

Platform Independent

common subexpression elimination

copy propagation

Intermediate Code Generation
change tree-style to linear-style
if you use LLVM, JVM as backend, your job is done here

static single assignment form

3-address

Code Generation

Platform Dependent Optimization

Standard Library

Data Sturucture

Set

Array

Dictionary

It is HELL when debuging and testing compiler

we'd rather be conservatism than aggrasive