Depends on your metaphor. If you think of software distribution like manufacturing, then writing the library is more like re-tooling an assembly line for production. This metaphor makes sense to me because both are significant one-time investments that (potentially) keep paying dividends far into the future.
But leveraging already existing SW (OS, stacks, web tools etc) is what makes us much more productive today compared to 20, 30 or 40 years ago.