The P programming language
becuz im bored
Check out examples/ for some examples.
- pint
- The P interpreter CLI
- repl
- A read-eval-print loop to run P interactively inside of your terminal
- ast-viewer
- This is an interactive terminal where you can inspect the AST or bound AST of a provided source code node-by-node
- test
- Runs unit tests
npm i -g @p-lang/planggit clone https://github.com/p-programming-language/plang && cd plangnow just run:
npm i && npm run buildThen you can access our tools using:
npm run <tool>or:
yarn run <tool>- Type analysis & hoisting before parsing
- Tokenizing:
- Number literals (int, float)
- String literals, supports both single and double quotes
- Boolean literals
- Identifiers
- Keywords
- Symbols (
+,-, etc.) - Comments (
## single line,##: multi line :##)
- Parsing + Binding + Type checking + Interpreting:
- Literals
- Basics (numbers, strings, booleans)
- String interpolations
- Ranges
- Array literals/types
- Object literals/types
- Array/object indexing
- Binary expressions (including compound assignment,
is,is in, etc.) - Unary expressions (including
++,--,#,typeof, etc.) - Variable declarations (mutability optional)
- Variable assignment (
:=and=operators) - Property assignment
- Function declarations and calls
- Literals
- Type guards (
value is T,T extends U,asserts T,T extends U ? V : Q) - Intrinsic types
- Spread types
- Parenthesized types
- Type casting (
value as T) - Throw statement
- Switch statement
- Classes (in progress, someone else do this shit)