News for hackers. Stuff that matters.
Re:Wave Function Collapse library in pure C by pjmlp on Wednesday January 05, 2022 @07:32AM (#29808162)
This is a sad idom followed in C and C++ libraries that cannot be bothered to learn build tools, dealing with C and C++ as if they were scripting languages.
Re:Wave Function Collapse library in pure C by sledgehammers on Wednesday January 05, 2022 @12:54PM (#29812416)
It's a completely valid and useful idiom. Whatever build system you use, it's trivial to add these kind of libraries to the project.

The fact that one has to learn complex build tools (and often multiple ones), is the sad thing here. Luckily there are also unity builds, which are extremely handy in many contexts, because they are so fast and easy to use between different platforms without having to deal with annoying external tools.

Re:Wave Function Collapse library in pure C by floor_ on Wednesday January 05, 2022 @08:10AM (#29808425)
Have you ever tried using a unity build?
Re:Wave Function Collapse library in pure C by pjmlp on Wednesday January 05, 2022 @09:22AM (#29809253)
Another nonsense, no I haven't ever bothered with it.

A hack designed by those that cannot be bothered to modularize a build with binary libraries.

Re:Wave Function Collapse library in pure C by maccard on Wednesday January 05, 2022 @11:07AM (#29810698)
It definitely is a hack, but it's not nonsense. The speedups on large projects are significant, even on modularised ones.
Re:Wave Function Collapse library in pure C by glouwbug on Wednesday January 05, 2022 @12:56PM (#29812444)
Not entirely. If you think about it, a resulting C binary is just data and text - it’s all compiled into a single unit of globals and functions, much like a unity build layout. Regarding optimization it allows for LTO without the need for a link time optimizer. Regarding convenience, it spares one from function prototypes and using Make or CMake. Should one use Make to speed up build times it’s as simple as tossing the unity code you’re not working on into a precompiled header; this primes the compiler for a quick compilation of the newly written code. As for design, I find unity builds resemble the design mind of a mechanical, civil, or electrical engineer - a single assembly (main.c) incorporates sub assemblies (*.c) like a CAD designer would design SolidWorks parts for a vehicle or spacecraft
Re:Wave Function Collapse library in pure C by pjmlp on Wednesday January 05, 2022 @03:49PM (#29814722)
I rather prefer the software engineering mind to use binary libraries for what they were designed for.