Weeknotes 2025-W15 › Forester 5.0 development: canonical URLs, atom feeds, and LSP [01A0]
- April 9, 2025
- April 11, 2025
- Jon Sterling
Weeknotes 2025-W15 › Forester 5.0 development: canonical URLs, atom feeds, and LSP [01A0]
- April 9, 2025
- April 11, 2025
- Jon Sterling
Work on Forester 5.0 proceeds apace, generously supported by ARIA who have engaged Kento Okura and myself on a consulting basis to support their internal use of Forester. My recent goals have been to bring Forester closer in line with the architecture of the World Wide Web; to that end, I have made two big improvements.
1. First cut at canonical URLs [01AA]
- April 9, 2025
- April 11, 2025
- Jon Sterling
1. First cut at canonical URLs [01AA]
- April 9, 2025
- April 11, 2025
- Jon Sterling
Trees are addressed by “canonical URLs” that are meant to be the place where they will ultimately be published. See my blog post on the design for more details. Canonical URLs are of the form https://www.my-host.net/tree-name/; the handling is a little fragile right now and you can expect bugs (but please write to me about them).
2. First cut at atom syndication [01AB]
- April 9, 2025
- April 11, 2025
- Jon Sterling
2. First cut at atom syndication [01AB]
- April 9, 2025
- April 11, 2025
- Jon Sterling
It is now possible to syndicate the children of a tree as an Atom feed. This is done currently by including the following directive in the tree you wish to syndicate:
\syndicate-current-tree-as-atom-feed
Then, if your tree is located at https://www.my-host.net/tree-name/, you will find that there is an atom feed at https://www.my-host.net/tree-name/atom.xml. There are many subtleties to this, and the atom support will continue to evolve and improve. One thing I need to deal with is the fact that Forester produces nested hyperlinks—which are not valid in HTML! I came up with a pretty slick way to handle this in XSLT, but that Atom renderer is intended to bypass that entirely.
As a side note, I am very happy to see that I am not the only person using the new support for Atom feeds. Patrick’s fork of Forester is looking pretty cool, and I am excited to learn more from what he is doing. I’m also relieved that he was able to get rebased atop the ever-changing forester-5.0-dev branch.
3. Federation is still janky [01AC]
- April 9, 2025
- April 11, 2025
- Jon Sterling
3. Federation is still janky [01AC]
- April 9, 2025
- April 11, 2025
- Jon Sterling
One thing I want to start designing soon is how best to handle federated forests. Right now, Forester bundles all the imported material under a foreign/my-friends-host/ directory and routes all links accordingly, but in many (but not all!) cases one would want to not bundle things at all and instead have links routed directly to the canonical URLs as published on the World Wide Web. I am not sure of the best design for this, so I welcome feedback. In the meanwhile, enjoy the janky prototype feel.
4. Language server; code completion via effects and handlers [01A9]
- April 9, 2025
- April 11, 2025
- Jon Sterling
4. Language server; code completion via effects and handlers [01A9]
- April 9, 2025
- April 11, 2025
- Jon Sterling
Kento is hard at work hardening Forester’s language server. I am hoping that we will have something to show on the scale of a week.
There were some subtleties about how to provide completion information at a source location—which is at least as complex as the expander itself, since scope emerges from the expansion process. We had something fairly broken in place, which I have spent Thursday and Friday morning replacing with something cool using OCaml 5’s effects and handlers. The idea is to instrument the expander with an effect that notifies observes that it has entered a source range; this can be handled as a no-op, or by querying the scope’s available symbols when it enters the desired range and throwing away the continuation, and resuming the continuation otherwise to keep searching. This approach allows all the scope-handling code to be unified into a single routine, whose behaviour is controlled by effect handlers on the outside.
As a side note, I am looking forward to when the next version of Topiary is released, which should contain support for formatting OCaml’s effect handlers. Right now we don’t use the nice notation because we are stuck on Topiary 0.6.0.