Created: 2021-08-15 Sun 09:24
This talk is in two parts: First I’ll go over the D programming language and some neat parts of it. Then in the second half I’ll go over a command line tool I wrote in D and what’s interesting about that and nice.
A C
compatible and optionally garbage-collected systems programming language.
First released in 2001 and continually updated since then.
Basically C++ but better.
C
and C++
interop… and more!
And all the sane normal things that C doesn’t have.
char
and dchar
)Overall not that many funky parts compared to say C++
About as dead as it can get without being totally dead.
It’s a real shame, but the language never really took off. However in recent years with renewed interest in systems programming there has been some movement.
… then give D a try!
trash-d
trash-d
is a standalone CLI tool that’s almost completely compatible with
rm
but instead of permanently deleting a file it moves it to the trash bin.
This is something I’ve wanted for a long time but never got around to making or finding.
One day last week or so @tecosaur was talking about how he accidentally rm
-rf
’d his music folder, and I made a comment saying that making a version that
uses the trash bin should be pretty easy.
It was not.
rm
?
The entire point of this project was to create a tool that you could alias
rm=trash
and not even notice the difference, while still gaining all of the
benefits of using the trash bin.
This was ultimately quite tricky. rm
doesn’t have many flags, but their
interaction and exact results required a lot of figuring out.
On top of that I even made the error messages compatible. On the off chance someone’s parsing those…
If you check the git history the missing numbers actually exist in code. But they were superseded so fast I never got around to making a release page.
Also I bump the number every time I change something of note, and it’s purely sequential. The first real commit was version 1.
As @Sifus pointed out in #programming
there already exists a tool called
rmtrash
. But that’s just a Bash script wrapping around trash-cli
.
trash-cli
is a big blob of Python code with really weird UX that isn’t rm
compatible at all (hence rmtrash
).
trash-d
on the other hand is a single no-dependency binary that does
everything all on it’s own.
The CLI tool is mostly done. It probably still has some bugs to be squashed and cleanup to be done, but features-wise it’s more or less where I want it.
So some future goals include getting it packaged for various distros, and generally making people aware of its existence.
You have just experience phase 1 of that plan
Questions? Comments? Complaints?