Hacker News new | ask | show | jobs
by esotericn 2474 days ago
I have full faith that, if I had left a computer running, in the corner of my home, with an IRC client open, it would have been able to maintain a connection to Freenode (not continuously, but just work) for fifteen or more years.

Personally I don't think IRC will ever be replaced. Well, it will, but it'll happen when my generation dies and gets fully replaced with the New Shiny.

I _hope_ that some sort of real, proper standard, that doesn't endlessly reinvent itself, that isn't subject to some for-profit bollocks, that on a very basic level, has like, a standard, has _clients_ (not just one wanky proprietary web frontend) that just sits and gets the job done like TCP, comes out of all of this.

Meanwhile, I'm fairly sure IRC will still be there in another fifteen.

Hell, at this point, IRC has been a constant in my life for longer than everything other than family. It actually feels like a friend. A portal to another quirky world, just as it did all those years ago.

I think it's almost two decades now since I first logged in. My my. The years are short, indeed.

8 comments

I feel like Matrix is basically the "real standard" here that supports a lot more than IRC. The question for me is about how easy it is to build a client for that (IRC is stupid easy, of course).

Ideally you should be able to build a Matrix client in something like a Python REPL and like 20 lines of code with an `input` loop at the end. I don't know if that's the case at the moment.

Ooooh... sounds like a fun challenge :D I've typed this out straight into the HN input box so it almost certainly doesn't work and will be full of typos and escaping bugs, but for illustrative purposes: here's what a ~8 line Matrix client for basic bi-directional chat in a given room could look like (complete with login) in almost-bash, with deps only on curl and jq:

    USERNAME='@whoever:matrix.org'; SERVER='https://matrix.org'; ROOM='#test:matrix.org'
    read -s -p "Password for $USERNAME:" PASSWORD
    TOKEN=`curl -X POST $SERVER/_matrix/client/r0/login --data "{ 'type': 'm.login.password', 'login': '$USERNAME', 'password': '$PASSWORD' }" | jq .access_token`
    ROOM_ID=`curl $SERVER/_matrix/client/r0/directory/room/$ROOM | jq .room_id`; curl "$SERVER/_matrix/client/r0/join/$ROOM_ID?access_token=$TOKEN"
    (while true; do SYNC=`curl -s $SERVER/_matrix/client/r0/sync?access_token=$TOKEN&timeout=30000&since=$SINCE`
     echo $SYNC | jq ".rooms.join.$ROOM_ID.timeline"
     SINCE=`echo $SYNC | jq .next_batch`; done) &
    while true; do read -p "<$USERNAME> " INPUT; `curl -s -X POST $SERVER/_matrix/client/r0/rooms/$ROOM_ID/m.room.message?access_token=$TOKEN --data "{ 'body': '$INPUT', 'msgtype': 'm.text'}"`; done
Spread out a bit more with comments:

    # set your matrix ID & server URL, and the room you want to chat in:
    USERNAME='@whoever:matrix.org'
    SERVER='https://matrix.org'
    ROOM='#test:matrix.org'

    # prompt for a password; log in and grab an access_token
    read -s -p "Password for $USERNAME:" PASSWORD
    TOKEN=`curl -X POST $SERVER/_matrix/client/r0/login --data "{ 'type': 'm.login.password', 'login': '$USERNAME', 'password': '$PASSWORD' }" | jq .access_token`

    # resolve the room alias (#test:matrix.org) to a room ID (!vfFxDRtZSSdspfTSEr:matrix.org)
    ROOM_ID=`curl $SERVER/_matrix/client/r0/directory/room/$ROOM | jq .room_id`

    # check that you're joined to the room (redundant if you know you're already there)
    curl "$SERVER/_matrix/client/r0/join/$ROOM_ID?access_token=$TOKEN"

    # set a background loop running to receive messages, and use jq to filter out the
    # messages for the room you care about from the sync response.  For now we print them
    # as JSON pretty-printed by jq, but that's not too bad.
    (while true;
        do SYNC=`curl -s $SERVER/_matrix/client/r0/sync?access_token=$TOKEN&timeout=30000&since=$SINCE`
        echo $SYNC | jq ".rooms.join.$ROOM_ID.timeline"
        SINCE=`echo $SYNC | jq .next_batch`
    done) &

    # set a foreground loop running to prompt for your own messages and send them
    # into the room as plaintext.
    while true;
        do read -p "<$USERNAME> " INPUT;
        `curl -s -X POST $SERVER/_matrix/client/r0/rooms/$ROOM_ID/m.room.message?access_token=$TOKEN --data "{ 'body': '$INPUT', 'msgtype': 'm.text'}"`
    done
