News for hackers. Stuff that matters.
Re:The Makefile I use with JavaScript projects by jgh on Wednesday February 28, 2018 @11:44AM (#16484238)
CMake is so nice compared to vanilla makefiles. I wonder if it can be used this way with Javascript.
Re:The Makefile I use with JavaScript projects by armitron on Wednesday February 28, 2018 @12:20PM (#16484670)
Make may seem crude these days but has manageable complexity, I've never run across a build issue I could not debug. Its model is so simple, I can have it fully in my mind and be confident this is how it works. Moreover, this model simplicity allows me to build reliable systems on top of it.

CMake is a nightmare of implied complexity. I've run into multiple situations (usually but not always involving cross-compilation) where it was simply incomprehensible. No amount of time invested would let me figure out why CMake blew up. There is no way I can build something a little out of the ordinary on top of CMake and be confident that it's solid. It's just too complicated.

This sort of balancing, upfront ease of use vs hidden complexity comes up often and I have been burned enough in the past that experience dictates to pretty much always go for model simplicity and pay the upfront costs. I don't see this often however. A lot of the time people will go for what feels or looks right, superficially, without bothering to look beneath the surface or think about model complexity costs. It's an attitude that has led to many disasters in this space.

Re:The Makefile I use with JavaScript projects by jgh on Wednesday February 28, 2018 @12:33PM (#16484798)
Fair enough but it could be that CMake isn't the right tool across the board. It works well for the projects I've used it for. Maybe one day I'll come across a case that makes me hate CMake though who knows ;)
Re:The Makefile I use with JavaScript projects by planteen on Wednesday February 28, 2018 @01:05PM (#16485118)
I do embedded work. I agree CMake is horrible when cross-compiling and runs into trouble. The errors make no sense. It took me days to get OSG cross-compiling. It was a horrible experience.

I'd much rather a Makefile where I can override the compiler and flags for my configuration. I can easily figure out what I need to do based on compiler and linker errors for missing headers and libraries.

Re:The Makefile I use with JavaScript projects by josteink on Wednesday February 28, 2018 @12:01PM (#16484462)
Maybe I'm wrong, but I always assumed CMake was optimized for the C language (thus the name)? That's at least what I've always seen it used for.

What would you gain if you're using it for other, less supported languages, like Javascript?

Re:The Makefile I use with JavaScript projects by jgh on Wednesday February 28, 2018 @12:04PM (#16484505)
It lets you generate makefiles in a less verbose way. Like if you have a lot of files in a project or a bunch of targets Makefiles can get a bit unwieldy by themselves.

I've only ever used it for C++, but I don't see why it (or something like it) couldn't be used for other languages too.

Re:The Makefile I use with JavaScript projects by isaachier on Wednesday February 28, 2018 @12:07PM (#16484533)
CMake is mostly dedicated to C/C++ projects, but also has built-in support for assembly, Fortran, and Java. CMake has templates for adding a new language as well. The benefits are: cross-platform "shell" commands (you can copy files without using an explicit cp), standard lookup for programs, and easy target generation from a collection of files. Most languages are pretty similar to C/C++ when it comes to the build cycle. Portability (i.e. testing for existence of headers) is less of a concern for something like Javascript, but everything else still applies.
Re:The Makefile I use with JavaScript projects by ethagnawl on Wednesday February 28, 2018 @12:04PM (#16484511)
I'll second this. I had to use CMake for the first time recently and was pleasantly surprised by the experience.

This tutorial was making the rounds (on HN and elsewhere) last week, but in case anyone missed it, here's a link: https://github.com/pyk/cmake-tutorial I found it to be a great primer/refresher.

Re:The Makefile I use with JavaScript projects by user404d on Thursday March 01, 2018 @09:34AM (#16492275)
I like this idea a lot. I personally don't like writing makefiles and so having nice build tools like cmake generate them for me is about as close to writing them as I want to get. Letting make stay as a low level building block for high level build tools seems like the right way to go.
Re:The Makefile I use with JavaScript projects by LukeShu on Wednesday February 28, 2018 @03:36PM (#16486619)
As a distro packager, Autotools may be a mess, but debugging a package that won't build is fairly straight-forward. If the package uses CMake though, and there's a weird build issue, debugging that can be a nightmare! Everything is so opaque, with tons of implied complexity! CMake may be nice to write, but it's hell to debug.
Re:The Makefile I use with JavaScript projects by digi_owl on Wednesday February 28, 2018 @12:02PM (#16484486)
Gotta love all caps options with a prefix(?) that only shows up on the command line...
Re:The Makefile I use with JavaScript projects by yoz-y on Wednesday February 28, 2018 @12:08PM (#16484540)
cmake is good but it is quite heavily geared towards C/C++ development. I would love to have some modern makefile with a bit nicer syntax. Fitting into 80 columns is no longer a must.
Re:The Makefile I use with JavaScript projects by gjvc on Wednesday February 28, 2018 @12:24PM (#16484718)
In case you didn't know, the 80 column limitation has its origins here

https://en.wikipedia.org/wiki/Punched_card#IBM_80-column_pun...

Re:The Makefile I use with JavaScript projects by yoz-y on Thursday March 01, 2018 @04:29AM (#16490671)
Interesting. How why the size of the card affect the size of the screen? I have assumed that it was kind of a good number for size of screens at that time.
Re:The Makefile I use with JavaScript projects by gjvc on Saturday March 03, 2018 @01:24PM (#16510681)
It most probably wasn't a limitation so much as a convention carried over from one generation of technology to the next in order to ensure the adoption of the latter.