Re:Wave Function Collapse library in pure C
by veltas on Wednesday January 05, 2022 @06:31AM
(#29807756)
It does seem that 'modern' idioms tend to just be doing the same thing in a more obfuscated manner. Just a .c/.h pair would have been easier to add to your source.
[ Parent
| on HN ]
Re:Wave Function Collapse library in pure C
by krychu on Wednesday January 05, 2022 @07:17AM
(#29808043)
This is a valid point. I was on the fence between doing .c/.h pair and a single .h. But finally took the inspiration from: https://github.com/nothings/stb.
Re:Wave Function Collapse library in pure C
by veltas on Wednesday January 05, 2022 @07:34AM
(#29808177)
Overall I think the code in the library is good, this was just the thing that stuck out to me most. Congrats on getting shared on HN.
Re:Wave Function Collapse library in pure C
by NavinF on Wednesday January 05, 2022 @07:01AM
(#29807946)
That would be easier if the most popular build systems weren’t terrible
Re:Wave Function Collapse library in pure C
by wott on Wednesday January 05, 2022 @08:22AM
(#29808551)
If the library is installed separately, the terribleness is about adding "-lfunkylib" to your linker command.
If you embed the source in your project, the terribleness is about adding to your Makefile:
funkylib.o: funkylib.c
$(CC) $<
myfinalexe: ... funkylib.o ...
# your existing executable creation (linking) command
Re:Wave Function Collapse library in pure C
by pjmlp on Wednesday January 05, 2022 @07:33AM
(#29808166)
Or I don't know, people actually bothered to learn them.
Re:Wave Function Collapse library in pure C
by wizzwizz4 on Wednesday January 05, 2022 @08:17AM
(#29808505)
Learning something doesn't stop it being terrible. One time I ran `cmake`, and forgot to run `sudo -k` beforehand. It reconfigured my system.
Re:Wave Function Collapse library in pure C
by pjmlp on Wednesday January 05, 2022 @09:22AM
(#29809247)
That has more to do with sudo than cmake.
Re:Wave Function Collapse library in pure C
by wizzwizz4 on Wednesday January 05, 2022 @09:44AM
(#29809529)
This might be an unpopular opinion, but compiling a program into a local directory shouldn't try to install packages globally. `make install`, I could understand doing that.
I had no idea that cmake would do this, after reading quite a lot of things about cmake v.s. make and how to write various makefiles for them. I posit that the C build tools are fundamentally hard to comprehend.
Re:Wave Function Collapse library in pure C
by pjmlp on Wednesday January 05, 2022 @09:57AM
(#29809715)
Any build tool can do whatever they feel like.
Blindly trusting it will lead to the same outcome, regardless of the programming language ecosytem.
Re:Wave Function Collapse library in pure C
by charcircuit on Wednesday January 05, 2022 @10:01AM
(#29809777)
Sure, but should it? Do you really want nasal demons from your build tool?
Re:Wave Function Collapse library in pure C
by pjmlp on Wednesday January 05, 2022 @12:02PM
(#29811581)
Due to the success of build tools like Gradle, build.rs or any other one that packages a Turing complete language to steer a build, apparently many want such daemons on their homedir.
Re:Wave Function Collapse library in pure C
by wizzwizz4 on Wednesday January 05, 2022 @03:23PM
(#29814432)
Just because you can do something, doesn't mean you should. A `build.rs` is supposed to be for compiling non-Rust code and stuff like that, not mucking about with the package manager – and by and large, people don't use it for mucking about with the package manager.
Re:Wave Function Collapse library in pure C
by pjmlp on Wednesday January 05, 2022 @03:47PM
(#29814703)
People use it to muck with the host OS in any possible way, unless one bothers to do the necessary code audit.
Besides that was just one example, there are plenty of them with turing complete languages.