Version 0.20.2 released

The Nim team is happy to announce version 0.20.2, which is our second release candidate for version 1.0.

To read more about version 0.20 and our plans for version 1.0 and beyond, check the previous release notes. This is mostly a bugfix release of version 0.20.0 (1.0 RC1).

The only new feature is that toOpenArray , our slicing operator, is now available for the JavaScript backend.

Although this release comes only one month after a previous release, it has over 200 new commits, fixing over 70 reported issues and bringing lots of improvements which should make Nim even more stable.

Style checks

Since version 0.20.0 we improved our style checker to the point that Nim now bootstraps with --styleCheck:error flag, meaning that the compiler and the standard library are now style checked and they won’t compile if different styles (e.g. fooBar and foo_bar ) are used.

If you would like to only style check your own nimble package, but not its dependencies, you can use --styleCheck:hint , making your package consistent while still retaining perfect interoperability with all other Nim code in the wild.

Nimpretty

One of the areas which we focused on for this release is our nimpretty tool – it is a Nim source code beautifier, to format code according to the official style guide (NEP-1). More than 30 commits were made aiming to improve nimpretty experience and to make it more robust for real-world scenarios. Nimpretty version 0.2 ships with Nim, and we invite you to give it a try.

New runtime

The new runtime is progressing nicely but it is off the critical path for version 1.0 as it’s an opt-in feature. The next significant milestone is to make the new runtime work with async . Only after this is accomplished we can push for more adoption of it.

Installing 0.20.2

If you have installed a previous version of Nim using choosenim , getting Nim 0.20.2 is as easy as:

$ choosenim update stable

If you don’t have it already, you can get choosenim by following these instructions or you can install Nim by following the instructions on our install page.

Changes affecting backwards compatibility

All strutils.rfind procs now take start and last like strutils.find with the same data slice/index meaning. This is backwards compatible for calls not changing the rfind start parameter from its default. (#11487) In the unlikely case that you were using rfind X, start=N , or rfind X, N , then you need to change that to rfind X, last=N or rfind X, 0, N . (This should minimize gotchas porting code from other languages like Python or C++.)

On Windows stderr/stdout/stdin are not opened as binary files anymore. Use the switch -d:nimBinaryStdFiles for a transition period.

Breaking changes in the standard library

Mac OS X / BSD: TSa_Family is now the uint8 type, so type conversions like x.sin_family = uint16 toInt(nativesockets.AF_INET) need to be changed into x.sin_family = TSa_Family toInt(nativesockets.AF_INET) .

Library additions

toOpenArray is now available for the JS target.

Library changes

Fix async IO operations stalling even after socket is closed. (#11232)

More informative error message for streams.openFileStream . (#11438)

Compiler changes

Better error message for IndexError for empty containers. (#11476)

Fix regression in semfold for old right shift. (#11477)

Fix for passing tuples as static params to macros. (#11423)

Bugfixes