Thoughts
I have to solve the path problem.
The path problem is named for a specific instance of the problem that arises when manipulating paths in a webserver. The webserver has to take a URL-path (e.g. `/static/images/example.png`) and know that static files are served from, for example, `/var/www/example.com/`. And so it has to return the file at `/var/www/example.com/images/example.png`. Now the problem is not that this is hard. There are std library functions in most every language to do these kinds of path operations.
The problem is that "a path" has several different meanings. It could refer to the entire raw URL-path from the client, or the URL path after it's been sanitized to remove any directory traversal attempts (e.g. `/static/../../../../etc/passwd` needs to be rejected at some point), or the relative path to the image (e.g. `/images/example.png`) or to the entire file system path. Not to mention that all of these have variants with or without trailing or leading slashes. These are all very different semantically.
But despite their semantic differences, they're represented by the computer in exactly the same way. They're all strings, or maybe in a language with a generous type system, they're all `Path`s. And you want to have utility functions that can work on all of them, right? There is similarity there.
But this means that if you're writing a static web server you have to keep in mind the intended semantics of every path-style value at all points in your code, because otherwise you could end up passing something that starts with a `/` to a function that expects a relative path and end up with a path traversal vulnerability.
That's not to say "coding is too hard," this isn't one of these posts. This path example isn't even a hard problem, it's quite possible for one person to solve. The larger problem is that there are always, in coding, these larger, undocumented, semantic, understandings about the behavior of functions. Even functions that, at first glance, look to be composable in every possible way; even functions that your type-checker says are compatible. (If one function expects a serialized file system path starting with a slash and you ever pass it something directly from the URL, that's a terrible error.)
I'm not sure what the solution is. Possibly a more powerful (Thu-like) type system. Possible a different style of coding from the functional or object-oriented paradigms. Possibly better documentation or comments.