Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config, src: enable nimPreviewSlimSystem #781

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ee7
Copy link
Member

@ee7 ee7 commented Aug 8, 2023

From the Nim 2.0.0 detailed changelog (emphasis added):

  • Certain definitions from the default system module have been moved to the following new modules:

    • std/syncio
    • std/assertions
    • std/formatfloat
    • std/objectdollar
    • std/widestrs
    • std/typedthreads
    • std/sysatomics

    In the future, these definitions will be removed from the system module, and their respective modules will have to be imported to use them. Currently, to make these imports required, the -d:nimPreviewSlimSystem option may be used.

  • Enabling -d:nimPreviewSlimSystem also removes the following deprecated symbols in the system module:

    • Aliases with an Error suffix to exception types that have a Defect suffix (see exceptions):
      ArithmeticError, DivByZeroError, OverflowError, AccessViolationError, AssertionError, OutOfMemError, IndexError, FieldError, RangeError, StackOverflowError, ReraiseError, ObjectAssignmentError, ObjectConversionError, FloatingPointError, FloatOverflowError, FloatUnderflowError, FloatInexactError, DeadThreadError, NilAccessError
    • addQuitProc, replaced by exitprocs.addExitProc
    • Legacy unsigned conversion operations: ze, ze64, toU8, toU16, toU32
    • TaintedString, formerly a distinct alias to string
    • PInt32, PInt64, PFloat32, PFloat64, aliases to ptr int32, ptr int64, ptr float32, ptr float64
  • Enabling -d:nimPreviewSlimSystem removes the import of channels_builtin in the system module, which is replaced by threading/channels. Use the command nimble install threading and import threading/channels.

Closes: #760


To-do:

  • Add the remaining required imports.

This PR is currently blocked by (at least) jsony not supporting this.

From the Nim 2.0.0 detailed changelog [1]:

    - Certain definitions from the default `system` module have been moved to
      the following new modules:

      - `std/syncio`
      - `std/assertions`
      - `std/formatfloat`
      - `std/objectdollar`
      - `std/widestrs`
      - `std/typedthreads`
      - `std/sysatomics`

      In the future, these definitions will be removed from the `system` module,
      and their respective modules will have to be imported to use them.
      Currently, to make these imports required, the `-d:nimPreviewSlimSystem` option
      may be used.

    - Enabling `-d:nimPreviewSlimSystem` also removes the following deprecated
      symbols in the `system` module:
      - Aliases with an `Error` suffix to exception types that have a `Defect` suffix
        (see [exceptions](https://nim-lang.github.io/Nim/exceptions.html)):
        `ArithmeticError`, `DivByZeroError`, `OverflowError`,
        `AccessViolationError`, `AssertionError`, `OutOfMemError`, `IndexError`,
        `FieldError`, `RangeError`, `StackOverflowError`, `ReraiseError`,
        `ObjectAssignmentError`, `ObjectConversionError`, `FloatingPointError`,
        `FloatOverflowError`, `FloatUnderflowError`, `FloatInexactError`,
        `DeadThreadError`, `NilAccessError`
      - `addQuitProc`, replaced by `exitprocs.addExitProc`
      - Legacy unsigned conversion operations: `ze`, `ze64`, `toU8`, `toU16`, `toU32`
      - `TaintedString`, formerly a distinct alias to `string`
      - `PInt32`, `PInt64`, `PFloat32`, `PFloat64`, aliases to
        `ptr int32`, `ptr int64`, `ptr float32`, `ptr float64`

    - Enabling `-d:nimPreviewSlimSystem` removes the import of `channels_builtin` in
      in the `system` module, which is replaced by `threading/channels`. Use the
      command `nimble install threading` and import `threading/channels`.

Closes: 760

[1] https://github.com/nim-lang/Nim/blob/v2.0.0/changelogs/changelog_2_0_0_details.md#changes-affecting-backward-compatibility
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

config: consider adding -d:nimPreviewSlimSystem
1 participant