p-programming-language / plang

The P programming language

Home Page:https://p-lang.xyz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Plang

The P programming language

Last Commit GitHub code size in bytes GitHub top language npm

license

testing njsscan sarif

Why?

becuz im bored

Examples

Check out examples/ for some examples.

Tools

  • 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

Developer only tools

  • test
    • Runs unit tests

Installation

Installation using NPM:

npm i -g @p-lang/plang

Custom install / self building

git clone https://github.com/p-programming-language/plang && cd plang

now just run:

npm i && npm run build

Then you can access our tools using:

npm run <tool>

or:

yarn run <tool>

Current Features

  • 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

Planned Features

  • 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)

About

The P programming language

https://p-lang.xyz

License:GNU General Public License v2.0


Languages

Language:TypeScript 99.0%Language:JavaScript 0.5%Language:OpenEdge ABL 0.4%Language:PowerShell 0.1%Language:Batchfile 0.0%Language:Shell 0.0%