Alpha.tpp → C++20

The PseudoProgramming Language

“a language for competitive programming that knows its purpose.”

Write less contest ceremony. Keep your attention on the algorithm. Emit C++20 for the toolchain you already know.

See current support
The TPPL mark: closing brace, o underscore o, opening brace
01 Parse02 Check03 LowerImplemented subset → C++20

Current implementation

What works today.

TPPL is a working but deliberately small alpha. It compiles a useful typed subset end to end, but it does not yet cover every competitive-programming problem.

01

Available end to end

Implemented from .tpp source through generated C++20 and g++.

  • Scalar types and recursive vector<T>
  • Top-level functions and recursion
  • Initialized locals, expressions and assignments
  • if/else, while, ranges and for-each
  • Strings, chars, checked indexing and runtime I/O
02

Frontend only

Parsed and semantically checked, but not emitted by the C++ backend.

  • Global variables
  • Nested functions
  • Uninitialized local variables
03

Not implemented

Not part of the current language. No release date is promised.

  • Structs, records or classes
  • Enums or sum types
  • Fixed arrays, maps and sets
  • A broader standard algorithm library

Current boundary: vector<T> is TPPL's only composite container, and user-defined data types are not available yet.

The language, first

Contest-shaped by design.

Functions, vectors, ranges and output stay direct. The syntax remains familiar, while the compiler handles the semantic work before C++ is emitted.

solution.tpp
int square(int x) {
    return x * x;
}

int main() {
    vector<int> answers = vector<int>(5, 0);

    for i in 0..5 {
        answers[i] = square(i + 1);
    }

    for answer in answers {
        print(answer);
    }

    return 0;
}
output
1
4
9
16
25

Same problem. Less ceremony.

Keep the algorithm in view.

Read n. Visit [0, n). Print the even values. Both programs do exactly that.

Traditional contest C++C++20
solution.cpp
#include <cstdint>
#include <iostream>

int main() {
    std::int64_t n = 0;
    std::cin >> n;

    for (std::int64_t i = 0; i < n; ++i) {
        if (i % 2 == 0) {
            std::cout << i << '\n';
        }
    }
}
The same solution in TPPL.tpp
solution.tpp
int main() {
    int n = read_int();

    for i in 0..n {
        if i % 2 == 0 {
            print(i);
        }
    }

    return 0;
}

Why TPPL?

Performance includes your time.

01

Problem first

Spend fewer keystrokes on ceremony and more attention on the algorithm.

02

Contest-first

Functions, control flow, vectors and I/O are shaped around the work of solving.

03

C++20 underneath

A real frontend checks your program, lowers it to typed IR and emits C++20 for g++.

Language showcase

Small pieces. Useful together.

Version 0.01 Alpha focuses on a compact, typed subset that already reaches executable C++20.

01
Available end to end

Functions & strings

Pass values directly, return strings, and use resolved string operations.

functions.tpp
string decorate(string word, char marker) {
    word.push(marker);
    return word;
}

int main() {
    print(decorate("TPPL", '!'));
    return 0;
}
02
Available end to end

Control flow

Ranges, branches and loop control keep the interesting path easy to scan.

control-flow.tpp
int main() {
    for value in -2..=2 {
        if value == 0 {
            continue;
        }

        print(value);
    }

    return 0;
}
03
Available end to end

Nested vectors

Recursive vector types and checked indexing cover familiar contest storage.

vectors.tpp
int main() {
    vector<vector<int>> matrix =
        vector<vector<int>>(3, vector<int>(4, 0));

    matrix[1][2] = 5;
    print(matrix[1][2]);
    return 0;
}
04
Available end to end

Runtime I/O

Read signed integers, byte strings and chars through the built-in runtime.

input-output.tpp
int main() {
    int count = read_int();
    string word = read_string();
    char marker = read_char();

    print(count);
    print(word);
    print(marker);
    return 0;
}

How it works

A compiler, not a text trick.

TPPL builds a syntax tree, resolves declarations, checks types and control flow, then creates an owning Lowered IR before C++ generation.

  1. 01
    .tpp

    Source

    • program.tpp
  2. 02
    structure

    Frontend

    • Lexer
    • Parser
  3. 03
    meaning

    Semantics

    • Declarations
    • Entry point
    • Names
    • Types
    • Control flow
  4. 04
    typed IR

    Lowering

    • LoweredProgram
  5. 05
    executable

    Toolchain

    • C++20
    • g++
    • program

Reliability

Checked beyond the happy path.

Tests cover the frontend, semantic passes, lowering, runtime boundaries, deterministic output and the real C++ toolchain.

TPPL compiler CI status
GCC + Clang
Ubuntu Debug CI
Recovery + stress
Malformed input coverage
Semantic pipeline
Names, types and flow
Actual g++ E2E
Generated programs execute

Get started

From source to executable.

TPPL currently builds from source. pseudo --emit-cpp writes C++ source; invoking g++ and running the executable are separate CLI steps.

  • CMake 3.20+
  • A C++20 compiler
  • g++ for generated output
terminal
git clone https://github.com/koljaPl/pseudo-programming-language.git
cd pseudo-programming-language

cmake -S . -B build \
  -DCMAKE_BUILD_TYPE=Release \
  -DBUILD_TESTING=OFF
cmake --build build --parallel

./build/pseudo --emit-cpp solution.tpp > solution.cpp
g++ -std=c++20 -Iruntime/include solution.cpp -o solution
./solution

Open source

Built by competitors, for competitors.

TPPL is fully open source. Contributions, experiments and grounded ideas are welcome.

Explore the source

Created by

Nicklas Plugin

The Pseudo Programming Language was created before his 16th birthday.

He considers this the youngest age at which a programming language of this scale has been created.

nikolya.plugin@gmail.com

Your next submission

Built for the next problem.

Focus on the solution. Let TPPL carry it to C++20.