I noticed that Nimble deploys source only. I have a module I've created and generated a shared library for it (mylib.dll or mylib.so). I deploy it in my path and attempt to use it like so:
import mylib
echo someFunc()
However this doesn't work. I get the error
Error: cannot open 'mylib'
Does 'import' only work with modules in source form? Is there something else I should be doing?
You will still need the source code to compile Nim programs (for starters, you couldn't do templates, macros, or generics without source code or at least some intermediate representation of it). What shared libraries do is to allow for the binary code of the library to be reused. If you want to see how this works in practice, look at lib/nimrtl.nim (compiling which with the proper options builds the stdlib as a shared library) and lib/system/inclrtl.nim (which has the necessary wiring to export/import functions/variables from/to the shared library via pragma {.rtl.} etc.).
Shared libraries aren't for incremental compilation. This is what the (currently broken) command line option --symbolFiles:on is for.