Live data from Hacker News

Everything you never wanted to know about CMake (redux)

izzys.casa

11–20 of 58 posts

Re: Everything you never wanted to know about CMake (redux)

#12

All these CMake improvements are the best example of optimising into a local minimum I have ever seen in SWE

Good phrasing! I’m just a hobbyist so I don’t get very involved but what would you suggest as an alternative maximum?

I assume Bazel

Re: Everything you never wanted to know about CMake (redux)

#13

All these CMake improvements are the best example of optimising into a local minimum I have ever seen in SWE

Good phrasing! I’m just a hobbyist so I don’t get very involved but what would you suggest as an alternative maximum?

What do you want in a maximum? Cmake is a local maximum if popularity is important, which it should be. Because cmake is popular you can find lots of things that work with it, and when you have problems other experts who can help.

For build systems few people really want to become experts so finding them is important.

Don't take the above as saying cmake is the best, it deserves most criticism. However the alternatives are probably not compelling just because they are not popular.

Re: Everything you never wanted to know about CMake (redux)

#15

All these CMake improvements are the best example of optimising into a local minimum I have ever seen in SWE

Good phrasing! I’m just a hobbyist so I don’t get very involved but what would you suggest as an alternative maximum?

Bazel is the only sensible alternative for C++. It's obviously way more work and not really worth it for really small projects, but it is at least well designed and it solves real problems through hermeticity.

But if you're not going to go to that effort I wouldn't really recommend anything other than CMake. There are alternatives that are a bit better (Meson) but then you give up on using the de facto build system (as much as there is one).

Also I've found that a lot of the "cleaner" C++ build systems are partly only cleaner because they ignore the full range of complexity that real world C++ builds have to content with. Rpaths, symbol visibility, etc.

Re: Everything you never wanted to know about CMake (redux)

#16
post #13

Earlier quoted context omitted.

Good phrasing! I’m just a hobbyist so I don’t get very involved but what would you suggest as an alternative maximum?

What do you want in a maximum? Cmake is a local maximum if popularity is important, which it should be. Because cmake is popular you can find lots of things that work with it, and when you have problems other experts who can help. For build systems few people really want to become experts so finding them is important. Don't take the above as saying cmake is the best, it deserves most criticism. However the alternativ…

A build system is largely declarative--it tends to boil down to defining rules like "how to compile a source file", "how to build a library", etc., along with the lists of things those rules need to be applied to, with there being a confusing three-way tug-of-war between the user, the project, and the system over how to override stuff and who wins out. The end result should be that you should ideally be able to query the build system to figure out the underlying declarative pieces of it pretty easily (e.g., list all of the C++ compiler invocations, list all of the package dependencies, etc.).

CMake is like halfway there or so, combined with a shell-like language that has some annoying issues (e.g., functions are statements, not expressions, so if you want to do dirname(dirname(foo)), that's two calls to PARENT_PATH). It does a better job than autoconf/make in that it doesn't invite you to resort to shell almost immediately, but that is admittedly a low bar.

Re: Everything you never wanted to know about CMake (redux)

#17

All these CMake improvements are the best example of optimising into a local minimum I have ever seen in SWE

“Local minimum” is a great way to put it. I recognize that CMake has done a lot to make people’s lives easier, but it has so many design flaws that the entire design seems almost purposefully user-hostile. I know it’s not hostile on purpose, but it sometimes feels that way.

Begin by throwing the language away. Provide a tool that converts existing CMake scripts to the new, sane language. Use an established programming language for the new language.

Re: Everything you never wanted to know about CMake (redux)

#18

Earlier quoted context omitted.

“Local minimum” is a great way to put it. I recognize that CMake has done a lot to make people’s lives easier, but it has so many design flaws that the entire design seems almost purposefully user-hostile. I know it’s not hostile on purpose, but it sometimes feels that way.

Begin by throwing the language away. Provide a tool that converts existing CMake scripts to the new, sane language. Use an established programming language for the new language.

That's basically what CMake already attempted to do: be a sane alternative to figuring out the madness of autoconf and Makefiles.

Re: Everything you never wanted to know about CMake (redux)

#20

Earlier quoted context omitted.

“Local minimum” is a great way to put it. I recognize that CMake has done a lot to make people’s lives easier, but it has so many design flaws that the entire design seems almost purposefully user-hostile. I know it’s not hostile on purpose, but it sometimes feels that way.

Begin by throwing the language away. Provide a tool that converts existing CMake scripts to the new, sane language. Use an established programming language for the new language.

CMake semantics except expressed in Python scripts somehow sounds even worse.
Post reply on HN