Peon is a modern, multi-paradigm, async-first programming language with a focus on correctness and speed
Go to file
Mattia Giambirtone ff0ae8fcba Various fixes to frames, recursion, and more. Removed stack bottom from CFI data. Added comparison opcode for fib test as well as a clock opcode 2022-08-01 10:38:51 +02:00
docs Various fixes to frames, recursion, and more. Removed stack bottom from CFI data. Added comparison opcode for fib test as well as a clock opcode 2022-08-01 10:38:51 +02:00
src Various fixes to frames, recursion, and more. Removed stack bottom from CFI data. Added comparison opcode for fib test as well as a clock opcode 2022-08-01 10:38:51 +02:00
tests Fixed a bug with nested scopes 2022-07-31 16:40:47 +02:00
.gitignore Updated .gitignore 2022-07-09 13:37:51 +02:00
LICENSE Initial commit from JAPL with some changes 2022-04-04 12:29:23 +02:00
Makefile Updated Makefile 2022-07-09 16:25:19 +02:00
README.md Updated .gitignore, slightly edited README and added some more tests 2022-06-19 14:45:38 +02:00

README.md

The peon programming language

Peon is a simple, functional, async-first programming language with a focus on correctness and speed.

Go to the Manual

Project structure

  • src/ -> Contains the entirety of peon's toolchain
    • src/memory/ -> Contains peon's memory allocator and GC (TODO)
    • src/frontend/ -> Contains the tokenizer, parser and compiler
      • src/frontend/meta/ -> Contains shared error definitions, AST node and token declarations as well as the bytecode used by the compiler
    • src/backend/ -> Contains the peon VM and type system
    • src/util/ -> Contains utilities such as the bytecode debugger and serializer as well as procedures to handle multi-byte sequences
    • src/config.nim -> Contains compile-time configuration variables
    • src/main.nim -> Ties up the whole toolchain together by tokenizing, parsing, compiling, debugging, (de-)serializing and executing peon code
  • docs/ -> Contains documentation for various components of peon (bytecode, syntax, etc.)
  • tests/ -> Contains tests (both in peon and Nim) for the toolchain

Credits

  • Araq, for creating the amazing language that is Nim
  • The Nim community and contributors, for making Nim what it is today
  • Bob Nystrom, for his amazing book that inspired me and taught me how to actually make a programming language
  • Njsmith, for his awesome articles on structured concurrency

Project State

Disclaimer: The project is still in its very early days: lots of stuff is not implemented, a work in progress or otherwise outright broken. Feel free to report bugs!

Also, yes: peon is yet another programming language inspired by Bob's book, but it is also very different from Lox, which is an object-oriented, dynamically typed and very high level programming language, whereas peon is a statically-typed, functional language which aims to allow low-level interfacing with C and Nim code while being a breeze to use.

Also, peon will feature structured concurrency with coroutines (think Futures/Fibers but without callback hell). Since, unlike Lox, peon isn't a toy language, there's obviously plans to implement creature comforts like an import system, exception handling, a package manager, etc.

TODO List

In no particular order, here's a list of stuff that's done/to do (might be incomplete/out of date):

Toolchain:

  • Tokenizer (with dynamic symbol table)
  • Parser (with support for custom operators, even builtins)
  • Compiler -> Being written
  • VM -> Being written
  • Bytecode (de-)serializer
  • Static code debugger
  • Runtime debugger/inspection tool

Type system:

  • Custom types
  • Intrinsics
  • Generics -> WIP
  • Functions

Misc:

  • Pragmas -> WIP (Some pragmas implemented)
  • Attribute resolution
  • method-like call syntax without actual methods (dispatched at compile-time)
  • ... More?

The name

The name for peon comes from my and Productive2's genius and is a result of shortening the name of the fastest animal on earth: the Peregrine Falcon. I guess I wanted this to mean peon will be blazing fast