For x86-64 assembler fans: DIY fibers in C++

A mind-blowing mix of 64/32-bit assembly and good old C++ awaits us. We will create our own implementation of... Fibers (fibers) without calling the Win API or dialing 911.

General-purpose programming language. It has imperative, object-oriented and generic programming features, while also providing facilities for low-level memory manipulation

A mind-blowing mix of 64/32-bit assembly and good old C++ awaits us. We will create our own implementation of... Fibers (fibers) without calling the Win API or dialing 911.

It would seem that modern C++ offers so many possibilities... Let's try to dissect all this immense power, starting with the first step in any programming language — "Hello World".
How do compiler implementations greet a newcomer who has just written their first lines of code?

For over 10 years, C++ has had constexpr, which allows the programmer to cleverly offload some computations to the compiler. At the time, this blew my mind, because the compiler can calculate some rather complex things before the program is even run!
At some point, I thought: if the compiler can calculate everything for you, then why do you need a runtime at all? What are you going to do there—print the answer or something? That’s just silly. That’s unsportsmanlike.
This is where my challenge was born:
“No hands” or “don’t even think about running the exe file”

Hello, fellow developers!
Anyone who designs multilayer printed circuit boards in KiCad has faced the need, during routing, to leave large areas free of copper polygons (whether connected to nets or not) for schematic or other reasons. On outer layers, this isn't a big problem. On inner layers, it's a bit different. While it might be fine from a topology perspective, it's not ideal from a manufacturing point of view.
Today, we want to share a plugin we developed to solve this problem. It's a tool for automatically filling free areas on a PCB with non-current-carrying copper elements, either square or round, of a configurable size.
Why is this needed?
At first glance, an empty area on a board is just bare laminate without copper. But for the manufacturer and the end-user of the device, this has two important consequences.

The Mandelbrot set. And it's a program! I made it in g++, a freely distributable C++ compiler. Read it! Very interesting. Using OpenMP, you do parallel programming at the multithreading level. And I decided - this would be a completely different level of quality! I implemented honest supersampling (antialiasing) - with 8x8 antialiasing (64 passes per pixel!!!) That is, not 1920 by 1920 pixels, but 8x8 more! 15360 by 15360 pixels! And then these 64 passes reduce by one pixel, but smoothly - and no longer 8-bit, but 24-bit TrueColor!