Live data from Hacker News

The Makefile I use with JavaScript projects

olioapps.com

121–130 of 525 posts

Re: The Makefile I use with JavaScript projects

#121
post #111

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 actually doesn't know anything at all about how to build C, C++, or any other kind of code. I guess it depends on how you define "know", but there are implicit rules. $ cat foo.c #include int main() { printf("Hello\n"); return 0; } $ cat Makefile foo: foo.c $ make cc -O2 -pipe foo.c -o foo $ ./foo Hello

Yeah. There is a metric crap-ton of the design of Make that is solely for the purpose of compiling and linking and document processing. That's actually part of what makes it annoying to use it for projects other than C or C++, when you don't need to compile or transform or depend on different formats.

Re: The Makefile I use with JavaScript projects

#123
post #66

Earlier quoted context omitted.

Simple makefiles couldn't be more simple. task: dependency list of commands That's about as easy as it gets.

Until a stray space finds its way into your command list indentation...

Every popular text editor handles this already. People manage make, python and other whitespace-specified languages just fine.

Re: The Makefile I use with JavaScript projects

#124

Earlier quoted context omitted.

Wow if you consider Makefiles easy to read...

It's certainly better than the 200+ lines of JavaScript something like Webpack spits out when you statr a new project. I had to debug some of our project's build files and realized halfway through that my teammates didn't write this Webpack config monstrosity, Webpack generated it by /default/.

Webpack, by itself, doesn't generate configs, unless you're referring to the Webpack CLI tool.

FWIW, Webpack 4 (which just went final a few days ago) now has "zero-config" defaults out of the box. You may want to give that a shot.

Re: The Makefile I use with JavaScript projects

#125
post #120
post #97

Earlier quoted context omitted.

Meh: Compiler: collects sources from various places, assembles the result into machine code. Transpiler: collects sources from various places, converts the source to another language. Personally I cringe at the newspeak you seem to imply we should all be applying to our lives. These words mean things - quite different things, it turns out. There's a difference between human-readable source code language, and machine-…

> newspeak you seem to imply we should all be applying to our lives. http://foldoc.org/transpiler ^ no match. transpiler is the newspeak.

foldoc.org is the product of a single individuals' construction of definitions of computing terms and is by no means a complete and authoritative source of technical terms. It says so right there on the site...

However, this is a fun game, so lets play:

http://www.yourdictionary.com/transpiler

https://en.wiktionary.org/wiki/transpiler

https://www.thefreedictionary.com/transpiler

https://www.quora.com/What-is-a-transpiler

Re: The Makefile I use with JavaScript projects

#126
post #111

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 actually doesn't know anything at all about how to build C, C++, or any other kind of code. I guess it depends on how you define "know", but there are implicit rules. $ cat foo.c #include int main() { printf("Hello\n"); return 0; } $ cat Makefile foo: foo.c $ make cc -O2 -pipe foo.c -o foo $ ./foo Hello

Fun fact: your Makefile above is redundant. You can delete it entirely, and the implicit rules you're using here continue to work just fine.

Re: The Makefile I use with JavaScript projects

#127
post #120
post #97

Earlier quoted context omitted.

Meh: Compiler: collects sources from various places, assembles the result into machine code. Transpiler: collects sources from various places, converts the source to another language. Personally I cringe at the newspeak you seem to imply we should all be applying to our lives. These words mean things - quite different things, it turns out. There's a difference between human-readable source code language, and machine-…

> newspeak you seem to imply we should all be applying to our lives. http://foldoc.org/transpiler ^ no match. transpiler is the newspeak.

The original C++ is probably the most famous 'transpiler'

https://en.wikipedia.org/wiki/Cfront

http://www.softwarepreservation.org/projects/c_plus_plus/cfr...

ohey, noone calls it a 'transpiler'.

I'm not so angry about the word transpiler; perhaps it might improve things.. but to imply that using compiler as a common term for all things here is a regression/neologism is patently wrong - transpiler is the newcomer.

Re: The Makefile I use with JavaScript projects

#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. Incremental builds by looking for changed dependencies, a configuration file with its own significant identifiers (i.e. a build DSL shoehorned into JSON or YAML), generalized target rules, shelling out commands, sub-project builds, dry runs, dependencies for your own script, parallelization, and a…

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

Re: The Makefile I use with JavaScript projects

#129
post #125
post #120

Earlier quoted context omitted.

> newspeak you seem to imply we should all be applying to our lives. http://foldoc.org/transpiler ^ no match. transpiler is the newspeak.

foldoc.org is the product of a single individuals' construction of definitions of computing terms and is by no means a complete and authoritative source of technical terms. It says so right there on the site... However, this is a fun game, so lets play: http://www.yourdictionary.com/transpiler https://en.wiktionary.org/wiki/transpiler https://www.thefreedictionary.com/transpiler https://www.quora.com/What-is-a-transp…

please feel free to attribute or posit another source w/r/t etymology within computing, I'm all ears.

I doubt you'll find 'transpiler' at the origins of computing history; see also C++/cfront post

Re: The Makefile I use with JavaScript projects

#130

A long time ago, in a developer's paradise called the 1970's there was an automated build tool called "make". It had this and only this syntax: If a line begins at character 0, that is a list of files whose timestamps should be checked, if any are 'old', then execute the series of command lines beneath, identifying them as starting with a tab character. That was it, the entire syntax of "make", and it was complete. T…

That almost describes how I still use "make" -- and smart people pretty much always fuck up my makefiles sooner or later.
Post reply on HN