Since nobody else is reaping the NimForum karma, I might as well share this. Nim 1.2 is here:
https://nim-lang.org/blog/2020/04/03/version-120-released.html
As always, update via:
choosenim update stable
Happy hacking!
great news! Could anyone explain the usage of dup ? I can't get it :)
In what cases I should think about using it and why ( what benefits it gives )
Great, thanks so much Araq and Nim team!
I particularly love the SA/H3 and the .localPassC pragmas.
Quick question related to that: Assume that I have a Nim file which needs a C file compiled but with different C compiler parameters than the Nim file. Is there a way to tell which compiler parameters shall be used only for the C file, possibly along with .compile?
The new sugar macros are delicious 🙏
Many thanks to the Nim team!
I have taken the dup example from the 1.2 release notes and have refactored it a bit to help better explain this feature: https://play.nim-lang.org/#ix=2gxD
Basically the dup macro helps resuse a proc that had (1) mutable arg and (2) no return type to be used as a proc with (1) immutable arg, and (2) return type same as the arg type.
It's not in sugar. You import it with
import std/with
This is because we removed dead code elimination from the openssl wrapper, why did we do this?
Unrelated, it's due to this: https://github.com/nim-lang/Nim/pull/6664. This feature requires OpenSSL 1.1 and above. You can pass -d:nimDisableCertificateValidation to avoid this, but I wouldn't recommend it.
OpenSSL older than 1.1 is EOL-ed, so everyone should hop on the next version instead of trying to keep the old one running.
Also, dead code elimination is enabled by default and cannot be disabled. The pragma was simply removed because it did nothing.
Or are the bugfixes already integrated in stable?
Bugfixes will be backported and produce the version 1.2.2.