5 ms·
In case you're passing over this because it sounds like click bait (it KIND OF is), this was actually a good read to me. It goes over a utility called "suc" (S
by spicybright 3y ago
In case you're passing over this because it sounds like click bait (it KIND OF is), this was actually a good read to me.
It goes over a utility called "suc" (Simple Unix Chat) that implements server functionalities from Slack, Discord, etc. using a very small codebase.
The novel part is it leverages existing unix tools and methodology instead of re-inventing them.
- Auth is handled by SSH.
- Channels are just a file and admin/mod controls are handled by user groups and file permissions.
- Support for rich text, file uploads, etc. aren't a concern as you just write whatever data you want to the channels and let the client interpret it.
- Bots are very easy as you just pipe to/from the channel files.
You're not going to be making a perfect slack clone with the 5 lines that write messages to the channels from the article, but I'm pretty impressed how far you can with really simple unix tools.
- cornel_io 3y agoSlack to most end users is the client, though. As well as the admin, user management UI, scalability, webhooks, etc, absolutely none of which is handled by "you can chat with other users in Linux if you all log into the box" which every *nix has had since before most readers here were born.
- linschn 3y agoIndeed ! The question is whether all that is worth so many engineer-hours. I'm not advocating for all Slack channels to be replaced by suc, that would be silly. I'm just pointing out how costly it all is. There's got to be a middle ground that does not require hundreds of thousands of lines of code.
- dclowd9901 3y agoBig emphasis on “kind of”. “Here’s how to make $2 million dollars over night” _reads article_: “have $4 million in the bank…”
- cassepipe 3y agoI laughed reading your comparison but I don't agree. I clicked waiting for a shallow trick and found that there was indeed a trick, but not a shallow one at all This ability to bring complex capabilities to a chat system by leveraging so much of its ecosystem is truly amazing. Definitely worth the hn front page. And you only need basic shell literacy in order to use it, little more to understand it
- BenLloydPearson 3y agoI came for the clickbait title, I stayed for the unique, yet simple, approach the author took and how they explained the examples.
- lynx23 3y agoWait, KISS is a novelty? :-)
- TeMPOraL 3y agoNovelty? More like the ways of our great grandparents.
- nonethewiser 3y ago> The novel part is it leverages existing unix tools and methodology instead of re-inventing them. That pretty much always explains the “X in unfathomably few lines of code.” No faulting the other, he was very upfront about this.
- dexen 3y ago"Append-only files" would be a great fit here: to ensure regular users and bots don't modify others' posts. Sadly this Plan 9 functionality is not ported to Linux yet. That's a permission bit, similar to "read" or "write", but even more specific.
- ComodoHacker 3y agoNot so great if you're talking about real use cases where moderation is mandatory.
- HerrMonnezza 3y agoIIRC, Linux' ext2/3/4 support an 'a' attribute that make a file append-only.
- throw10920 3y ago> re-inventing them Existing chat platforms don't "re-invent" Unix tools - they're simply not suitable for building on top of. There's a reason that approximately 0 large production systems are written in shell script using the "everything is a file" paradigm - because it's not acceptable for any non-trivial system that needs to see real-world use.