I found it because because I asked (and suddenly remembered) a similar question in the past :-) https://forum.nim-lang.org/t/9615#63168
Apart from this I think Nim is a beautiful language. :-)
@SolitudeSF
A simple function is still a function...
@SolitudeSF
I have seen those. Your reply is disconnected from my message..
This is really just repeating what @SolitudeSF said, but you can't find the string function because it doesn't exist. A Path is a distinct string, so essentially it's already a string. Path("/some/path") is a type conversion from string to Path, and string(myPath) is a type conversion from Path to string. Neither are functions, and there's no specific implementation anywhere to find. You're just telling the compiler to treat the data as one type or the other. Basically casting the data, but type safe.
I'm not sure why Path doesn't provide a $ operator, but you can tell the compiler to use the version from its base type (string) like this: proc `$`*(self: Path): string {.borrow.}.
There is a universal "turn anything into a string" function called repr, but it's meant as a debugging tool. $ is the default way you should turn things into strings, unless they're distinct strings, in which case you can use a type conversion.