Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


You don't need a Makefile, but you can just run "make foo" and it'll automatically run "cc -o foo foo.c" for you.


Almost thirty years and I never knew that.


Make has builtin rules for most obvious build jobs: 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-...

And (with care) define your own in: https://www.gnu.org/software/make/manual/make.html#MAKEFILES...


You probably know that this is routine and even simpler in Go:

   $ go run main.go


Yes, 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.


> 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. ;)


I’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.


> 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.


Even simpler in C, when using tcc as the compiler.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: