6 ms·
> Both C and Make are decades-old technologies, but most people can read a C file without much experience and intuitively understand what is going on. While th
by mschaef 9y ago
> Both C and Make are decades-old technologies, but most people can read a C file without much experience and intuitively understand what is going on.
While they might think they know what's going on, I'm not convinced they actually do. C can be an incredibly subtle language to get right...
http://blog.llvm.org/2011/05/what-every-c-programmer-should-know.html http://blog.llvm.org/2011/05/what-every-c-programmer-should-...
Regarding make, the thing to realize there is that it's just a DSL for specifying a dependency graph (and the way for satisfying dependencies). It's not a hard concept, but unless you come to the field with a bit of computer science background, it's not likely something you've been directly exposed to at the level required to understand make. But I don't know that this means make's choice of abstraction is necessarily a bad thing for its intended use cases. I also think this tends to put the lie to the notion that the difficulty is mainly around tabs... tabs may obscure the details, but switching to a clearer syntax won't solve the more fundamental gaps in understanding the mechanics of make.
I'll also argue that this is a potential problem with DSL's in general... because DSL's often don't use traditional imperative language semantics, there's always a bit of a learning curve that needs to be ascended. However, for make at least, there are a useful debugging tools to help understand what it's actually doing.
For me, at least, 'make -n' is great in that it instructs make to resolve the dependency graph based on the current state, and then just print the commands it'll run without executing them. If you know what the commands do, and know what needs to run, this can be a huge help understanding what's going on. (And there are other more powerful debugging capabilities as well for dumping variables, etc.)
- crdoconnor 9y agoDSLs are most suited to constrained execution spaces - where you know that there are relatively hard limits on what it is that the resultant program will have to do. The problem is that build systems are not really a constrained execution space - there's too often a lot more required than just specifying a dependency tree and just saying 'make it happen'. As with many 'simplified' DSLs that are often unsuited to the task at hand (e.g. C++ templating), make (or versions of it, anyway), evolved to accommodate these use cases and then morphed into something that accidentally became turing complete: https://stackoverflow.com/questions/3480950/are-makefiles-turing-complete https://stackoverflow.com/questions/3480950/are-makefiles-tu...
- mschaef 9y ago> As with many 'simplified' DSLs that are often unsuited to the task at hand (e.g. C++ templating) Isn't a C++ template the exact opposite of 'Domain Specific'?