3.2 KiB
v1.6.x - yyyy-mm-dd
Changes affecting backward compatibility
- The configuration subsystem now allows for
-d:releaseand-d:dangerto work as expected. The downside is that these defines now have custom logic that doesn't apply for other defines.
Standard library additions and changes
-
Added support for parenthesized expressions in
strformat -
Fixed buffer overflow bugs in
net -
Added
sectionsiterator inparsecfg. -
Make custom op in macros.quote work for all statements.
-
On Windows the SSL library now checks for valid certificates. It uses the
cacert.pemfile for this purpose which was extracted fromhttps://curl.se/ca/cacert.pem. Besides the OpenSSL DLLs (e.g. libssl-1_1-x64.dll, libcrypto-1_1-x64.dll) you now also need to shipcacert.pemwith your.exefile. -
Make
{.requiresInit.}pragma to work fordistincttypes. -
Added a macros
enumLenfor returning the number of items in an enum to thetypetraits.nimmodule. -
preludenow works with the JavaScript target. -
Added
ioutilsmodule containingduplicateandduplicateToto duplicateFileHandleusing C functiondupanddup2. -
The JSON module can now handle integer literals and floating point literals of arbitrary length and precision. Numbers that do not fit the underlying
BiggestIntorBiggestFloatfields are kept as string literals and one can use external BigNum libraries to handle these. TheparseFloatfamily of functions also has now optionalrawIntegersandrawFloatsparameters that can be used to enforce that all integer or float literals remain in the "raw" string form so that client code can easily treat small and large numbers uniformly. -
Added
randStatetemplate that exposes the default random number generator. Useful for library authors. -
Added
asyncdispatch.activeDescriptorsthat returns the number of currently active async event handles/file descriptors -
Fixed premature garbage collection in asyncdispatch, when a stack trace override is in place.
Language changes
-
nimscriptnow handlesexcept Exception as e -
The
cstringdoesn't support[]=operator in JS backend.
Compiler changes
-
Added
unsafeIsolateandextracttostd/isolation. -
--hint:CCnow goes to stderr (like all other hints) instead of stdout. -
json build instructions are now generated in
$nimcache/outFileBasename.jsoninstead of$nimcache/projectName.json. This allows avoiding recompiling a given project compiled with different options if the output file differs. -
--usenimcache(implied bynim r main) now generates an output file that includes a hash of some of the compilation options, which allows caching generated binaries: nim r main # recompiles nim r -d:foo main # recompiles nim r main # uses cached binary nim r main arg1 arg2 # ditto (runtime arguments are irrelevant) -
The style checking of the compiler now supports a
--styleCheck:usagesswitch. This switch enforces that every symbol is written as it was declared, not enforcing the official Nim style guide. To be enabled, this has to be combined either with--styleCheck:erroror--styleCheck:hint.