We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Y++

From Esolang
Jump to navigation Jump to search

Y++ (also known as YXX or YLANG++) is a hybrid programming language project developed by theprojectcreatorof2amthoughts. It is implemented using a C11 runtime and a C++20 host, tooling, and native-function bridge.

Y++ is a separate language project related to Ylang. It carries forward Y_'s interpreter and runtime model while providing additional tooling and C++ host interoperability.

Design

Y++ retains its own language vocabulary and syntax rather than replacing its keywords with C or C++ aliases.

Some of its language constructs include:

  • stash — variable declarations.
  • define — function definitions.
  • give — returning values.
  • when, doit, else, and done — conditional execution.
  • repeatwhile and execute — loop execution.
  • escape — control-flow escape.
  • writescrn >^ — output.
  • errstate <^ — error-state functionality.
  • both, either, and invert — logical operations.
  • !$name — custom variable names.
  • !# directives — compiler and runtime directives.

Runtime

The Y++ runtime supports:

  • Numbers, strings, booleans, void, functions, and memory values.
  • Nested environments and lexical closures.
  • User-defined functions and recursion.
  • Conditional statements and loops.
  • Checked byte buffers.
  • Interactive execution through a persistent prompt.
  • Embedded and external library imports.

C++ interoperability

Y++ provides a public C-compatible interface through its bridge header, `include/ypp/bridge.h`.

C++ host applications can register native functions that can subsequently be called from Y++ source code. Supported bridge values include void, numbers, strings, and booleans.

This functionality provides a native-function bridge. It is not a general-purpose C++ parser or automatic C++ binding generator.

File formats

The repository currently documents these file formats:

  • `.ycpp` — Y++ source programs.
  • `.hlypp` — Y++ header libraries.
  • `.yaq` — external Adequit helper files.

Compilers and tools

Y++ includes two main executables:

  • `ylang++` — the interpreter and interactive runtime.
  • `gy++` — the native compiler driver, which embeds Y++ source and links it with the Y++ runtime.

The project supports building with GNU Make and CMake.

External links