Live data from Hacker News

The Makefile I use with JavaScript projects

olioapps.com

151–160 of 525 posts

Re: The Makefile I use with JavaScript projects

#151
post #127
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.

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.

But we called it lots of other things.

Re: The Makefile I use with JavaScript projects

#152

Earlier quoted context omitted.

It's not like C is famous for having particularly good syntax. If anything, it's the worst thing about it.

They must have got something good though. Else why would there entire families of C-like languages ? Plus, to me C syntax is particularly good. You're writing real words and the computers does the things you tell it to. To the letter.

I've got no issue with C syntax either, but to be clear, syntax != semantics.

To cut to the chase:

* syntax = structure

* semantics = meaning

C syntax would include things like curly braces and semicolons, whereas C semantics would include things like the functionality of the reserved keywords.

This SO answer gives a more detailed explanation:

https://stackoverflow.com/a/17931183/1863924

Re: The Makefile I use with JavaScript projects

#153

Earlier quoted context omitted.

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

They don't though. Vanilla Vim/Vi doesn't for instance. Regardless of whether the editor can or not, I just don't see how insisting on tab and not space is remotely defensible.

https://stackoverflow.com/a/29787362

> remotely defensible

Feel free to write your own make superset that supports spaces. It's an irrelevant factor to the usability of make as a whole.

Re: The Makefile I use with JavaScript projects

#154
post #23

Make's interface is horrible. Significant tabs. Syntax which relies on bizarre punctuation... If only whoever authored Make 40 years ago had had the design acumen of a Ken Thompson or a Dennis Ritchie! We're stuck with Make because of network effects. I wish that it could just become "lost" forever and a different dependency-based-programming build tool could replace it... but that's just wishful thinking. The pace o…

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?

How many of those languages are declarative, not imperative? The advantage of Make is that you only need to give it the inputs and the outputs.

Re: The Makefile I use with JavaScript projects

#155
post #143
post #135

Earlier quoted context omitted.

That doesn't work for me. Tried with empty Makefile, no Makefile, with make (PMake) and gmake (GNU Make).

Don't know why that would be. I'm using GNU Make 4.1, but this has worked for years and years as far as I knew. Not a particularly useful feature, so I it doesn't really matter, but you messed up my fun fact. dima@fatty:/tmp$ mkdir dir dima@fatty:/tmp$ cd dir dima@fatty:/tmp/dir$ touch foo.c dima@fatty:/tmp/dir$ make -n foo cc foo.c -o foo dima@fatty:/tmp/dir$ make --version GNU Make 4.1 Built for x86_64-pc-linux-gnu…

I had fun learning about that.

Re: The Makefile I use with JavaScript projects

#156
post #97

Tangential, but I cringe everytime I see the word "transpiler". A compiler is a compiler is a compiler. Previous discussion on this: https://news.ycombinator.com/item?id=15154994

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

I'm OK with using the word transpiler, but don't try to modify existing words. A compiler translates from language to language. If you want to say that the compilers whose target is a high level language should be called transpilers, that's ok, but that makes them a subset of compilers, not mutually exclusive.

Re: The Makefile I use with JavaScript projects

#157

Earlier quoted context omitted.

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

They don't though. Vanilla Vim/Vi doesn't for instance. Regardless of whether the editor can or not, I just don't see how insisting on tab and not space is remotely defensible.

> 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 years. You can see the Wiki[1] page on it (which starts "This is one of the eternal Holy Wars") for arguments as to why someone might prefer tabs. I personally like them because they allow the reader of the code to choose the visual layout of the indentation.

Now, while I love tabs, I work in Python all day. But good editors, like Vim, allow you to customize the indentation settings sufficiently to handle both cases like Python (spaces for indent) and Makefile (tabs) gracefully. So "Indent" and "Dedent" just do The Right Thing™ and it mostly never matters.

[1]: http://wiki.c2.com/?TabsVersusSpaces

Re: The Makefile I use with JavaScript projects

#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 for other kinds of workflows.

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.

Re: The Makefile I use with JavaScript projects

#159
post #135
post #126

Earlier quoted context omitted.

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.

That doesn't work for me. Tried with empty Makefile, no Makefile, with make (PMake) and gmake (GNU Make).

Then you did something wrong — it definitely works with GNU make (can’t speak for PMake):

https://asciinema.org/a/zVu7sYyh7lQZTNAgAsbKUmocr

Re: The Makefile I use with JavaScript projects

#160
post #2

One thing I've found useful about gulp and webpack is the fact that it's multiplatform. What is the best approach to make sure your Makefile will work as expected on every platform, meaning, windows included? For example: Can we write file paths using forward-slashes, or is it still an issue? I imagine running it via git bash (bash provided by the git installer on windows).

Btw Windows has supported slashes forever. Just don't mix the two.
Post reply on HN