Live data from Hacker News

The Makefile I use with JavaScript projects

olioapps.com

491–500 of 525 posts

Re: The Makefile I use with JavaScript projects

#491

Earlier quoted context omitted.

You do, since different communities use different build tools. And they even switch tools, for the new kid on the block.

Bullshit. You're arguing as if every JS developer has to interact with every JS community. Stop presenting these ridiculous false dichotomies.

You often do though. For example if you want to do open source development on JS projects, this means that you might have to learn many different build systems.

Re: The Makefile I use with JavaScript projects

#492

Earlier quoted context omitted.

> "Basically, it’s used everywhere that C is used and then some." It's the other way around. Every JavaScript program is run by a C/C++ program.

But if you consider browsers to be a "platform", which I think they are in fairness, then the GP comment could still apply. Whether the browser is written in C is pretty irrelevant to whether it can host it.

I conjecture that an upper-level "platform" that's on top of a lower-level "platform", for some definition of "platform", will be less varied and fragmented than the lower-level one.

Re: The Makefile I use with JavaScript projects

#493
post #332

Earlier quoted context omitted.

I was able to to it. Here's the source code "hello world.c": #include int main(void) { puts("Hello, world!"); return 0; } And here's the minimal Makefile to generate the output: hello world: Of course, I did have to swap out the ASCII SP (character 32) for the Unicode non-blank space (code 160) to get this to work, but hey, spaces!

>I did have to swap out the ASCII SP (character 32) for the Unicode non-blank space (code 160) How? EDIT: Ok, now I got it. Boy that was a wild ride.

I did not do the method below. Instead, I wrote a script to generate the filename with the non-breaking space where I needed it.

Edit: rewording and typos.

Re: The Makefile I use with JavaScript projects

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

Real world makefiles are not simple like this. The simplest makefile I can think of is still hundreds of lines long: https://git.musl-libc.org/cgit/musl/tree/Makefile

Maybe this isn't "real-world" but I've made this cookiecutter template which generates projects with Makefiles less than 100 lines. It works decently well for my personal projects and for playing around. https://github.com/MatanSilver/cookiecutter-cproj

Re: The Makefile I use with JavaScript projects

#495

Earlier quoted context omitted.

Pffffft. Nobody wants to touch C these days. That's why many, many, many, many, many more people are writing server, browser, desktop and mobile apps with JS and not C.

https://www.tiobe.com/tiobe-index/

http://githut.info/

Re: The Makefile I use with JavaScript projects

#496
post #493

Earlier quoted context omitted.

>I did have to swap out the ASCII SP (character 32) for the Unicode non-blank space (code 160) How? EDIT: Ok, now I got it. Boy that was a wild ride.

I did not do the method below. Instead, I wrote a script to generate the filename with the non-breaking space where I needed it. Edit: rewording and typos.

Any way I can see the script? Looks like I am still learning and ended up taking a longer route.

Re: The Makefile I use with JavaScript projects

#497
post #478

Earlier quoted context omitted.

Demanding the support of spaces in filenames significantly complicates code as simple space delimination no longer works and other delimination schemes are much more error prone -- forgetting balancing quotes, any one? While you are allowing spaces, you probabaly are allowing all possible code points or maybe even a null byte? Thinking about it gives me headaches. I hate hearing people using 21st century or modern as…

> The merits of filenames with spaces is they read better in a GUI explorer. Even this merit is debatable. Is foo bar two things or one? I know foo-bar is one.

yeah and then is 田中 one or two things? It all depend on the domain. To me 'é' and 'ê' mean different thing that are both outside the make domain. In French you also have half white space (diacritic that latex can handle) for terminal '?!..' Those are simply outside make domain .. so bothering about space encoding as: ' ', '+', "%20" or '_' seem futile.

It all depend of domain convention. Make align on variable naming convention .. that is all

Re: The Makefile I use with JavaScript projects

#498
post #493

Earlier quoted context omitted.

I did not do the method below. Instead, I wrote a script to generate the filename with the non-breaking space where I needed it. Edit: rewording and typos.

Any way I can see the script? Looks like I am still learning and ended up taking a longer route.

It's Lua 5.3:

    h = "hello" .. utf8.char(160) .. "world"
    
    f = io.open("Makefile","w")
    f:write(h,":\n")
    f:close()
    
    f = io.open(h .. ".c","w")
    f:write([[
    #include 
    
    int main(void)
    {
      puts("Hello, world!");
      return 0;
    }
    ]])
    f:close()
Pretty straightforward.

Re: The Makefile I use with JavaScript projects

#499

Earlier quoted context omitted.

https://www.tiobe.com/tiobe-index/

http://githut.info/

There's way more to software engineering than GitHub. Example: every company that hosts their own code repositories.

The TIOBE index, while not entirely accurate either, does reflect usage by a much more broad set of engineers.

Re: The Makefile I use with JavaScript projects

#500

I used make heavily in the 80s and 90s, but haven't much since then. Recently I started a project that had source files getting processed into PDF files, for use by humans. Since this is the 21st century, those files have spaces in their names. At a certain point, I realized that I should be managing this processing somehow, so I thought of using a simple Makefile. A little searching reveals that the consensus on usi…

Demanding the support of spaces in filenames significantly complicates code as simple space delimination no longer works and other delimination schemes are much more error prone -- forgetting balancing quotes, any one? While you are allowing spaces, you probabaly are allowing all possible code points or maybe even a null byte? Thinking about it gives me headaches. I hate hearing people using 21st century or modern as…

I've been working with strings with spaced since before the 21st century. I've also worked with strings with special characters.

I've even worked with variables with spaces and special characters.

I don't see why filenames are so much more special, except a lot of old tools never got updated to world beyond ASCII

Post reply on HN