I’ve created a new C++ build system: g++ *
@rifkin it's no worse than many others I've seen :-)
@rifkin it even support cpp+20 and wAll, I'm impressed
@rifkin now create a new file removal system: rm *

@andrea @rifkin WAIT. What happens if there is a file '--no-preserve-root':

rm * /

🤔

It’s a shame a file can‘t be named '/' 😄

@stair @rifkin it is actually possible to have files with '/' in their name. You need to write a custom file system module though...
@rifkin I needed a second. My brain tried to protect me.
@rifkin what happens when you run it a second time?
@rifkin this is my favorite build system so far
@rifkin well, at least it's better than cmake
@abarker @rifkin As Churchill famously said: “CMake is the worst build system, except for all those other ones.”
@rifkin 🙀

@rifkin maybe you could make it even more flexible by making a build system called * so it’s not bound to C++

ducks and hides

@rifkin
You've inspired me to write a new CI tool to go with it:

# nightly CI
0 0 * * * g++ /src/*
@kandi3kan3 Fantastic! Thank you for your contribution to the g++ * ecosystem!
@rifkin It's a small community, we need to support each other
@rifkin that’s as ingenious as it is horrific. 😂
@rifkin I see what you did there, and what an awesome domain name :-)
@rifkin It's an elegantly minimalist build system that uses the filesystem directly (Unix philosophy, everything is a file, therefore files are everything). Convention (alphabetical order) over configuration. It's perfect.
@rifkin @fay59 Unless the C++ compiler prints "warning: no one can read this fucking mess of a language", it's not really -Wall.

@rifkin I REBUKE YOU in the name of SATAN

lmao this is fucking incredible

@rifkin @mattgodbolt I believe the youngsters call this “blursed”.
@rifkin Can't you simplify it to just * with touch g++?
@barubary Yes, but it would come at the cost of -g
@rifkin Easily fixed! -g is equivalent to -g2, which sorts after g++ (at least under LC_COLLATE=en_US.UTF-8).
@rifkin the paaaaiiiiinnn 🤣

@rifkin @jef

I used to start quickie C programs with:

----------------------------
#ifdef notdef
gcc $0 -o $(basename $0 .c)
exit $?
#endif

int main....

---------------------------

Then I could compile by saying "sh foo.c"

This was especially useful if the compile line was complicated (e.g., the C program required linking with special libraries or something).

(Actually I used back-quotes instead of $(....), but this phone doesn't have back-quote on this keyboard.)

@lain_7 @rifkin @jef Basically same here:

────
#if 0
ctime -begin ${0%.*}.ctm
clang -g -fsanitize=address -std=c99 $0 -o ${0%.*}
ctime -end ${0%.*}.ctm
exit
#endif
────

That's the intro to all my new .c files. (ctime, by the way, times the build.) I got the idea from Won Chun, and like to think of it grandly as "The Won Build System".

@lain_7

"...as of C23, this technique no longer requires an extension...."

@rifkin

I just created a helper for this new build system, I plan on getting angel investors for my startup.

I’ve also created my own license so anyone that views it is now working for me. The wrapper:

#!/bin/bash

g++ *
@rifkin Computers were a mistake

@rifkin this is awful. But funny.

In all seriousness I would like to refer everyone to the brilliant summary of this problem by David A. Wheeler:

https://dwheeler.com/essays/filenames-in-shell.html

Filenames and Pathnames in Shell (bash, dash, ash, ksh, and so on): How to do it Correctly

This article explains how to correctly handle filenames in Bourne shells (the primary shell of Unix/Linux/POSIX systems), based on the issues discussed in 'Fixing Unix/Linux/Filenames'. Many programs fail to work properly on filenames that include spaces, begin with dash (-), include newlines, and so on, because developers don't know how to do it properly. Many texts, even good ones, get this wrong.

@rifkin I'm sure there's some horrible way to group options into multiple files with spaces in their names.

@rifkin #Alt4You

Screenshot of a terminal running three commands. First, ls shows the current directory contains files named "-g", "main.cpp", "-omain", "-std=c++20", and "-Wall". The second command is g++ *, passing every file name in the current directory as an argument to GCC's C++ frontend, which produces no output. Finally, ./main prints "Hello, world!" confirming the previous command did successfully create an executable.

@rifkin Taking that "everything is a file" #Unix principle all the way, I see.
@rifkin The plan 9 of build systems
@rifkin It took me a second to realize what you've done, at which point I went "Nooooo... you didn't!"
@rifkin I'm globsmacked, truly
@rifkin this is vile and you should be proud of it

@rifkin
Make your main.cpp executable, and add this as the first line:

///usr/bin/env -S g++ *cpp -* && exit 0

Then you can build your code just with:

$ ./main.cpp

And it will work even with backup files or executables in the directory.

@jannem Nice, that's a cool trick :)
@rifkin this is the wholly rational intermediate step between passing arguments on the command line and using an argument file.
@rifkin except for the part where you're still limited by ARG_MAX
@rifkin not much more cursed than gnu make
@rifkin Unironically, this is a cool illustration of a specific case of a thing currently realisable which I have been poking away at a more generalised not-currently-realisable form of. I had been thinking of it as ~ first class selections plus set-theoretic style union-mount plus some extensions to file systems. But being able to eg use basic 'file stuff' as an ad hoc build system is cool as hell.
@rifkin And I feel like it only works thanks to how GNU tolerates arguments at whatever positions.
Bhushan Shah 🤷‍♂️🤖👀📱 (@[email protected])

Everytime you make a new buildsystem, kitten dies! Don't do it for sake of kittens!

Fosstodon
@rifkin classy software crimes are always good
@rifkin strong unix haters handbook vibes
@rifkin you should put it on github
@rifkin this is really cursed. And I've done bad things