Preferences

“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.
These days we have Starlark, which is the core part of Python, modified to be completely hermetic & deterministic (by removing some things and changing others), and modified to support parallel execution. It is very nice to work with, since you can use a lot of Python tooling and Python experience, but you don’t have to carry around a complete Python implementation.

It was originally part of Bazel but it is used in other tools, and there are multiple implementations.

That's basically what CMake already attempted to do: be a sane alternative to figuring out the madness of autoconf and Makefiles.
The language itself is, in many ways, worse than the shell scripts it replaced with autoconf.
I don't disagree that the CMake language is badly misguided. I think that the SCons approach of just writing Python is sensible rather then inventing a whole new scripting language as well as a build system.

But CMake probably will get you a program that compiles cross-platform within an hour or two, even for a novice. Autotools probably won't do that for you.

SCons is utterly horrible. It isn’t a build system so much as a “Build your own build system” system. It gives you absolutely nothing to manage dependencies or shared information, or cross-platform ways of handling compiler features.

As such, everything using it is it’s own unique system completely alien and not interoperable with anything else.

And being python seems to lead to people embedding parts of their application as part of the build system, so now that is intertwined also.

I will run a million miles if I ever see a project using SCons, CMake is infinitely nicer, and makes some sense but I agree with further up the thread that it needs a new, saner language that maps over the top (expressions would be a start).

Hm. We had a SCons based build system around ten years back where we ran 10 different C++ compilers/toolchains for multiple native and cross build targets without any problems. Yes, we had to write some stuff on top of it, but after some systematic design, it went really smoothly.
If the new language would allow such a tool to work, it probably wouldn't be much better. It would either still have most of the awful behavior that the old language had or the converted scripts wouldn't be better than before.

The way the cmake_policy system works isn't bad, but those unfortunately have only limited impact on the language itself.

This item has no comments currently.

Keyboard Shortcuts

Story Lists

j
Next story
k
Previous story
Shift+j
Last story
Shift+k
First story
o Enter
Go to story URL
c
Go to comments
u
Go to author

Navigation

Shift+t
Go to top stories
Shift+n
Go to new stories
Shift+b
Go to best stories
Shift+a
Go to Ask HN
Shift+s
Go to Show HN

Miscellaneous

?
Show this modal