Re:Better HTTP server routing in Go 1.22
by tptacek on Monday October 16, 2023 @02:52PM
(#37904370)
Can you provide an example of a Rust HTTP routing library that can generate a compile-time error for overlapping routes?
[ Parent
| on HN ]
Re:Better HTTP server routing in Go 1.22
by tialaramex on Monday October 16, 2023 @03:29PM
(#37905033)
I don't know of one, but you seemed to doubt not that it's actively being done, but that it's even possible, which is a very different proposition.
Remember C++ actually implements checks at compile time for the modern std::format function. That is, if you mess up the text of a format string so that it's invalid, C++ gives you a compile time error saying nope, that's not a valid format.
You might think that's just compiler magic, as it is for say printf-style formats in C, but nope, works for custom formats too, it's (extremely hairy) compile time executed C++.