Live data from Hacker News

The Makefile I use with JavaScript projects

olioapps.com

271–280 of 525 posts

Re: The Makefile I use with JavaScript projects

#271

Earlier quoted context omitted.

The tools are not the same on every platform. That’s reason enough for me to not use it with my JavaScript projects. The bigger reason though is that it’s not very idiomatic for JavaScript projects to use Make. It sounds like the only reason that some people go out of their way to use it is because they actually don’t want to learn something.

> "The tools are not the same on every platform." Any common examples? > "It’s not very idiomatic for JavaScript projects to use Make." While I agree that popularity is a factor in picking a tool, it shouldn't be a deciding factor. Going by popularity is precisely how we end up with a new Build System of the Year(TM) every few years. The fact that we've gone through 4 fairly prominent tools (Gulp, Grunt, Broccoli, We…

This comment points out the kind of problems that can occur just on Unix systems - https://news.ycombinator.com/item?id=16485637

And then there’s Windows...

Anyway, the fact that things change quickly in JS-land is more of a testament to how popular it is than anything else IMO. If C were used in the same environments as JS, I’m sure that you'd see just as much churn.

Re: The Makefile I use with JavaScript projects

#272

Earlier quoted context omitted.

send: foo.log tail foo.log | email touch send

Correct, that works for this example. But if you have a lot of tasks that involve non-filesystem activities you'll end up littering your filesystem with these empty files for every one of them. This can lead to its own problems (fragility, you forgot that `task_x` doesn't generate a file, or it used to generate one but no longer does, etc.).

> you'll end up littering your filesystem with these empty files for every one of them

These files are information just like files that are not empty.

Re: The Makefile I use with JavaScript projects

#273

Earlier quoted context omitted.

Wow if you consider Makefiles easy to read...

I’ve written about Makefiles for the web before, you can’t say they can’t be readable: http://blog.gnclmorais.com/makefiles-are-for-the-web

Something about the Makefile in your post is a bit weird though: You only declare "test" as a PHONY target, but every other target in the file is just as PHONY. And since you don't even explain that line, it could be a bit confusing.

Re: The Makefile I use with JavaScript projects

#275
post #128

Earlier quoted context omitted.

> Because, like many other things in programming, you'll end up with a half-baked and buggy implementation of make anyways. I'd argue that make is a half-baked and buggy implementation of make - so that's not really a drawback so much as the status quo. E.g. I have scripts that exist mainly to carefully select the "correct" version of make for a given project to deal with path normalization and bintools selection iss…

> path normalization and bintools selection issues on windows make was never intended to be a cross-platform tool. If you face problems using it on Windows, then that's on you.

That is, unless the folks who maintain and champion make want me to use make. It's on them to court me, the cross-platform developer, not the other way around.

Re: The Makefile I use with JavaScript projects

#276
post #185
post #169

Earlier quoted context omitted.

> Make has deeply woven into it the assumption that the product of workflows are files, and that the way you can tell the state of a file is by its last modification date. I've always wondered whether Make would be seen as less of a grudging necessity, and more of an elegant panacea, if operating systems had gone the route of Plan 9, where everything is— symbolically —a file, even if it's not a file in the sense of "…

> everything is—symbolically—a file How are you going to make the result of a join in a relational database into a file, symbolically or otherwise?

you could mount the database as a filesystem

Re: The Makefile I use with JavaScript projects

#277
I use Automake and Autoconf (which generates the Makefile) for GNU ease.js:

https://git.savannah.gnu.org/cgit/easejs.git/tree/Makefile.a... https://git.savannah.gnu.org/cgit/easejs.git/tree/configure....

The nice thing with using Automake is that it gives all the standard build targets with little additional effort (for example, `make dist` for producing the distribution tarball, and `make distcheck` for verifying that it's good).

I use a much simpler one for a project at work:

https://gitlab.com/lovullo/liza/blob/master/Makefile.am https://gitlab.com/lovullo/liza/blob/master/configure.ac

Re: The Makefile I use with JavaScript projects

#278
post #158

I think the reason make is both so controversial and also long-lived is that despite how everyone thinks of it, it isn't really a build tool. It actually doesn't know anything at all about how to build C, C++, or any other kind of code. (I know this is obvious to those of us that know make, but I often get the impression that a lot of people think of make as gradle or maven for C, which it really isn't.) It's really…

> It's really a workflow automation tool, That's true. > and the UX for that is actually pretty close to what you would want. That is so not true. Make has deeply woven into it the assumption that the product of workflows are files, and that the way you can tell the state of a file is by its last modification date. That's often true for builds (which is why make works reasonably well for builds), but often not true f…

>But regardless of that, a tool that makes a semantic distinction between tabs and spaces is NEVER the UX you want unless you're a masochist.

GNU make has had an option (.RECIPEPREFIX) to change this for a long time now. Stop whining.

Re: The Makefile I use with JavaScript projects

#279

Earlier quoted context omitted.

> Vanilla Vim/Vi doesn't for instance. Vim does handle this. Here is Vim (and I've removed my .vimrc file, so this is not a setting I have set personally), on a Makefile where the third line erroneously uses spaces: https://i.imgur.com/xMHXeL4.png > I just don't see how insisting on tab and not space is remotely defensible. This is like insisting that people haven't been having religious wars over this sort topic for…

If someone is really paranoid about white space issues in a file you’re editing on vim, you can can always use `:set list` to display those characters.

or, you can write your recipes as

    target : requisites ; recipe
with a semicolon instead of a tab.

However, tabs are beautiful, and every occasion to use them should be cherised as precious.

Re: The Makefile I use with JavaScript projects

#280
post #253

Make has dated syntax and conventions. When developers use emojis in command line, support for the spaces and other quirks look worse than a decade ago. Despite all of its expressive power and speed, Make is not going to attract many frontend developers. If the concepts behind Make are repackaged in a more hipster way, the resulting tool may get far more appeal. Shake https://shakebuild.com is a build system library…

I like functional programming languages and Haskell is something that interests me. But you can't be serious when you say that make is out-of-touch with the average frontend developer, and then link to this: https://shakebuild.com/manual

I suggested making new build system that has the power of Make or Shake and is still oriented toward frontend development.

You are right that Shake and most general purpose build tools are out-of-touch with frontend. Even for people who are comfortable with these tools, they are not necessarily better than Webpack for the typical frontend tasks. Shake place in this hypothetical tool will be at its backend - like LLVM is the backend of many compilers.

Post reply on HN