HTML Custom Elements to help in SRFI writing?
Artyom Bologov 11 Aug 2026 03:00 UTC
Hi y’all,
There’s this feature of Web Platform called Custom Elements
<https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements>.
These allow to define new HTML tags with custom behaviors and syntax. I
believe that SRFI writers might benefit from some helper tags when
writing SRFIs. Say, tags to reference other SRFIs or R7RS:
<r7rs-ref>map</r7rs-ref>
;; instead of <a href="https://standards.scheme.org/r7rs-html5/index.html#map">map</a>
<srfi-ref num="253">SRFI-253</srfi-ref>
;; instead of <a href="https://srfi.schemers.org/srfi-253/srfi-253.html">SRFI 253</a>
These will make it extremely easy to reference things and (I believe)
will encourage creating actually well-hyperlinked SRFIs.
Adding these elements is safe, because
• They were supported in all major browsers since 2016/2018, which is
long enough for basically everyone to support. See
<https://caniuse.com/wf-autonomous-custom-elements>
• Even when these are unsupported, they will be interpreted as their
contained text. Which, if they are designed right, it entirely safe.
I’m, of course, ready to implement these when necessary.
What do y’all think? Is that a premature optimization?
Best of luck,
--
Artyom Bologov
https://aartaka.me