Live data from Hacker News

The Makefile I use with JavaScript projects

olioapps.com

381–390 of 525 posts

Re: The Makefile I use with JavaScript projects

#381

Earlier quoted context omitted.

> there are real workflow differences between working with a compiler that targets a low-level language versus a high-level one. Things like how you debug the output are very different. Like what? When I've had to debug GCC, I just dumped out the GIMPLE et al.; what do you do differently with a 'transpiler'?

Sorry, "debug the output" was a really confusing way to say what I meant. What I meant was users will want to debug their code, and the way they do that is often affected by what their code is compiled to. With a transpiler, it's fairly common to actually debug using the generated output. That pushes many transpilers to place a premium on readable output that structurally resembles the original source code, sometimes…

All of that I view more as examples of how immature the tooling is on the frontend, rather than an inherent distinction between source->source and source->machine compilation.

I remember crappy C toolchains that only gave you a .map file for debugging. It was just table of where the linker put the symbols from the intermediate objects. Hell, there were a lot of really crappy C compilers then that looked way more like babel than gcc. They basically just parsed into an AST and walked it to spit out asm, hardly doing any optimizations.

Re: The Makefile I use with JavaScript projects

#382
post #289

Earlier quoted context omitted.

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.

Again, if you're a cross-platform developer, make is not for you. Do you also expect zsh enthusiasts to court Windows devs?

I kind of disagree, it's quite possible to use gnu make on Windows with msys (though requires some scripting discipline and probably not for everyone).

I'm currently doing this for a cross platform c++ project. Same makefile used for Linux, Mac, and windows+msys+cl.exe. (yes, fair amount of extra variables and ifdefs to support the last one...)

Re: The Makefile I use with JavaScript projects

#383
post #6

After going through a few build systems for Javascript, I realized they were all reinventing the wheel in one way or the other, and pulled out venerable Make from the closet. It turned out to be way more expressive and easy to read. One target to build (prod), another to run with fsevents doing auto-rebuild when a file is saved (instant gratification during dev), then a few targets for cleaup & housekeeping. All said…

The reason I don't like doing this is portability. Since the steps within the makefile are going to be run through a shell, it is going to behave differently on different systems. If your makefile fixes up a file using sed and your system has gnu sed, your makefile may fail on a system with BSD sed (e.g., a mac). If you rely on bash-isms, your makefile may not work on a debian system where it will be run with dash in…

Doesn’t autoconf address these issues?

Re: The Makefile I use with JavaScript projects

#384

Earlier quoted context omitted.

> It seems that 90% of computer use has moved into the web browser. This is an extremely (web) developer-centric viewpoint IMHO. Try telling 3D modellers/sculptors, games programmers, audio engineers that 90% of their computer use has moved into a browser. They will look at you with a blank face since they all require traditional "fat" desktop apps to get their work done at professional level. And those are just the…

Do all of those computer users constitute more than 10% of computer users? I don't think there's even 5% of computer users there. Talking about 3D modelling, game programming and producers like they're the majority is a technologist-centric view. Most computer use is by people who think the web is the internet and use 'inbox' as a verb.

> Do all of those computer users constitute more than 10% of computer users? I don't think there's even 5% of computer users there.

So as stated that was the list of the top of my head. I just pulled from my personal list of hobbies, things that I use a computer for other than programming or automation.

Within 50 feet of me at work there are a whole bunch of electrical engineers who spend 90% of their time in some fat app for designing, I dunno, telco electrical stuff.

In the fishbowl next to that, are 50 network operations staff who spend 90% of their day in "fat" network monitoring applications.

I'm just pointing out if you look far enough there are plenty of people using apps outside a web browser for their daily work and hobbies.

In my nearly 25 career in IT I have never heard people use 'inbox' as a verb (as in 'inbox me?'). Sure some people must say it sometimes, but I think this is overstated and another example of programmer cliche or hyperbole.

Re: The Makefile I use with JavaScript projects

#385
post #6

After going through a few build systems for Javascript, I realized they were all reinventing the wheel in one way or the other, and pulled out venerable Make from the closet. It turned out to be way more expressive and easy to read. One target to build (prod), another to run with fsevents doing auto-rebuild when a file is saved (instant gratification during dev), then a few targets for cleaup & housekeeping. All said…

The reason I don't like doing this is portability. Since the steps within the makefile are going to be run through a shell, it is going to behave differently on different systems. If your makefile fixes up a file using sed and your system has gnu sed, your makefile may fail on a system with BSD sed (e.g., a mac). If you rely on bash-isms, your makefile may not work on a debian system where it will be run with dash in…

You don't shell out complex crap in a makefile, create a configure script and pass vars

Re: The Makefile I use with JavaScript projects

#386

Earlier quoted context omitted.

> It seems that 90% of computer use has moved into the web browser. This is an extremely (web) developer-centric viewpoint IMHO. Try telling 3D modellers/sculptors, games programmers, audio engineers that 90% of their computer use has moved into a browser. They will look at you with a blank face since they all require traditional "fat" desktop apps to get their work done at professional level. And those are just the…

> Try telling 3D modellers/sculptors, games programmers, audio engineers that 90% of their computer use has moved into a browser. They will look at you with a blank face since they all require traditional "fat" desktop apps to get their work done at professional level. I'm talking about overall computer use. For certain professional fields, yes, apps still matter. But I'd take a guess that the majority of screen time…

> Heck as a programmer (not web), I am probably 50% in browser looking things up.

I should have put web in square brackets eg. [web] to indicate "optional". You seem to fall into the category I was describing.

Use an IDE (other than Atom), eg. Visual Studio, Eclipse, IntelliJ? All fat apps.

Use VMware workstation or Virtualbox? Fat apps.

> At most offices, computers are used for web browsing, and Microsoft Office.

So is that 90% web browsing and 10% MS Office? BTW, Office365 is still fat application (or suite of them) last time I looked.

Re: The Makefile I use with JavaScript projects

#387
post #247
post #185

Earlier quoted context omitted.

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

On plan 9, you'd do something like: ctlfd = open("/mnt/sql/ctl", OREAD|OWRITE); write(fd, "your query"); read(fd, resultpath); resultfd = open(resultpath, OREAD); read(fd, result); close(resultfd); This is similar to the patterns used to open network connections or create new windows.

And how would you use that in a makefile?

Re: The Makefile I use with JavaScript projects

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

A compiler converts code in one language to another language. That’s the literal definition. In the case of machine code, the “collection” step would be performed by the linker.

gcc compiling some C and Babel compiling some JavaScript are both performing the same role. So much so the similarities in how they carry it out are striking.

Re: The Makefile I use with JavaScript projects

#389
post #326

Earlier quoted context omitted.

No, not really - I have no particular opinion about what POSIX chooses to support or not. But I'm going to go back to my original point. What I do have an opinion about is how reasonable it is for tools not to support a character that is valid in file names, when that character is straightforward to support with everyday, well known syntax. And when that character is ' ', the standard English word separator, as strai…

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

Re: The Makefile I use with JavaScript projects

#390
post #326

Earlier quoted context omitted.

No, not really - I have no particular opinion about what POSIX chooses to support or not. But I'm going to go back to my original point. What I do have an opinion about is how reasonable it is for tools not to support a character that is valid in file names, when that character is straightforward to support with everyday, well known syntax. And when that character is ' ', the standard English word separator, as strai…

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.
Post reply on HN