(August 26, 2021 at 5:44 pm)HappySkeptic Wrote:(August 26, 2021 at 5:35 pm)FlatAssembler Wrote: Like those locks from the C++ standard library? https://en.cppreference.com/w/cpp/thread/lock
Yes. However, getting a lock is also expensive, so in a thread-safe program you would find a way to do the static initialization at program startup, rather than test for initialization in the TreeNode constructor each time.
By the way, what do you think about the way I implemented named function arguments yesterday? https://github.com/FlatAssembler/AECforW....cpp#L1207
I don't know what to say, it seems to me I have once again made a compiler such that it is easier to start from scratch than to add another compilation target, just like it was easier to make a new compiler than to extend my AEC-to-x86 compiler to target WebAssembly. It would be very hard to extend my compiler to target, for example, LLVM bytecode instead of WebAssembly. Had I targetted LLVM bytecode, my programming language would already be able to run not only on the web, but also natively on ARM, and AVR, and PowerPC and SPARC. I hoped WebAssembly will turn into an easier-to-use LLVM, that there will soon be many WebAssembly-to-specific-CPU compilers, but it seems to me now that is not happening.