7 ms·
I wish CMake would have kept the engine but change the syntax to something more sensible.
by xvilka 5y ago
I wish CMake would have kept the engine but change the syntax to something more sensible.
- flohofwoe 5y agoAgreed. What cmake does under the hood is actually very sensible and useful, but the arcane scripting language makes even simple things hard. Adding a "proper" alternative scripting language would be a good reason to bump the version number to 4.0
- klapatsibalo 5y agoLet's make a language that compiles to CMake! :D
- xvilka 5y agoLet's call it Autocmake.
- MaxBarraclough 5y agoOr perhaps CTools.
- rualca 5y ago...or CMake Development Kit (CDK)
- hoseja 5y agoIt is serviceable after time, and if you don't need nothing too fancy. Just remember that basically everything is a string.
- wmkn 5y agoCMake as a library with bindings for various scripting languages (e.g. Python) would make a lot of sense to me. Have the power of a proper scripting language and let the CMake library deal with generating the build system. I once looked into extracting the CMake build system generation code and make it into a standalone library. But I soon realized that it’s not exactly a weekend project.
- mathstuf 5y agoAgain, the way the language works is baked deep into the project. The stringly-typed nature is everywhere. Using Python isn't going to magically fix that list elements that contain `;` "don't work right". Policy scoping is weird and is not lexical (e.g., policies "stick" to function definitions, so calling a function can cross a policy boundary). It's one of those "ah, that sounds nice" things that is just too much work once you get down to it (and we have enough compatibility to handle without dealing with the vagaries of umpteen languages as it is).
- rualca 5y ago> CMake as a library with bindings for various scripting languages (e.g. Python) would make a lot of sense to me. Well, if your thing is fragmentation and bit rot and maintenance hell, sure. There were plenty of competing build systems for C++ that provided Python bindings, such as SCons. For some reason, CMake with its awful BASIC-like DSL became the de facto standard.
- umvi 5y agoThey should have kept it as a frontend and backend like llvm so people could use any language to interface with it
- therealjumbo 5y agoCouldn't they still do this? I think there was a project a ways back to add a lua frontend to CMake. It's been since abandoned, but I don't see why it couldn't be revitalized. I guess the project just doesn't see the value in doing it, or they don't have enough manpower.
- mathstuf 5y agoSee my sibling comment. The way CMake's language has evolved is very organic. There is a declarative core now with targets and usage requirements, but due to backwards compatibility guarantees, actually making it the only thing available is nigh impossible. Lua was also deemed not suitable in the long run because of our backwards compatibility guarantees. We'd need to ship N Lua interpreters internally because Lua is not compatible between 5.1, 5.2, 5.3, etc. Or say "we only support Lua 5.2, we cannot support 5.4" which…distros really dislike.
- enriquto 5y ago10 lua interpreters would still be less than 1% of the cmake code base. Shipping all of them would be orders of magnitude better than the current clusterfuck that cmake is. But in reality you would only need one.
- cprecioso 5y agoThat's kinda Meson I guess. I found it super pleasant - once you grasp the concepts and terminology; but the website is very informative.
- xvilka 5y agoMeson has different engine and requires Python. CMake is already nearly perfect in everything except syntax. Moreover, it requires only C++ to be built so bootstrapping is easier than in case of Meson.
- ironman1478 5y agoPython doesn't seem like a huge barrier to entry to me. CMake might be great in many ways, but the syntax is truly awful. It's just not intuitive to many people. I think due to how spacing works in CMake you can have incorrect things run and not fail. That's a huge issue, especially when onboarding people who aren't familiar with CMake. Meson has some warts, especially around documentation but it's just easier and is just generally predictable. I've converted some CMake projects internally to meson and people were able to contribute and make changes with minimal learning and training, because the structure is intuitive. That means a lot.
- dgellow 5y agoSo much this. Their DSL is so full of weird details.
- mxcrossr 5y agoAlso I wish they could nuke from orbit all the tutorials and stack exchange answers that are completely wrong about how to use it!