Live data from Hacker News

The Makefile I use with JavaScript projects

olioapps.com

401–410 of 525 posts

Re: The Makefile I use with JavaScript projects

#401
post #104
post #58

Earlier quoted context omitted.

Maybe I'm in the minority, but I've always found its syntax to be quite nice (though admittedly a departure from most modern languages). Then again, I find using JSON or not-quite-ruby to configure a build incredibly bizarre and confusing, so I guess I'm just set in my ways... In all seriousness, what's wrong with it? Significant tabs aren't great, but I feel like that's a relatively minor wart. The simple things are…

"In all seriousness, what's wrong with it?" 1. Claiming a rule makes a target, but then fails to make that target, ought to be a runtime fatal error in the makefile. I can hardly even guess at how much time this one change alone would have saved people. 2. String concatenation as the fundamental composition method is a cute hack for the 1970s... no sarcasm, it really is... but there's better known ways to make "templ…

With the debugging expansion thing you're mentioning, now I'm craving a make built on some minimalist functional programming language like Racket where "expand the call tree" is a basic operation.

Re: The Makefile I use with JavaScript projects

#402

Earlier quoted context omitted.

you could mount the database as a filesystem

With respect to Make, does the database (mounted as a filesystem) retain accurate information that Make needs to operate as designed (primarily the timestamps). To what level of granularity is this data present within the database, and what is the performance of the database accessed in this way? Will it tell you that the table was updated at 08:40:33.7777, or will it tell you only that the whole database was altered…

You're talking about a theoretical implementation of a filesystem with a back-end in a relational database. The question is only whether the information is available.

Say directories map to databases and files map to tables and views. You can create new tables and views by either writing data or an appropriate query. Views and result files would be read-only while data files would be writable. Writing to a data file would be done with a query which modifies the table and the result could be retrieved by then reading the file -- the modification time would be the time of the last update which is known.

Views and queries could be cached results from the last time they were ran which could be updated/rerun by touching them or they could be dynamic and update whenever a table they reference is updated.

Re: The Makefile I use with JavaScript projects

#403
post #40

Earlier quoted context omitted.

Make is such a horrifically awful thing to work with that I just end up using a regular scripting language for building. Why learn another language with all its eccentricities and footguns when I already know several others?

Another advantage of using a scripting language is that the hard work of portability will already have been done for you by the authors of the scripting language. Make, in contrast, works within a shell and invokes programs which may be either wildly or subtly incompatible across platforms. Add in the lacking support for conditionals in POSIX make and portability is a nightmare.

To be fair, at the core much of what you're going to be doing is invoking command-line tools. I mean, most compilers are invoked as command-line tools.

Re: The Makefile I use with JavaScript projects

#404
post #80

Earlier quoted context omitted.

> If only whoever authored Make 40 years ago Make was created by Stuart Feldman at Bell Labs in 1976. The fact that it is still in use in any form and still being discussed here is a testament to what an amazingly good job he did at the time. Whether it is the right tool for any given modern use case is up to the people who decide to use it or pass it by. I still work with almost daily, and it's in wide use by backen…

Look at the git makefile: https://github.com/git/git/blob/master/Makefile You know what you have to do to build git? Type make. It's amazing.

Actually, you might want to glance at the first few hundred lines of platform specific stuff you are supposed to set manually before the main makefile begins. Literally meant to be set by hand, but the Git developers made educated guesses about the specifics of each platform.

Re: The Makefile I use with JavaScript projects

#405
post #219

Earlier quoted context omitted.

How would you fix that with your preferred make replacement? None of that has anything to do with make, you're trying to solve a stateful problem ("did I send this or not?") without using any state. That just doesn't work. It's not a make thing at all.

Lisper was replying to the OP who suggested using Make for general workflows. Make falls apart when your workflow doesn't naturally involve file modification tasks. With regard to my last comment (the problem with small changes in a file resulting in full-system recompilation), see Tup. It maintains a database of what's happened. So when foo.c is altered it will regenerate foo.o. But if foo.o is not changed, you can…

I mean you're just describing make but with hashes instead of file modification times. It's probably the most common criticism of make that its database is the filesystem. If file modification times aren't meaningful to your workflow then of course make won't meet your needs. But saying the solution is 'make with a different back-end' seems a little silly, not because it's not useful, but because they're not really that different.

GNU make handles multiple outputs alright but I will admit they if you want something portable it's pretty hairy.

Re: The Makefile I use with JavaScript projects

#406
post #325
post #322

Earlier quoted context omitted.

Why would you add an 'h' to 'pattern'?

I think that just supports my argument, really. I've never really used makefiles. The blog post talked about using patsubst to change a path. The name of the function essentially gives no clue at all what it does.

"the blog post talked"

Isn't that the problem with using blog posts as educational sources?

(I'm happy I was learning all my toolkit long before blogs became a thing. It's hard to open and read Physics book, when someone on YT talks funny about its second chapter.)

Re: The Makefile I use with JavaScript projects

#407
post #347

Earlier quoted context omitted.

It sounds like you are looking for something like Yocto/OE, which you can bake pretty much any build script into, cross compile and deploy. What exactly are you looking for with regards to deployment, and what tool do use, instead of CMake, to give you that ability?

Can Yocto or CMake build QNX systems or bare-metal binaries with TI's compiler? The tool I'm looking for is Make because Make gives me a ton of flexibility to build whatever freaky combination of binaries might go into whatever product I'm working on, and then combine those binaries into a system image. The point I'm trying to make is that every build system except Make solves a really specific class of build problem…

It seems like CMake supports both of these out of the box:

https://github.com/Kitware/CMake/blob/master/Modules/Platfor... https://github.com/Kitware/CMake/blob/master/Modules/Compile...

Re: The Makefile I use with JavaScript projects

#408
For me, the problem with all make replacements is that they don't just solve makefile's issues in knowledge-compatible way, but reinvent their own cryptic syntax and structure from scratch. Minor issues that you know about (and know how to avoid) are never worth fixing in this way, since most people don't have time to learn infinite variations of superior tool #1 that has its own flaws. They are fine with #2 that works for them.

When someone says "there are numerous alternatives", I just look out the window and smile.

Almost all issues mentioned itt can be solved in barely-compatible, but easily transition-able way. If this tool exists, its name is welcome.

Re: The Makefile I use with JavaScript projects

#409
post #389

Earlier quoted context omitted.

Please write a makefile that uses an environment variable as a mysql password to connect to a mysql server and perform an arbitrary administrative task. Now do the same, assuming that the password can have a dollar in it. You can do it. It is not as easy, readable or maintanable. Avoid it if you can.

Not a problem if you use a my.cnf file...

And I need that because of ... a dollar!

Extra complication to avoid if possible.

Re: The Makefile I use with JavaScript projects

#410
post #390

Earlier quoted context omitted.

Please write a makefile that uses an environment variable as a mysql password to connect to a mysql server and perform an arbitrary administrative task. Now do the same, assuming that the password can have a dollar in it. You can do it. It is not as easy, readable or maintanable. Avoid it if you can.

Why do it from a makefile instead of a script called by the makefile? This plays well to the strengths of both.

Just because of the dollar? Exactly my point.
Post reply on HN