Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Nim generates native dependency-free executables, not dependent on a virtual machine, which are small and allow easy redistribution.

That's... awesome. I've written a handful of little tools and scripts in Python for different (often non-technical) clients to use, but I've never found an easy way to package them up as a "click this icon to run the program" type of thing. If that's a solved problem with Nim I'm pretty much already sold.



Nuitka (nuitka.net) does that for python, and is very robust and compatible. It works way better than py2exe, cx_freeze, etx, and is cross platform.

However, the result, even for small scripts, is not what I would qualify as "small" :)

I also like pex (https://github.com/pantsbuild/pex) which allows to bundle a whole venv as a python script. Less heavy than nuitka, doesn't make it stand alone though, but very handy for quick and dirty scripts I want to one shot on my servers.

That doesn't remove any merit to nim. Such a cool project.


>Nuitka (nuitka.net) does that for python, and is very robust and compatible. It works way better than py2exe, cx_freeze, etx, and is cross platform. However, the result, even for small scripts, is not what I would qualify as "small" :)

How does Nuitka compare for generated executable sizes with PyInstaller? I've used the latter. For small Python scripts, CLI or wxPython, it created EXEs (Windows) in the range of 10 MB in size - with the all-code-in-one-file option.


Nuitka also improves performance. It has halved the startup time for a command line tool that I wrote.


As someone who usually develops in Nim but is now stuck with delivering some Python scripts that runs embedded in a C program I feel your pain.. The first time I had to deploy some Nim code and could just copy a single binary to the target machine and run it was such a good feeling!


It does do that. The only issue you might have is library support, but I have found it to be pretty good. For example Nim has had async HTTP client for a while now, while even Rust is just now getting it.

https://nim-lang.github.io/Nim/httpclient

https://github.com/nim-lang/Nim/commit/783087fd


The async lib doesn't supports timeout, meaning not usable in production or any serious workload.


I can see where you get that idea from, indeed the httpclient module doesn't have timeout flags for it's async recieve. But the asyncdispatch has a withTimeout procedure that should happily take the Future that you get from an async recieve and give you a timeout for it.


Neither does JavaScript fetch, I dont get your point


Go might be suited for you as well and it has a bigger ecosystem.


Nim supports dynamic libraries as well and that is very important for security.


A simple tarball would do, or a package or an installer.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: