1. 39

Hi,

I’m developing a very small little browser for the small internet called Fafi1. It used to be just a Gemini browser but today I added support for text protocol2 as well. I want to add Mercury support as well, but I’m having some trouble finding live Mercury servers online.

That got me thinking, what other small internet protocols do you folks enjoy? I’m sure there are very interesting protocols that I’m not aware out there and that would be great to add support for in Fafi.

  1. 18

    While it doesn’t exist to my knowledge, taking something that’s basically just the “good” subset of HTML5 and ECMAScript 12 and writing a browser around it would be cool. Or maybe drop ECMAScript and take a really small subset of it to handle binding to DOM and have WASM for everything else.

    Regardless, finger is old but still interesting.

    1. 8

      While it doesn’t exist to my knowledge, taking something that’s basically just the “good” subset of HTML5 and ECMAScript 12 and writing a browser around it would be cool. Or maybe drop ECMAScript and take a really small subset of it to handle binding to DOM and have WASM for everything else.

      Well, that is beyond my pay grade rsrsrs ;-)

      Regardless, finger is old but still interesting.

      I’m gonna try to implement finger. Thanks!

      1. 1

        Finger is probably the oldest of the “single command, single transaction” protocols, and some are mutually interoperable. Gopher clients can speak finger (to port 79), and many gopher servers would make cogent replies to finger queries if redirected to port 70. I would see URLs like gopher://finger.server:79/user turn up now and then. Naturally Gopher clients don’t have the /w token, but that’s an implementation detail.

      2. 4

        There’s not a whole ton you’d need to add to HTML 2.0; it already specifies use of unicode and CSS. It omits scripting, but IMO that’s a strength, not a weakness.

        1. 1

          There’s things that could be nice like object embedding (don’t redo the ActiveX/applet hellscape, but use it as an extensible means to deal with i.e. multimedia), ARIA, and semantic elements (added in 4 and 5 mostly).

        2. 2

          Or maybe drop ECMAScript and take a really small subset of it to handle binding to DOM and have WASM for everything else.

          I know it’s not as straightforward as it sounds, but I really wish we could move to a future where JS (or some equivalent that was amendable to this arrangement) was implemented with WASM. Maybe it’s a blessed implementation that exists in the browser, but it compiles down to a public API that other languages could target.

          1. 3

            I’d love to do the same with the DOM. There’s now a decent JavaScript PDF implementation, which significantly reduces the need for browsers to have native implementations and ended up with something more secure (JavaScript is already sandboxed). With canvas, it’s probably possible to move all of the HTML rendering into JavaScript as well.

            1. 3

              With canvas, it’s probably possible to move all of the HTML rendering into JavaScript as well.

              You have to watch out for a11y, but Google Docs basically does this; there’s a bunch of divs with aria roles and display: none for the benefit of screen readers, and the actual rendering is done with canvas.

              1. 1

                This is a non-starter for things unlike PDF, because you can’t do layout in canvas, because it won’t let you measure text.

                1. 3

                  I guess that depends on how much you want to move into the sandbox. If you want to depend on a native implementation of the font renderer and layout engine, that’s true. If you want to use a WAsm version of Harfbuzz / FreeType, then you’re only going to be throwing lists of beziers at the canvas.

                    1. 2
                      • It uses a global state like all canvas APIs
                      • Almost every field in the results object is optional, and they’re mostly not implemented, at least last time I checked.
                      • It’s very basic and still requires you to do a whole bunch of work yourself if you want any information that’s useful for layout, and shitloads more work if you want the kind of information that’s required for editable text.

                      Compare it to a well-designed text API from a company that built its empire on rendering text: https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/engine/package-detail.html

              2. 1

                I wish something like Jessie or these other EcmaScript subsets would get actually standardized as I see a lot of potential in a simple ES subset as an embeddable language.

              3. 8

                My off-the-cuff reaction to this question was, “The old, deprecated versions of today’s complicated large protocols, before ‘withstanding constant assault by malicious peers’ became a required design goal.”

                HTTP/1.0 could be fully implemented as a side project. SMTP was pleasant in the early days before spam was a thing. “Implement an rlogin client” was a good intermediate-level exercise for aspiring UNIX developers.

                1. 6

                  Everyone thinks telnet is just text across the wire, but there are a few subtleties that might make an implementation more fun.

                  talk(1) could be fun.

                  Everyone loves gopher.

                  NNTP might be fun.

                  Maybe WAIS?

                  1. 8

                    talk(1) could be fun.

                    You just inspired me to re-read that man page

                    Bugs

                    The protocol used to communicate with the talk daemon is braindead.

                    Also, the version of talk(1) released with 4.2BSD uses a different and even more braindead protocol that is completely incompatible. Some vendor Unixes (particularly those from Sun) have been found to use this old protocol.

                    1. 6

                      NNTP might be fun.

                      For interested folk, checkout my one file no-dependency nntp server library for python3 https://github.com/epilys/nntpserver.py

                      1. 4

                        NNTP is both very simple and very complicated. The protocol, as defined by the standard, is trivial. Most clients also provide things like MIME support, even though NNTP doesn’t define anything other than plain text. Some use MIME for embedded HTML, some will render Markdown-like syntax as rich text. For binaries, there are naming conventions designed to get around the per-message size limits on most servers, some clients will combine these in the UI, others expose you to hundreds of messages with almost the same heading. I think most binaries are transferred yyEncoded these days, but some still use base64. NNTP client authentication can be a bit exciting.

                        1. 4

                          As someone who implemented an NNTP server, I can tell you NNTP’s simplicity is misleading; it’s highly stateful (in the mail protocol tradition) and fragile. I think the funniest part was finding out Outlook Express was amongst the most robust NNTP clients, and the stuff the grognards liked was not.

                          1. 1

                            I wrote an NNTP client for OS X back when I was a student. Getting the core protocol working was a few days of work. Getting enough working to be actually useful when connected to anything other than the NNTP server that I ran for a small group of friends was more work than I could be bothered with.

                            1. 1

                              I’ve recently started Gnus again, and it’s shocking how the keystrokes I used every day for years have been swapped out from my memory.

                              But that’s neither here nor there, Gnus is a impressive achievement, built for a protocol that’s now almost unused[1]

                              [1] well apart from binary distribution but Gnus was never the best tool for that.

                        2. 2

                          Both that and tade look seriously awesome.

                        3. 5

                          Most existing Gemini clients seem to support Gopher too.

                          1. 5

                            Everyone thinks telnet is just text across the wire, but there are a few subtleties that might make an implementation more fun.

                            tn3270 and tn5250 say hi.

                            1. 2

                              Ah, WAIS. That deserves a new look. I used WAIS as a backend for the initial implementation of Veronica-2, though performance wasn’t stellar (could have been my fault).

                              1. 2

                                If you’re implementing Telnet, RFC1143 - The Q Method of Implementing TELNET Option Negotiation is worth a read. It discusses how to avoid option negotiation loops.

                              2. 6

                                that text:// thing is awful

                                1. 4

                                  yeah what the hell

                                  1. 7

                                    It took me longer to understand that spec page than to actually implement the thing…

                                    1. 2

                                      I like how the “about” page is a blank about.me page

                                2. 5

                                  phone calls over the internet taste good and go down smooth. just take a SIP.

                                  1. 6

                                    I wouldn’t consider SIP a small protocol, especially if you include the extensions.

                                    1. 5

                                      As someone who works in SIP daily and pays my bills, I agree wholeheartedly. It is far from being small.

                                      1. 4

                                        As someone who will never work with SIP voluntarily again, I completely agree.

                                    2. 3

                                      This works as a dad joke too. Cheers

                                    3. 5

                                      TFTP hasn’t been mentioned yet and deserves it.

                                      1. 4

                                        IRC, dict pop3 and whois. Whois is terrible, we really need a structured alternative. But there it is.

                                        1. 3

                                          RDAP is the proposed replacement for WHOIS.

                                          1. 2

                                            Yes, which not all TLDs support

                                        2. 3

                                          You could consider supporting Gemini companions:

                                          1. 1

                                            I implemented a kind of subscription before that spec was written. I don’t know if it is worth it to change my current spec to this one. The way I do it is just calculating a checksum for a capsule and if it changes, then the page is considered updated.

                                            As for Titan, I need to understand it better. I suspect it might be kinda hard to implement in my case because some of the needed TLS features are not exposed in the Racket bindings for OpenSSL. That is why I’m yet to support identities and custom cert stuff. I might be mistaken and things might be available now, I need to check.

                                          2. 3

                                            Obviously, Gopher. There are other protocols of the era too; i.e. WAIS, dict, etc.

                                            1. 3

                                              The Finger protocol.

                                              1. 1

                                                RFC 913 - Simple File Transfer Protocol.

                                                This isn’t because it’s particularly useful these days, but it’s simple enough that it’s good for introducing somebody to how to write a practical and useful server daemon and client with a real protocol.

                                                1. 1

                                                  How about ph/qi (also known as CSO, just to be confusing)?

                                                  1. 1

                                                    Here are some small protocols that are easy to implement; one of my weekend hacks is porting old networking code to macOS.

                                                    1. 1