If I have time I'll actually try running & debugging this to be usable and edit the post (but got to run into a meeting now :( ).

Needless to say, this'd be much prettier on Python - and you'd prolly want to use a nice SDK like https://github.com/poljar/matrix-nio (see https://matrix.org/blog/2019/07/03/usage-of-matrix-nio/) so you get things like E2E Encryption for free. But doing it in plain bash hopefully gives more of an idea.

Wow, definitely wasn’t expecting this! Very cool

I think it’s important to not be “using a library” since the test case is hopefully that the protocol is easy enough to get something barebones with even super baseline tools. Your bash script obviously matches this requirement

My reference here is the excellent Haskell Wiki “Build tour own IRC bot”. Really captures the simplicity of the protocol

https://wiki.haskell.org/Roll_your_own_IRC_bot

Too late to edit the original post, but thanks to anoa for fixing up my crappy bash there's a version that actually works now at https://github.com/ara4n/random/blob/master/bashtrix.sh. The uglinesses are mainly bash's fault rather than matrix's ;P
comedy punchline; turns out that people are actually using this monstrosity in the wild:

> I used bashtrix for about 4 hours this morning. Why, you ask? I didn't have the bandwidth, latency or reliability to use Riot. I ended up using bashtrix on one of my servers through mosh...

> Could have done with scroll back (the screen fills up with 'null' and '[]' – the latter, I started to recognise as marking read receipts and/or perhaps presence) but shrank the font size down and made the most of it :p. Worked Rather well considering

Nice! I tried this though and it asks me for a password (unsure if for creating an account or logging in to existing one, code suggests for login) and I tried both blank and random one, but get `Unrecognized request` as a response for the first request.

This seems to indicate it's missing a register step, and then it fails to be as simple as IRC where you just set nickname and connect to a server. Sometimes the server asks you to identify yourself, but that's up to the server, not the protocol.

yeah, sorry, i put a login stage in there but not a registration step (which is a bit more fiddly as registration typically requires solving a captcha to prevent spam). so you'd need to register via riot.im or some other client first.

That said, Matrix also supports guest accounts (which are quite locked down to prevent abuse, but would work for this example) - so the /login request could be replaced by calling /register with type=guest which would then do what you want.

edit: it would look something like this (7 lines now!):

    SERVER='https://matrix.org'; ROOM='#test:matrix.org'
    TOKEN=`curl -X POST $SERVER/_matrix/client/r0/register --data "{ 'kind': 'guest' }" | jq .access_token`
    ROOM_ID=`curl $SERVER/_matrix/client/r0/directory/room/$ROOM | jq .room_id`; curl "$SERVER/_matrix/client/r0/join/$ROOM_ID?access_token=$TOKEN"
    (while true; do SYNC=`curl -s $SERVER/_matrix/client/r0/sync?access_token=$TOKEN&timeout=30000&since=$SINCE`
     echo $SYNC | jq ".rooms.join.$ROOM_ID.timeline"
     SINCE=`echo $SYNC | jq .next_batch`; done) &
    while true; do read -p "> " INPUT; `curl -s -X POST $SERVER/_matrix/client/r0/rooms/$ROOM_ID/m.room.message?access_token=$TOKEN --data "{ 'body': '$INPUT', 'msgtype': 'm.text'}"`; done
