by sergiotapia · 8y ago · 0 comments
Does Nim have true single-binary deploys like Go has? My original project is written in Elixir and even with Distillery it still seems a little convoluted for what I'm trying to deliver to end users.
I want a real, download this and run it boom, go to localhost:1234 for some cool stuff.
Certain Nim modules/packages might wrap a C library. If you use those then your binary will typically depend on a DLL for that C library. With some effort you can statically link against those libraries, but I wouldn't call that easy. This is in particular a problem when you're using regex or SSL, the former depends on PCRE and the latter on OpenSSL/LibreSSl.
Go benefits from having native implementations of those written in Go. We also now have a regex engine[1] implemented in Nim but it hasn't made its way into the stdlib yet (that is planned though). But you can use it pretty easily as a package if you want to avoid the dependency on PCRE.
See my recent post https://scripter.co/nim-deploying-static-binaries/.
Download and run binary to try: https://github.com/kaushalmodi/hello_musl/releases (prints just "Hello, world!").
I plan to release similar binary for my ntodo[0] project, that will make API calls to fetch/set tasks in Todoist.