4 ms·
I've always loved programs that didn't even need "make". The ideal build and install experience should be: $ gcc foo.c; cp a.out ~/bin/foo $ foo Now t
by dheera 3y ago
I've always loved programs that didn't even need "make". The ideal build and install experience should be:
$ gcc foo.c; cp a.out ~/bin/foo
$ foo
Now that is a REALLY good build experience.
- tomcam 3y agoYou probably know that this is routine and even simpler in Go: $ go run main.go
- dheera 3y agoYes, and it boggles my mind why C/C++ hasn't come up with a better built-in build system already. I shouldn't have to specify a ton of flags to g++ something, it should find them within the project directory and pull in dependencies automatically. Header files should be done with. Poof. Gone. There is zero reason for them to exist. I know exactly why they exist, but it's an artifact of a system where preprocessor, compiler, linker are separate. I should be able to do "import<foo/bar>" multiple times and it should pull in all the classes and functions in "./foo/bar.cpp" or "./foo/bar.so" (whichever is available), just like Python, and cache the ".so" files just like Python caches ".pyc" files. Improving C++'s build experience would have absolutely zero impact on execution speed. Yet they're busy adding some stupid spaceship operators and other things people almost never use.
- morning-coffee 3y ago> Yes, and it boggles my mind why C/C++ hasn't come up with a better built-in build system already. Wait... you didn't get the memo? They did, and renamed the language in the process... it's called Rust. ;)
- tomcam 3y agoI’m annoyed too, because I love C and back in the 90s languages like Turbo C and Microsoft C were quite intuitive to use from the command line and using whatever old editor you wanted. I would still very happily be using modern C if the overall experience were like Go.
- lelanthran 3y ago> Header files should be done with. Poof. Gone. There is zero reason for them to exist. The reason they still exist is due to how useful they are. The majority of Android applications probably wouldn't exist if C had done away with headers.
- lelanthran 3y agoEven simpler in C, when using tcc as the compiler.
- chungy 3y agoYou don't need a Makefile, but you can just run "make foo" and it'll automatically run "cc -o foo foo.c" for you.
- anyfoo 3y agoAlmost thirty years and I never knew that.
- wruza 3y agoMake has builtin rules for most obvious build jobs: https://www.gnu.org/software/make/manual/html_node/Catalogue-of-Rules.html https://www.gnu.org/software/make/manual/html_node/Catalogue... You also can pass env vars to it: $ CC=clang make foo https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html https://www.gnu.org/software/make/manual/html_node/Implicit-... And (with care) define your own in: https://www.gnu.org/software/make/manual/make.html#MAKEFILES-Variable https://www.gnu.org/software/make/manual/make.html#MAKEFILES...