Circle

2023 - Sean Baxter - circlelang@gmail.com

Follow me on Twitter, @seanbax, for compiler updates.

Download the latest version: Build 200 for 64-bit Linux.

Circle is a new C++20 compiler. It's written from scratch and designed for easy extension.

New Circle is out!

New Circle is a major transformation of the Circle compiler, intended as a response to recent successor language announcements. It focuses on a novel fine-grained versioning mechanism that allows the compiler to fix defects and make the language safer and more productive while maintaining 100% compatibility with existing code assets.

New Circle is the richest C++ compiler yet. Try out:

New Circle describes a path for evolving C++ to meet the needs of institutional users. The versioning mechanism that accommodated the development of the features above will also accommodate research into critically important areas like memory safety. Rather than insisting on a one-size-fit's-all approach to language development, project leads can opt into collections of features that best target their projects' needs.

GPU targets

Circle's main target is 64-bit Linux. Because all modern non-Microsoft operating systems use the same C++ ABI, it would be easy to bring Circle to these other platforms.

But Circle supports both major GPU targets as well:

  1. Circle supports GPU compute with a single-pass flavor of CUDA.
  2. Circle supports shader programming by embedding GLSL 4.6 into C++ and emitting both SPIR-V (OpenGL and Vulkan) and DXIL (Direct3D 12) byte codes.
    • Tag functions and objects with spirv attributes to target all 12 standard shader stages.
    • Use reflection and user-defined attributes to automatically generate interfaces to guide shader development.
    • Write device-portable GPGPU code with Vulkan compute, using real pointers into physical storage buffers, a powerful feature only implemented by the Circle compiler.

Circle is a heterogeneous compiler. In one translation unit, mix x64 code, CUDA code, and shader code. No tags are required. Only a single frontend pass is performed. This is the most seamless integration of CPU and GPU code of any programming language.

Using Circle

Download the latest version: Build 200 for 64-bit Linux.

Circle is best used locally, on any recent x86-64 Linux installation. You have two choices for C++ standard library:

  1. libstdc++ (gcc) is Circle's default standard library, and is the default on almost all Linux distributions. I like libstdc++-10.2.
  2. libc++ (LLVM) is supported by specifying -stdlib=libc++ or specifying _LIBCPP_ABI_VERSION as a command-line macro definitiono.

If you're on an incompatible distribution, or a different OS altogether, try running Circle through this Dockerfile.

Circle is also hosted on Compiler Explorer, so you can use it over the web.

Basic command-line options