diff --git a/changelog.md b/changelog.md index fc409c8aa6aa7..733a78e07f8dc 100644 --- a/changelog.md +++ b/changelog.md @@ -1,80 +1,80 @@ -# v1.4.0 - yyyy-mm-dd - - - -## Standard library additions and changes - -- `uri` adds Data URI Base64, implements RFC-2397. -- Add [DOM Parser](https://developer.mozilla.org/en-US/docs/Web/API/DOMParser) - to the `dom` module for the JavaScript target. -- The default hash for `Ordinal` has changed to something more bit-scrambling. - `import hashes; proc hash(x: myInt): Hash = hashIdentity(x)` recovers the old - one in an instantiation context while `-d:nimIntHash1` recovers it globally. -- `deques.peekFirst` and `deques.peekLast` now have `var Deque[T] -> var T` overloads. -- File handles created from high-level abstractions in the stdlib will no longer - be inherited by child processes. In particular, these modules are affected: - `system`, `nativesockets`, `net` and `selectors`. - - For `net` and `nativesockets`, an `inheritable` flag has been added to all - `proc`s that create sockets, allowing the user to control whether the - resulting socket is inheritable. This flag is provided to ease the writing of - multi-process servers, where sockets inheritance is desired. - - For a transistion period, define `nimInheritHandles` to enable file handle - inheritance by default. This flag does **not** affect the `selectors` module - due to the differing semantics between operating systems. - - `system.setInheritable` and `nativesockets.setInheritable` is also introduced - for setting file handle or socket inheritance. Not all platform have these - `proc`s defined. - -- The file descriptors created for internal bookkeeping by `ioselector_kqueue` - and `ioselector_epoll` will no longer be leaked to child processes. - -- `relativePath(rel, abs)` and `relativePath(abs, rel)` used to silently give wrong results - (see #13222); instead they now use `getCurrentDir` to resolve those cases, - and this can now throw in edge cases where `getCurrentDir` throws. - `relativePath` also now works for js with `-d:nodejs`. - - -## Language changes -- In newruntime it is now allowed to assign discriminator field without restrictions as long as case object doesn't have custom destructor. Discriminator value doesn't have to be a constant either. If you have custom destructor for case object and you do want to freely assign discriminator fields, it is recommended to refactor object into 2 objects like this: - ```nim - type - MyObj = object - case kind: bool - of true: y: ptr UncheckedArray[float] - of false: z: seq[int] - - proc `=destroy`(x: MyObj) = - if x.kind and x.y != nil: - deallocShared(x.y) - x.y = nil - ``` - Refactor into: - ```nim - type - MySubObj = object - val: ptr UncheckedArray[float] - MyObj = object - case kind: bool - of true: y: MySubObj - of false: z: seq[int] - - proc `=destroy`(x: MySubObj) = - if x.val != nil: - deallocShared(x.val) - x.val = nil - ``` - -- getImpl() on enum type symbols now returns field syms instead of idents. This helps - with writing typed macros. Old behavior for backwards compatiblity can be restored - with command line switch `--useVersion:1.0`. - -## Compiler changes - -- Specific warnings can now be turned into errors via `--warningAsError[X]:on|off`. -- The `define` and `undef` pragmas have been de-deprecated. - -## Tool changes - +## Changelogs for past and upcoming releases +* 1.4.0 [source](changelogs/changelog_1_4_0.md). Upcoming release. +* 1.2.0: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2020-04-03-version-120-released.md) + [url](https://nim-lang.org/blog//2020/04/03/version-120-released.html) +* 1.0.6: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2020-01-24-version-106-released.md) + [url](https://nim-lang.org/blog//2020/01/24/version-106-released.html) +* 1.0.4: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2019-11-26-version-104-released.md) + [url](https://nim-lang.org/blog//2019/11/26/version-104-released.html) +* 1.0.2: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2019-10-23-version-102-released.md) + [url](https://nim-lang.org/blog//2019/10/23/version-102-released.html) +* 1.0.0: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2019-09-23-version-100-released.md) + [url](https://nim-lang.org/blog//2019/09/23/version-100-released.html) +* 0.20.2: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2019-07-17-version-0202-released.md) + [url](https://nim-lang.org/blog//2019/07/17/version-0202-released.html) +* 0.20.0: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2019-06-06-version-0200-released.md) + [url](https://nim-lang.org/blog//2019/06/06/version-0200-released.html) +* 0.19.6: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2019-05-13-version-0196-released.md) + [url](https://nim-lang.org/blog//2019/05/13/version-0196-released.html) +* 0.19.4: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2019-02-01-version-0194-released.md) + [url](https://nim-lang.org/blog//2019/02/01/version-0194-released.html) +* 0.19.2: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2018-12-31-version-0192-released.md) + [url](https://nim-lang.org/blog//2018/12/31/version-0192-released.html) +* 0.19.0: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2018-09-26-version-0190-released.md) + [url](https://nim-lang.org/blog/2018/09/26/version-0190-released.html) +* 0.18.0: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2018-03-01-version-0180-released.md) + [url](https://nim-lang.org/blog/2018/03/01/version-0180-released.html) +* 0.17.2: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2017-09-07-version-0172-released.md) + [url](https://nim-lang.org/blog/2017/09/07/version-0172-released.html) +* 0.17.0: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2017-05-17-version-0170-released.md) + [url](https://nim-lang.org/blog/2017/05/17/version-0170-released.html) +* 0.16.0: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2017-01-08-version-0160-released.md) + [url](https://nim-lang.org/blog/2017/01/08/version-0160-released.html) +* 0.15.2: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2016-10-23-version-0152-released.md) + [url](https://nim-lang.org/blog/2016/10/23/version-0152-released.html) +* 0.15.0: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2016-09-30-version-0150-released.md) + [url](https://nim-lang.org/blog/2016/09/30/version-0150-released.html) +* 0.14.2: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2016-06-09-version-0142-released.md) + [url](https://nim-lang.org/blog/2016/06/09/version-0142-released.html) +* 0.14.0: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2016-06-07-version-0140-released.md) + [url](https://nim-lang.org/blog/2016/06/07/version-0140-released.html) +* 0.13.0: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2016-01-18-version-0130-released.md) + [url](https://nim-lang.org/blog/2016/01/18/version-0130-released.html) +* 0.12.0: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2015-10-27-version-0120-released.md) + [url](https://nim-lang.org/blog/2015/10/27/version-0120-released.html) +* 0.11.2: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2015-05-04-version-0112-released.md) + [url](https://nim-lang.org/blog/2015/05/04/version-0112-released.html) +* 0.11.0: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2015-04-30-version-0110-released.md) + [url](https://nim-lang.org/blog/2015/04/30/version-0110-released.html) +* 0.10.2: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2014-12-29-version-0102-released.md) + [url](https://nim-lang.org/blog/2014/12/29/version-0102-released.html) +* 0.9.6: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2014-10-19-version-096-released.md) + [url](https://nim-lang.org/blog/2014/10/19/version-096-released.html) +* 0.9.4: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2014-04-21-version-094-released.md) + [url](https://nim-lang.org/blog/2014/04/21/version-094-released.html) +* 0.9.2: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2013-05-20-version-092-released.md) + [url](https://nim-lang.org/blog/2013/05/20/version-092-released.html) +* 0.9.0: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2012-09-23-version-090-released.md) + [url](https://nim-lang.org/blog/2012/09/23/version-090-released.html) +* 0.8.14: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2012-02-09-version-0814-released.md) + [url](https://nim-lang.org/blog/2012/02/09/version-0814-released.html) +* 0.8.12: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2011-07-10-version-0812-released.md) + [url](https://nim-lang.org/blog/2011/07/10/version-0812-released.html) +* 0.8.10: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2010-10-20-version-0810-released.md) + [url](https://nim-lang.org/blog/2010/10/20/version-0810-released.html) +* 0.8.8: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2010-03-14-version-088-released.md) + [url](https://nim-lang.org/blog/2010/03/14/version-088-released.html) +* 0.8.6: [source](https://github.com/nim-lang/website/blob/master/jekyll/_posts/2009-12-21-version-086-released.md) + [url](https://nim-lang.org/blog/2009/12/21/version-086-released.html) + +## Changelog source files +* Changelogs from 0.8.6 to 0.17.2 are version controlled in the [nim website](https://github.com/nim-lang/website/tree/master/jekyll/_posts). +* Changelogs since 0.18.0 are version controlled in [changelogs/](changelogs/). +* Any updates to past changelogs should be done in [changelogs/](changelogs/) first, and backported to the nim website. + +## Creating a new release changelog +After a release, supposing next version will be 1.4.0: +* Run `cp changelogs/changelog_X_XX_X.md changelogs/changelog_1_4_0.md` +* Update `current changelog` entry in this file +* Update `system.NimMinor,NimMinor,NimPatch` to (1, 4, 0) +* Copy the changelog to [nim website](https://github.com/nim-lang/website/tree/master/jekyll/_posts). diff --git a/changelogs/changelog_0_18_1.md b/changelogs/changelog_0_18_0.md similarity index 100% rename from changelogs/changelog_0_18_1.md rename to changelogs/changelog_0_18_0.md diff --git a/changelogs/changelog_1_4_0.md b/changelogs/changelog_1_4_0.md new file mode 100644 index 0000000000000..fc409c8aa6aa7 --- /dev/null +++ b/changelogs/changelog_1_4_0.md @@ -0,0 +1,80 @@ +# v1.4.0 - yyyy-mm-dd + + + +## Standard library additions and changes + +- `uri` adds Data URI Base64, implements RFC-2397. +- Add [DOM Parser](https://developer.mozilla.org/en-US/docs/Web/API/DOMParser) + to the `dom` module for the JavaScript target. +- The default hash for `Ordinal` has changed to something more bit-scrambling. + `import hashes; proc hash(x: myInt): Hash = hashIdentity(x)` recovers the old + one in an instantiation context while `-d:nimIntHash1` recovers it globally. +- `deques.peekFirst` and `deques.peekLast` now have `var Deque[T] -> var T` overloads. +- File handles created from high-level abstractions in the stdlib will no longer + be inherited by child processes. In particular, these modules are affected: + `system`, `nativesockets`, `net` and `selectors`. + + For `net` and `nativesockets`, an `inheritable` flag has been added to all + `proc`s that create sockets, allowing the user to control whether the + resulting socket is inheritable. This flag is provided to ease the writing of + multi-process servers, where sockets inheritance is desired. + + For a transistion period, define `nimInheritHandles` to enable file handle + inheritance by default. This flag does **not** affect the `selectors` module + due to the differing semantics between operating systems. + + `system.setInheritable` and `nativesockets.setInheritable` is also introduced + for setting file handle or socket inheritance. Not all platform have these + `proc`s defined. + +- The file descriptors created for internal bookkeeping by `ioselector_kqueue` + and `ioselector_epoll` will no longer be leaked to child processes. + +- `relativePath(rel, abs)` and `relativePath(abs, rel)` used to silently give wrong results + (see #13222); instead they now use `getCurrentDir` to resolve those cases, + and this can now throw in edge cases where `getCurrentDir` throws. + `relativePath` also now works for js with `-d:nodejs`. + + +## Language changes +- In newruntime it is now allowed to assign discriminator field without restrictions as long as case object doesn't have custom destructor. Discriminator value doesn't have to be a constant either. If you have custom destructor for case object and you do want to freely assign discriminator fields, it is recommended to refactor object into 2 objects like this: + ```nim + type + MyObj = object + case kind: bool + of true: y: ptr UncheckedArray[float] + of false: z: seq[int] + + proc `=destroy`(x: MyObj) = + if x.kind and x.y != nil: + deallocShared(x.y) + x.y = nil + ``` + Refactor into: + ```nim + type + MySubObj = object + val: ptr UncheckedArray[float] + MyObj = object + case kind: bool + of true: y: MySubObj + of false: z: seq[int] + + proc `=destroy`(x: MySubObj) = + if x.val != nil: + deallocShared(x.val) + x.val = nil + ``` + +- getImpl() on enum type symbols now returns field syms instead of idents. This helps + with writing typed macros. Old behavior for backwards compatiblity can be restored + with command line switch `--useVersion:1.0`. + +## Compiler changes + +- Specific warnings can now be turned into errors via `--warningAsError[X]:on|off`. +- The `define` and `undef` pragmas have been de-deprecated. + +## Tool changes + diff --git a/changelogs/changelog_X_XX_X.md b/changelogs/changelog_X_XX_X.md index 48520fd44c94c..8258963056219 100644 --- a/changelogs/changelog_X_XX_X.md +++ b/changelogs/changelog_X_XX_X.md @@ -1,7 +1,6 @@ # v1.xx.x - yyyy-mm-dd -This is an example file. -The changes should go to changelog.md! +This is an example file. See instructions in $nim/changelogs/readme.md ## Standard library additions and changes diff --git a/changelogs/readme.md b/changelogs/readme.md deleted file mode 100644 index 3ff1e1b7b83ba..0000000000000 --- a/changelogs/readme.md +++ /dev/null @@ -1,61 +0,0 @@ -# Update changelog -After each release, call: -``` -git mv changelog.md changelogs/changelog_0_19_0.md # use correct version -cp changelogs/changelog_X_XX_X.md changelog.md -git add changelog.md -``` - -## Recent changelogs are saved here (with their git history) - -## Older changelogs are stored in https://github.com/nim-lang/website - -## source files: -* https://github.com/nim-lang/website/blob/master/jekyll/_posts/2009-12-21-version-086-released.md -* https://github.com/nim-lang/website/blob/master/jekyll/_posts/2010-03-14-version-088-released.md -* https://github.com/nim-lang/website/blob/master/jekyll/_posts/2010-10-20-version-0810-released.md -* https://github.com/nim-lang/website/blob/master/jekyll/_posts/2011-07-10-version-0812-released.md -* https://github.com/nim-lang/website/blob/master/jekyll/_posts/2012-02-09-version-0814-released.md -* https://github.com/nim-lang/website/blob/master/jekyll/_posts/2012-09-23-version-090-released.md -* https://github.com/nim-lang/website/blob/master/jekyll/_posts/2013-05-20-version-092-released.md -* https://github.com/nim-lang/website/blob/master/jekyll/_posts/2014-04-21-version-094-released.md -* https://github.com/nim-lang/website/blob/master/jekyll/_posts/2014-10-19-version-096-released.md -* https://github.com/nim-lang/website/blob/master/jekyll/_posts/2014-12-29-version-0102-released.md -* https://github.com/nim-lang/website/blob/master/jekyll/_posts/2015-04-30-version-0110-released.md -* https://github.com/nim-lang/website/blob/master/jekyll/_posts/2015-05-04-version-0112-released.md -* https://github.com/nim-lang/website/blob/master/jekyll/_posts/2015-10-27-version-0120-released.md -* https://github.com/nim-lang/website/blob/master/jekyll/_posts/2016-01-18-version-0130-released.md -* https://github.com/nim-lang/website/blob/master/jekyll/_posts/2016-06-07-version-0140-released.md -* https://github.com/nim-lang/website/blob/master/jekyll/_posts/2016-06-09-version-0142-released.md -* https://github.com/nim-lang/website/blob/master/jekyll/_posts/2016-09-30-version-0150-released.md -* https://github.com/nim-lang/website/blob/master/jekyll/_posts/2016-10-23-version-0152-released.md -* https://github.com/nim-lang/website/blob/master/jekyll/_posts/2017-01-08-version-0160-released.md -* https://github.com/nim-lang/website/blob/master/jekyll/_posts/2017-05-17-version-0170-released.md -* https://github.com/nim-lang/website/blob/master/jekyll/_posts/2017-09-07-version-0172-released.md -* https://github.com/nim-lang/website/blob/master/jekyll/_posts/2018-03-01-version-0180-released.md -* https://github.com/nim-lang/website/blob/master/jekyll/_posts/2018-09-26-version-0190-released.md - -## urls: -* https://nim-lang.org/blog/2009/12/21/version-086-released.html -* https://nim-lang.org/blog/2010/03/14/version-088-released.html -* https://nim-lang.org/blog/2010/10/20/version-0810-released.html -* https://nim-lang.org/blog/2011/07/10/version-0812-released.html -* https://nim-lang.org/blog/2012/02/09/version-0814-released.html -* https://nim-lang.org/blog/2012/09/23/version-090-released.html -* https://nim-lang.org/blog/2013/05/20/version-092-released.html -* https://nim-lang.org/blog/2014/04/21/version-094-released.html -* https://nim-lang.org/blog/2014/10/19/version-096-released.html -* https://nim-lang.org/blog/2014/12/29/version-0102-released.html -* https://nim-lang.org/blog/2015/04/30/version-0110-released.html -* https://nim-lang.org/blog/2015/05/04/version-0112-released.html -* https://nim-lang.org/blog/2015/10/27/version-0120-released.html -* https://nim-lang.org/blog/2016/01/18/version-0130-released.html -* https://nim-lang.org/blog/2016/06/07/version-0140-released.html -* https://nim-lang.org/blog/2016/06/09/version-0142-released.html -* https://nim-lang.org/blog/2016/09/30/version-0150-released.html -* https://nim-lang.org/blog/2016/10/23/version-0152-released.html -* https://nim-lang.org/blog/2017/01/08/version-0160-released.html -* https://nim-lang.org/blog/2017/05/17/version-0170-released.html -* https://nim-lang.org/blog/2017/09/07/version-0172-released.html -* https://nim-lang.org/blog/2018/03/01/version-0180-released.html -* https://nim-lang.org/blog/2018/09/26/version-0190-released.html diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 96fd6be05ab22..ec53e14a4f939 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -131,7 +131,7 @@ proc semEnum(c: PContext, n: PNode, prev: PType): PType = e.typ = result e.position = int(counter) let symNode = newSymNode(e) - if optNimV1Emulation notin c.config.options and identToReplace != nil: + if optNimV1Emulation notin c.config.globalOptions and identToReplace != nil: identToReplace[] = symNode if e.position == 0: hasNull = true if result.sym != nil and sfExported in result.sym.flags: