On Wed, Oct 22, 2025 at 04:23:05PM +0200, Miek Gieben wrote:
> > The Haskell type system is notieably richer than that of Rust, the main
> > area where Rust is ahead is "linear" types, which in Haskell are new,
> > still evolving, and mostly marginal at present.
> >
> > "Sum" types are not a good model for types that are extensible, because
> > the intoduction of new constructors is an API change: previosly
> > "complete" matches, become incomplete when a new variant is added.
>
> For RRs we fixed this by allowing unknown RRs, which have a presentation
> format and a
> wireformat, so all is good. But we never did that for unknown rdata fields.
>
> Think this could work for AMTRELAY, I think... for SVCB it might be
> harder still because of the key=value presentation format.
The SVCB specification defines a generic presentation for unknown
key[/value] pairs. So it is possible to present known fields in
more human readable form, while using the generic form for the rest.
For an extreme example, when I map all the key value pairs in the
Cloudflare HTTPS RRset to their "opaque" representation, the
presentation form changes from:
alpn="h3,h2" ipv4hint=104.16.123.96,104.16.124.96
ipv6hint=2606:4700::6810:7b60,2606:4700::6810:7c60
to:
key1="\002h3\002h2" key4="h\016{`h\016|`"
key6="&\006G\000\000\000\000\000\000\000\000\000h\016{`&\006G\000\000\000\000\000\000\000\000\000h\016|`"
As for other RRtypes, with AMTRELAY when the type field is 4–127,
I believe I am forced to render the entire RR in generic form.
So a precedence 42, optional discovery type 4 AMTRELAY record with
payload octets "foo" presents as: \# 5 2a84666f6f
So I do have simple code to decode ATMRELAY subtypes 4–127 to an opaque
form, and present these using the generic DNS RDATA form, what I
declined to do was to add machinery to support extensible subtyping with
pluggable representations for these codepoints along with a type class
to represent the variants, ... not because it is more difficult than mildy
annoying, but because that would be a disservice to the potential user,
because YAGNI.
--
Viktor. 🇺🇦 Слава Україні!
_______________________________________________
DNSOP mailing list -- [email protected]
To unsubscribe send an email to [email protected]