DNF 3: better performance and a move to C++
DNF 3: better performance and a move to C++
Posted Apr 8, 2018 11:00 UTC (Sun) by HelloWorld (guest, #56129)In reply to: DNF 3: better performance and a move to C++ by halla
Parent article: DNF 3: better performance and a move to C++
Just saying "cmake is insane crap" doesn't make it insane crap, and it is, of course nothing of the kindOh, it absolutely is. Its custom programming language alone is enough of a reason not to use it. You can't even do the most basic thing a function is supposed to do: return a value, for crying out loud! Instead, what people resort to is assigning values to global variables whose name is derived from the function's parameters. Functions can't have named parameters either, so what you do is you pass certain “keywords” (for lack of a better word) interleaved with other function arguments and hope that the values you're passing don't clash with the “keywords” defined by the function. Needless to say, it doesn't have any meaningful programming features, like real lists, dictionaries or, heaven forbid, first class functions. The worst part about it is that they claim this to be for “simplicity”, yet NO OTHER LANGUAGE does things like that, making the whole thing feel weird and awkward to just about anybody who's had any exposure to programming.
Every real-world build system is complicated.Which is why you need a proper programming language, and not something insane like CMake.
Now, all this might be justifiable (although not really) if the end result was actually reasonably easy to use. So what does some simple task, like building a simple program with one library dependency, look like with CMake? Something like this:
project(hello-world C) cmake_minimum_required(VERSION 2.6) PkgConfig to detect GTK+ headers/library files find_package(PkgConfig REQUIRED) pkg_check_modules(GTK3 REQUIRED gtk+-3.0) include_directories(${GTK3_INCLUDE_DIRS}) link_directories(${GTK3_LIBRARY_DIRS}) add_definitions(${GTK3_CFLAGS_OTHER}) add_executable(hello main.c) target_link_libraries(hello ${GTK3_LIBRARIES})This is garbage, why am I using a build system if I end up having to configure include directories, linker flags and locate source files and all that crap? It's the build system's job to do that! What does it look like in a language with at least somewhat sane tooling, like Scala and sbt?
libraryDependencies += "org.scalaz" %% "scalaz-core" % "7.2.21"This is the complete build definition. Now you can keep pretending that CMake is somehow not insane and stupid. Meanwhile, I'll just sit here and laugh at you.
Posted Apr 8, 2018 20:29 UTC (Sun)
by halla (subscriber, #14185)
[Link] (4 responses)
No, it isn't.
Posted Apr 8, 2018 20:35 UTC (Sun)
by HelloWorld (guest, #56129)
[Link]
Posted Apr 9, 2018 2:18 UTC (Mon)
by Cyberax (✭ supporter ✭, #52523)
[Link] (2 responses)
CMake is crap. It's a slightly better crap than most other C++ build systems but it's still crap compared to modern build systems for other languages.
Posted Apr 9, 2018 2:37 UTC (Mon)
by pizza (subscriber, #46)
[Link] (1 responses)
Different tools for different purposes; is that really so hard to comprehend?
Posted Apr 9, 2018 12:10 UTC (Mon)
by HelloWorld (guest, #56129)
[Link]
> Different tools for different purposes
DNF 3: better performance and a move to C++
DNF 3: better performance and a move to C++
DNF 3: better performance and a move to C++
DNF 3: better performance and a move to C++
DNF 3: better performance and a move to C++
Since Cyberax didn't make a comparison, I guess you meant to respond to me.
Here's my question? How exactly does the purpose of CMake – building C and C++ programs – necessitate a custom programming language for your build system that has “functions” that can't return values, doesn't have any useful data structures and is generally weird and quirky?
The answer is it doesn't, hence “different purposes” don't justify anything here.