Nice work! I've actually been working on writing something like this for a while now.

Do take a look at https://gitlab.com/darnir/matrix-shell-suite

It's a basic matrix client written in pure POSIX sh.

I am hoping they go with Matrix, least then I will be able to have the choice of having a client appropriate to my needs.

I do prefer my chat client to not be a part of my browser. That way I can close my browser, start my browser and chat client on login ie from i3/sway etc. A tab in a browser runs the risk of getting closed.

I love using weechat (weechat.org) and have used it for decades. The Matrix plugin for Weechat is really well done https://github.com/poljar/weechat-matrix

Other people who want to use Riot can if they want at the end of the day I think matrix is probably the best option as it will cater for many people's needs.

> client to not be a part of my browser.

But that should also be an option too. Matrix could be great to integrate with for both private and public web communities , and that would incentivize people to create more homeservers. There is currently a lack of such solutions for communities and matrix could fill that gap. It's just sad that we have to end up sending people to sign up to discord .

You really don't want Matrix. One year of Matrix to IRC bridge cost me about 30GB in Postgresql database to hold the state/logs of everything.

It was less than 500MB of plaintext irssi logs.

Did you figure out what's with the 60x bloat? Badly denormalized and storing tons of metadata? Storing images/video?
badly denormalised; every state change stored a snapshot of all the state in the room. so everytime someone joined a room it snapshotted the state of everyone else in the room. it has now been improved massively, and there is scope for further fixes. sorry that the GP got bit by it.
This too keeps improving
weechat-matrix even supports single sign on login (as of yesterday: https://github.com/poljar/weechat-matrix/commit/1a846d61ae07...) so it should work nicely with Mozilla's IAM SSO: https://wiki.mozilla.org/IAM/Frequently_asked_questions
Die? No, but it is slowly degrading. More and more the people in my old freenode chatrooms are idle or simply leaving. We've gotten so used to phone notifications and a persistent history, that IRC has fallen behind purely from a convenience factor.

It's rock solid in what it does, I have zero doubt about that or your 15 year claim. But even if the protocol works, if the user base isn't being added to it will die eventually.

You can have both notifications and a persistent history with the majority of IRC clients. Many public channels keep logs, even. If someone pings me (hilight), then I get an urgency hint. Most window managers handle urgency hints. I use openbox + xterm + irssi. I do get notified if someone pings me, and I can also add any arbitrary words for which I would get notified. With a small Perl script I could use notify-send if I wanted (it probably already exists).

If you are really referring to phone notifications, well, you can use an IRC client on your phone, then you would get notifications on your phone. I use irssi even on my Android phone.

Let us not forget that there is the other side of the story: many people report that they have been enjoying life more without those phone notifications.

I love IRC. I have been using IRC ever since I was 11. It made me a more technical person. I find that IRC is not that easily accessible to the majority, which is a good thing, because of this, the conversations tend to be of higher quality, and technical in most channels. I would also like to add that IRC is the reason I understand English, and a zillion other things. :)

Persistent history including things that happened when you weren't connected. Obviously logging is easy, this isn't about client logs.

With phone notifications, you not only need to work for things that happened while not connected, it's bad form to require a permanent connection on android and you can't do it at all on an iphone.

We have https://thelounge.chat/ running.

I don't miss anything.

Yeah, there is https://www.irccloud.com/ as well, and probably many other alternatives.
Perhaps what you need is a bouncer?
It's doable but it's tricky, requires a very stable place to put the bouncer, and it makes things vastly more complicated than being pointed to the closest client or web interface and logging in instantly.
> We've gotten so used to phone notifications and a persistent history, that IRC has fallen behind purely from a convenience factor.

I have that with a bouncer (znc) and a plugin. I've not used it, but it is my understanding that IRCCloud does this too. Problem is that there aren't many easily usable options for this apart from IRCCloud and even IRCCloud itself isn't all that well marketed.

