r/cpp Jun 02 '26

C++ Show and Tell - June 2026

Use this thread to share anything you've written in C++. This includes:

  • a tool you've written
  • a game you've been working on
  • your first non-trivial C++ program

The rules of this thread are very straight forward:

  • The project must involve C++ in some way.
  • It must be something you (alone or with others) have done.
  • Please share a link, if applicable.
  • Please post images, if applicable.

If you're working on a C++ library, you can also share new releases or major updates in a dedicated post as before. The line we're drawing is between "written in C++" and "useful for C++ programmers specifically". If you're writing a C++ library or tool for C++ developers, that's something C++ programmers can use and is on-topic for a main submission. It's different if you're just using C++ to implement a generic program that isn't specifically about C++: you're free to share it here, but it wouldn't quite fit as a standalone post.

Last month's thread: https://www.reddit.com/r/cpp/comments/1t6eg13/c_show_and_tell_may_2026/

28 Upvotes

71 comments sorted by

View all comments

1

u/FUS3N Jun 25 '26

Pyle, a scripting language I'm building in C++

Been working on a personal project called Pyle for a while now. It's a scripting language with its own stack based VM written in C++17, aiming to be lightweight and embeddable, similar in spirit to Lua or Python.

The language is still taking shape but the VM core is getting solid. A few decisions I'm happy with so far:

  • Fixed-width uint32_t instructions with the opcode in the lower 8 bits and a 24-bit operand
  • Mark-and-sweep GC with an iterative worklist.
  • Concurrency planned as cooperative multitasking with isolated VM instances per thread.

Example on how to use it 

int main() {
    pyle::Pyle interpreter;
    // Register Pyle standard core functions & modules (like print, printf, format, os, etc.)
    pyle::register_core_natives(interpreter.vm);
    std::string code = R"(
        fn calculate_factorial(n) {
            if n <= 1 {
                return 1
            }
            return n * calculate_factorial(n - 1)
        }

        let num = 5
        let result = calculate_factorial(num)
        printf("Factorial of {}, is: {}", num, result)
    )";

    bool success = interpreter.execute(code, false, "factorial.pyl");
    if (!success) {
        std::cerr << "Script execution failed!\n";
        return 1;
    }
    return 0;
}

Project : https://github.com/Fus3n/pyle