P1 Programming Language And Environment

P1 SourceForge project page.

"P1" is a new programming language, still in active design. It is a statically typed object-oriented language, with heavy emphasis on meta-programming (aka "Lisp-style" macros), and support for automatic and manual memory management. It is explicitly designed to allow efficient ahead-of-time compilation (unlike Java, for example) and to be completely self-hosting (which implies that it can perform low-level operations in an unsafe context).

The syntax has C heritage, but many drastic changes have been made to streamline the parsing and to satisfy the other goals of the project. Some of the changes include completely new declaration syntax, statement expressions, removal of the ',' and '?' operators, replacing the "switch" statement with a more structured "case" statement and many others.

The project will include a compiler (to bytecode), byte code tools (assembler, disassembler, etc), interpreter (virtual machine), a gdb-style (console) debugger and an optimizing backend for static compilation (initially based on LLVM). The source code of all the tools (compiler, debugger, interpreter, etc) will be GPL. The libraries will be LGPL (or something similar permitting unlimited use of the library in a closed source program).

The development is currently in C, but the goal is to bootstrap the compiler in "P1" as soon as possible (making sure that the language is actually useful for something). For now it is mostly a research project but the hope is that it can become more useful in the future.

P1 has been influenced by C/C++, Java, Pascal, Lisp and more recently D. "D" shares many of the same goals as P1, but ultimately has a different direction. In this developer's opinion "D" is a giant step forward from C and C++.

Some P1 design goals:

Project Status

The syntax and all features of the language haven't been finalized yet. The work currently is on the precise definition of the language, using an experimental parser in BISON to test the syntax. The next step will be a precise semi-formal description of the language. After that implementation of the byte-code compiler can begin.


Hosted by SourceForge.net