3 ms·
Most languages with macro or templating should be able to define this behavior as a library. Rust and C++ come to mind, for example.
by cfstras 3y ago
Most languages with macro or templating should be able to define this behavior as a library. Rust and C++ come to mind, for example.
- tptacek 3y agoCan you provide an example of a Rust HTTP routing library that can generate a compile-time error for overlapping routes?
- tialaramex 3y agoI 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++.