3 ms·
I've read the code and I know that it reimplements a substantial portion of Make. The point is however, this project doesn't work with a single Makefile either.
by lifthrasiir 4y ago
I've read the code and I know that it reimplements a substantial portion of Make. The point is however, this project doesn't work with a single Makefile either. Traditional projects would typically use configure plus (generated) Makefile, where configure is a shell script typically built from autoconf which is an abomination. In order to avoid autoconf some projects replace configure with other languages like JS. This project went further by merging that JS configure with Makefile. All of this hassle would be pointless unless you consider one important platform: Windows, where you don't natively have Make anyway.
You may still argue that this project still requires GCC and thus there should be Make even in Windows. That's reasonable, but right now I have GCC and Clang but no Make in my Windows console. If you can remove a hard dependency on Make with a reasonable cost (and I don't claim it's the case with this project, I would have used Ninja instead [1]) it's pretty worthwhile in my opinion.
[1] See https://github.com/lifthrasiir/j40/blob/main/make.cmd https://github.com/lifthrasiir/j40/blob/main/make.cmd and https://github.com/lifthrasiir/j40/tree/main/extra/build https://github.com/lifthrasiir/j40/tree/main/extra/build for example; with this setting `make` works both in the standard *nix and Windows.
- badsectoracula 4y ago> All of this hassle would be pointless unless you consider one important platform: Windows, where you don't natively have Make anyway. [...] You may still argue that this project still requires GCC and thus there should be Make even in Windows. I think that is a very good argument though: Windows doesn't have MSVC or any other compiler out of the box either, it is up to you to install the requirements so having Make as a requirement - especially considering how standard it is - is perfectly fine. Using something like MSYS2 gives you a Linux-like shell with all the tools you'd expect there. There is no real reason to require Node aside from the author wanted to play around with it, the functionality that tool provides can be provided by other existing tools (Autotools, premake, CMake, meson/muon, etc) or even GNU Make itself (using its extensions that wont be compatible with other "makes" though). (also while Autotools can feel a bit arcane, they have one feature that other similar tools do not have: you do not need to have Autotools installed to build the project, only some shell and some make, both being very standard in pretty much any unix-like OS and for Windows, well, see the first paragraph :-P)
- lifthrasiir 4y agoYour notion of "standard" build environment with Make and POSIXish shell doesn't apply to MSVC. Well you do have nmake, but it is substantially different from Make anyway.
- badsectoracula 4y agoThis is why i mentioned "for Windows, well, see the first paragraph" where i write "Using something like MSYS2 gives you a Linux-like shell with all the tools you'd expect there".
- rurban 4y ago> where configure is a shell script typically built from autoconf which is an abomination sorry, what is the abomination here?
- foldr 4y agoBuilding (hopefully) portable shell scripts out of M4 macros is pretty hairy.
- badsectoracula 4y agoPortable to what though? Chances are the shell script code generated by Autotools is runnable in more places than Node.js.