Always seemed kind of weird how while IRC is full with FOSS people who are willing to use their time on various projects they're not getting paid for, most of whom also seem to worry about IRC dying out, nobody is really doing anything about it. A lot of the conveniences we miss could mostly be solved by making modern clients that are actually good.

I think free (spyvertising supported) and free or steeply discounted (operating at a VC-backed loss) commercial offerings both being so common dampens enthusiasm to work on and demand for open source software, especially the user-facing stuff. Earlier on in computing history (into the mid '00s, at least) such things were much less common.

I think it also dampens the same for traditional paid software in a lot of areas, incidentally.

Quassel is being actively worked on and solves a lot of the woes for me.
I've been using it for... around nine years. It used to have a lot of performance issues, notably around synchronising initial state/backlog fetch on first connection to the core/daemon, but those were eventually fixed.

It works very well now, and the Android client is pretty great too, but there are still some gaps. Mainly, the surrounding ecosystem is quite sparse, e.g.: - There is basically only a single web client for it (node-based, which is a con from my perspective) - There are only a handful of semi-functional log searching/browsing utilities around

IRCv3 is still moving forward and gaining momentum.
Started in 2016 and still has no major IRC networks support it.
> if the user base isn't being added to it will die eventually.

Which is, sadly, a lost cause. We had a simple, reliable, open, decentralized base that simply did not adopt to the needs of a changing userbase of the internet enough. Non-technical users have expectations that are incompatible with the text only format and they prefer platforms that feel more like their other social media tools. Technical users don't fix that and get riled up about nonsense instead, like non-TLS connections and other points that were addressed a decade ago, alongside people that just prefer a more decentralized system.

It feels like xkcd #927 is also relevant [0]. The open source world in chat/social platforms often looks like Googlers looking for a promotion instead of addressing real needs and most efforts seem to be drowning in irrelevance. Even technically sensible projects like Matrix, who's going to use that? Not the instagram crowd that's for sure, heck, many technically inclined people cannot be bothered with IRC when the alternative is convenient. I'd be really surprised if we see a widely adopted open messenger in 10 years, it's more likely that people just settle on a new random walled garden every 3-5 years.

[0] https://xkcd.com/927/

> We've gotten so used to phone notifications and a persistent history, that IRC has fallen behind purely from a convenience factor.

I noticed myself using IRC less for this reason. I'd always run weechat on servers so I had the history but never thought to look for notifications these days.

I signed up for IRCCloud and it's been nothing but excellent so far. I can even connect weechat to it like a BNC.

I started reading up Ruma sources with the intent to start contributing when I'm done with my current work (and when async lands in stable). Hopefully it (and maybe Dendrite) will be able to provide your 15 years of uptime on the client side in the future.
Oh, yeah. A little longer than that, here

My freenode nick was registered in 2005, and I know that's the "new" registration since I accidentally confused the nickserv RELEASE and DROP commands once, and had to re-register the nick I had just mistakenly unregistered. It had a few years of history prior to 2005, but I don't know the details anymore.

And prior to Freenode, I was on a few other networks going back to '94 or so. But moving networks meant it wasn't a "constant" in terms of being the same environment, just the same interface.

We're not the only ones who feel that IRC will be around until we're gone... https://xkcd.com/1782/

IRC is a pretty awful standard though. It works, through immense hacking effort but as (utterly under-) specified, it's a nightmare.
IRCv3 tries to fix a lot of those concerns and provides a lot of features long due. If you have any specific concerns not yet addressed by IRCv3 I'd start talking about it in the issue tracker.
IRC is probably peak in its niche. Simple design, cheap to run, cruftless. Anything else added really lowers its value.
I've been on Freenode since my tweens. Maybe the long term thing is overlay protocols, to solve the issues with directly connecting to IRC on mobile, and with shelling into a client on the same.