title: What are the differences between .so and .dylib on macOS?
body: <p>.dylib is the dynamic library extension on macOS, but it's never been clear to me when I can't / shouldn't use a traditional unix .so shared object.</p>
  <p>Some of the questions I have:</p>
  <ul>
  <li>At a conceptual level, what are the main differences between .so and .dylib?</li>
  <li>When can/should I use one over the other?</li>
  <li>Compilation tricks &amp; tips (For example, the replacement for gcc -shared -fPIC, since that doesn't work on osx)</li>
  </ul>