Commit graph

17 commits

Author SHA1 Message Date
ryoon
c1bd47eb85 nim: Update to 1.2.2
Changelog:
Bugfixes

    Fixed “Critical: 1 completed Future, multiple await: Only 1 await will be awakened (the last one)” (#13889)
    Fixed ““distinct uint64” type corruption on 32-bit, when using {.borrow.} operators” (#13902)
    Fixed “Regression: impossible to use typed pragmas with proc types” (#13909)
    Fixed “openssl wrapper corrupts stack on OpenSSL 1.1.1f + Android” (#13903)
    Fixed “add nimExe to nim dump” (#13876)
    Fixed “simple ‘var openarray[char]’ assignment crash when the openarray source is a local string and using gc:arc” (#14003)
    Fixed “Cant use expressions with when in type sections.” (#14007)
    Fixed “Annoying warning: inherit from a more precise exception type like ValueError, IOError or OSError [InheritFromException]” (#14052)
    Fixed “Incorrect escape sequence for example in jsffi library documentation” (#14110)
    Fixed “macOS: dsymutil should not be called on static libraries” (#14132)
    Fixed “Fix single match output” (#12920)
    Fixed “algorithm.sortedByIt template corrupts tuple input under –gc:arc” (#14079)
    Fixed “strformat: doc example fails” (#14054)
    Fixed “Nim doc fail to run for nim 1.2.0 (nim 1.0.4 is ok)” (#13986)
    Fixed “Exception when converting csize to clong” (#13698)
    Fixed “[ARC] Segfault with cyclic references (?)” (#14159)
    Fixed “cas is wrong for tcc” (#14151)
    Fixed “Use -d:nimEmulateOverflowChecks by default?” (#14209)
    Fixed “Invalid return value of openProcess is NULL rather than INVALID_HANDLE_VALUE(-1) in windows” (#14289)
    Fixed “nim-gdb is missing from all released packages” (#13104)
    Fixed “compiler error with inline async proc and pragma” (#13998)
    Fixed “Linker error with closures” (#209)
    Fixed “ARC codegen bug with inline iterators” (#14219)
    Fixed “[ARC] implicit move on last use happening on non-last use” (#14269)
    Fixed “Boehm GC does not scan thread-local storage” (#14364)
    Fixed “RVO not exception safe” (#14126)
    Fixed “ARC: unreliable setLen “ (#14495)
    Fixed “lent is unsafe: after #14447 you can modify variables with “items” loop for sequences” (#14498)
    Fixed “moveFile does not overwrite destination file” (#14057)
    Fixed “var op = fn() wrongly gives warning ObservableStores with object of RootObj type” (#14514)
    Fixed “wrapWords seems to ignore linebreaks when wrapping, leaving breaks in the wrong place” (#14579)
2020-06-21 07:43:29 +00:00
nikita
9595fa3a58 lang/nim: maybe fix build in sandbox 2020-06-14 16:15:54 +00:00
joerg
36d3ab2956 Honor pkgsrc environment. 2020-05-14 19:18:23 +00:00
nikita
b9f83bca93 lang/nim: Add bl3 file 2020-05-11 19:45:54 +00:00
nikita
ccb8288771 lang/nim: build and install tools and nimble. 2020-05-11 19:08:59 +00:00
ryoon
e15698d087 nim: Update to 1.2.0
Changelog:
# v1.2.0 - 2020-04-02

## Standard library additions and changes

- Added overloaded `strformat.fmt` macro that use specified characters as
  delimiter instead of '{' and '}'.
- Added new procs in `tables.nim`: `OrderedTable.pop`, `CountTable.del`,
  `CountTable.pop`, `Table.pop`.
- Added `strtabs.clear` overload that reuses the existing mode.
- Added `browsers.osOpen` const alias for the operating system specific *"open"* command.
- Added `sugar.dup` for turning in-place algorithms like `sort` and `shuffle`
  into operations that work on a copy of the data and return the mutated copy,
  like the existing `sorted` does.
- Added `sugar.collect` that does comprehension for seq/set/table collections.
- Added `sugar.capture` for capturing some local loop variables when creating a
  closure. This is an enhanced version of `closureScope`.
- Added `typetraits.tupleLen` to get number of elements of a tuple/type tuple,
  and `typetraits.get` to get the ith element of a type tuple.
- Added `typetraits.genericParams` to return a tuple of generic params from a
  generic instantiation.
- `options` now treats `proc` like other pointer types, meaning `nil` proc variables
  are converted to `None`.
- Added `os.normalizePathEnd` for additional path sanitization.
- Added `times.fromUnixFloat,toUnixFloat`, sub-second resolution versions of
  `fromUnix`,`toUnixFloat`.
- Added `wrapnils` module for chains of field-access and indexing where the LHS
  can be nil. This simplifies code by reducing need for if-else branches around
  intermediate maybe nil values. E.g. `echo ?.n.typ.kind`.
- Added `minIndex`, `maxIndex` and `unzip` to the `sequtils` module.
- Added `os.isRelativeTo` to tell whether a path is relative to another.
- Added `resetOutputFormatters` to `unittest`.
- Added `expectIdent` to the `macros` module.
- Added `os.isValidFilename` that returns `true` if `filename` argument is valid
  for cross-platform use.
- Added `times.isLeapDay`
- `base64` adds URL-Safe Base64, implements RFC-4648 Section-7.
- Added a new module, `std / compilesettings` for querying the compiler about
  diverse configuration settings.
- Added `net.getPeerCertificates` and `asyncnet.getPeerCertificates` for
  retrieving the verified certificate chain of the peer we are connected to
  through an SSL-wrapped `Socket`/`AsyncSocket`.
- Added `browsers.openDefaultBrowser` without URL, implements IETF RFC-6694 Section-3.
- Added `jsconsole.trace`, `jsconsole.table`, `jsconsole.exception` for JavaScript target.
- Added `distinctBase` overload for values: `assert 12.MyInt.distinctBase == 12`
- Added new module `std/stackframes`, in particular `setFrameMsg`, which enables
  custom runtime annotation of stackframes, see #13351 for examples.
  Turn on/off via `--stackTraceMsgs:on/off`.
- Added `sequtils.countIt`, allowing for counting items using a predicate.
- Added a `with` macro for easy function chaining that's available everywhere,
  there is no need to concern your APIs with returning the first argument
  to enable "chaining", instead use the dedicated macro `with` that
  was designed for it. For example:

```nim
type
  Foo = object
    col, pos: string

proc setColor(f: var Foo; r, g, b: int) = f.col = $(r, g, b)
proc setPosition(f: var Foo; x, y: float) = f.pos = $(x, y)

var f: Foo
with(f, setColor(2, 3, 4), setPosition(0.0, 1.0))
echo f
```

- `macros.newLit` now works for ref object types.
- `macro pragmas` can now be used in type sections.
- 5 new pragmas were added to Nim in order to make the upcoming tooling more
  convenient to use. Nim compiler checks these pragmas for syntax but otherwise
  ignores them. The pragmas are `requires`, `ensures`, `assume`, `assert`, `invariant`.
- `system.writeFile` has been overloaded to also support `openarray[byte]`.
- `asyncdispatch.drain` now properly takes into account `selector.hasPendingOperations`
  and only returns once all pending async operations are guaranteed to have completed.
- `sequtils.zip` now returns a sequence of anonymous tuples i.e. those tuples
  now do not have fields named "a" and "b".
- `distinctBase` has been moved from `sugar` to `typetraits` and now it is
  implemented as compiler type trait instead of macro. `distinctBase` in sugar
  module is now deprecated.
- `CountTable.mget` has been removed from `tables.nim`. It didn't work, and it
  was an oversight to be included in v1.0.
- `tables.merge(CountTable, CountTable): CountTable` has been removed.
  It didn't work well together with the existing inplace version of the same proc
  (`tables.merge(var CountTable, CountTable)`).
  It was an oversight to be included in v1.0.
- `asyncdispatch.drain` now consistently uses the passed timeout value for all
  iterations of the event loop, and not just the first iteration.
  This is more consistent with the other asyncdispatch APIs, and allows
  `asyncdispatch.drain` to be more efficient.
- `base64.encode` and `base64.decode` were made faster by about 50%.
- `htmlgen` adds [MathML](https://wikipedia.org/wiki/MathML) support
  (ISO 40314).
- `macros.eqIdent` is now invariant to export markers and backtick quotes.
- `htmlgen.html` allows `lang` in the `<html>` tag and common valid attributes.
- `macros.basename` and `basename=` got support for `PragmaExpr`,
  so that an expression like `MyEnum {.pure.}` is handled correctly.
- `httpclient.maxredirects` changed from `int` to `Natural`, because negative values
  serve no purpose whatsoever.
- `httpclient.newHttpClient` and `httpclient.newAsyncHttpClient` added `headers`
  argument to set initial HTTP Headers, instead of a hardcoded empty `newHttpHeader()`.
- `parseutils.parseUntil` has now a different behaviour if the `until` parameter is
  empty. This was required for intuitive behaviour of the strscans module
  (see bug #13605).
- `strutils.formatFloat` with `precision = 0` has the same behavior in all
  backends, and it is compatible with Python's behavior,
  e.g. `formatFloat(3.14159, precision = 0)` is now `3`, not `3.`.
- `times.parse` now only uses input to compute its result, and not `now`:
  `parse("2020", "YYYY", utc())` is now `2020-01-01T00:00:00Z` instead of
  `2020-03-02T00:00:00Z` if run on 03-02; it also doesn't crash anymore when
  used on 29th, 30th, 31st of each month.
- `httpcore.==(string, HttpCode)` is now deprecated due to lack of practical
  usage. The `$` operator can be used to obtain the string form of `HttpCode`
  for comparison if desired.
- `std/oswalkdir` was buggy, it's now deprecated and reuses `std/os` procs.
- `net.newContext` now performs SSL Certificate checking on Linux and OSX.
  Define `nimDisableCertificateValidation` to disable it globally.
- `os.walkDir` and `os.walkDirRec` now have new flag, `checkDir` (default: false).
  If it is set to true, it will throw if input dir is invalid instead of a noop
  (which is the default behaviour, as it was before this change),
  `os.walkDirRec` only throws if top-level dir is invalid, but ignores errors for
  subdirs, otherwise it would be impossible to resume iteration.
- The `FD` variant of `selector.unregister` for `ioselector_epoll` and
  `ioselector_select` now properly handle the `Event.User` select event type.
- `joinPath` path normalization when `/` is the first argument works correctly:
  `assert "/" / "/a" == "/a"`. Fixed the edge case: `assert "" / "" == ""`.
- `xmltree` now adds indentation consistently to child nodes for any number
  of children nodes.
- `os.splitPath()` behavior synchronized with `os.splitFile()` to return "/"
  as the dir component of `/root_sub_dir` instead of the empty string.
- The deprecated `lc` macro has been removed from `sugar`. It is now replaced with the
  more powerful `collect` macro.
- `os.relativePath("foo", "foo")` is now `"."`, not `""`, as `""` means invalid
  path and shouldn't be conflated with `"."`; use `-d:nimOldRelativePathBehavior`
  to restore the old behavior.
- `os.joinPath(a, b)` now honors trailing slashes in `b` (or `a` if `b` = "").
- `base64.encode` no longer supports `lineLen` and `newLine`.
  Use `base64.encodeMime` instead.


## Language changes

- An `align` pragma can now be used for variables and object fields, similar
  to the `alignas` declaration modifier in C/C++.
- `=sink` type bound operator is now optional. Compiler can now use combination
  of `=destroy` and `copyMem` to move objects efficiently.
- Unsigned integer operators have been fixed to allow promotion of the first operand.
- Conversions to unsigned integers are unchecked at runtime, imitating earlier Nim
  versions. The documentation was improved to acknowledge this special case.
  See https://github.com/nim-lang/RFCs/issues/175 for more details.
- New syntax for lvalue references: `var b {.byaddr.} = expr` enabled by
  `import std/decls`.
- `var a {.foo.}: MyType = expr` now lowers to `foo(a, MyType, expr)` for
  non-builtin pragmas, enabling things like lvalue references (see `decls.byaddr`).


## Compiler changes

- Generated JS code uses spaces, instead of mixed spaces and tabs.
- The Nim compiler now supports the ``--asm`` command option for easier
  inspection of the produced assembler code.
- The Nim compiler now supports a new pragma called ``.localPassc`` to
  pass specific compiler options to the C(++) backend for the C(++) file
  that was produced from the current Nim module.
- The compiler now inferes "sink parameters". To disable this for a specific routine,
  annotate it with `.nosinks`. To disable it for a section of code, use
  `{.push sinkInference: off.}`...`{.pop.}`.
- The compiler now supports a new switch `--panics:on` that turns runtime
  errors like `IndexError` or `OverflowError` into fatal errors that **cannot**
  be caught via Nim's `try` statement. `--panics:on` can improve the
  runtime efficiency and code size of your program significantly.
- The compiler now warns about inheriting directly from `system.Exception` as
  this is **very bad** style. You should inherit from `ValueError`, `IOError`,
  `OSError` or from a different specific exception type that inherits from
  `CatchableError` and cannot be confused with a `Defect`.
- The error reporting for Nim's effect system has been improved.
- Implicit conversions for `const` behave correctly now, meaning that code like
  `const SOMECONST = 0.int; procThatTakesInt32(SOMECONST)` will be illegal now.
  Simply write `const SOMECONST = 0` instead.
- The `{.dynlib.}` pragma is now required for exporting symbols when making
  shared objects on POSIX and macOS, which make it consistent with the behavior
  on Windows.
- The compiler is now more strict about type conversions concerning proc
  types: Type conversions cannot be used to hide `.raise` effects or side
  effects, instead a `cast` must be used. With the flag `--useVersion:1.0` the
  old behaviour is emulated.
- The Nim compiler now implements a faster way to detect overflows based
  on GCC's `__builtin_sadd_overflow` family of functions. (Clang also
  supports these). Some versions of GCC lack this feature and unfortunately
  we cannot detect this case reliably. So if you get compilation errors like
  "undefined reference to `__builtin_saddll_overflow`" compile your programs
  with `-d:nimEmulateOverflowChecks`.


## Tool changes

- Nimpretty doesn't accept negative indentation argument anymore, because it was
  breaking files.


## Bugfixes

- Fixed "`nimgrep --nocolor` is ignored on posix; should be instead: `--nimgrep --color=[auto]|true|false`"
  ([#7591](https://github.com/nim-lang/Nim/issues/7591))
- Fixed "Runtime index on const array (of converted obj) causes C-compiler error"
  ([#10514](https://github.com/nim-lang/Nim/issues/10514))
- Fixed "windows x86 with vcc compile error with "asmNoStackFrame""
  ([#12298](https://github.com/nim-lang/Nim/issues/12298))
- Fixed "[TODO] regression: Error: Locks requires --threads:on option"
  ([#12330](https://github.com/nim-lang/Nim/issues/12330))
- Fixed "Add --cc option to --help or --fullhelp output"
  ([#12010](https://github.com/nim-lang/Nim/issues/12010))
- Fixed "questionable `csize` definition in `system.nim`"
  ([#12187](https://github.com/nim-lang/Nim/issues/12187))
- Fixed "os.getAppFilename() returns incorrect results on OpenBSD"
  ([#12389](https://github.com/nim-lang/Nim/issues/12389))
- Fixed "HashSet[uint64] slow insertion depending on values"
  ([#11764](https://github.com/nim-lang/Nim/issues/11764))
- Fixed "Differences between compiling 'classic call syntax' vs 'method call syntax' ."
  ([#12453](https://github.com/nim-lang/Nim/issues/12453))
- Fixed "c -d:nodejs --> SIGSEGV: Illegal storage access"
  ([#12502](https://github.com/nim-lang/Nim/issues/12502))
- Fixed "Closure iterator crashes on --newruntime due to "dangling references""
  ([#12443](https://github.com/nim-lang/Nim/issues/12443))
- Fixed "No `=destroy` for elements of closure environments other than for latest devel --gc:destructors"
  ([#12577](https://github.com/nim-lang/Nim/issues/12577))
- Fixed "strutils:formatBiggestFloat() gives different results in JS mode"
  ([#8242](https://github.com/nim-lang/Nim/issues/8242))
- Fixed "Regression (devel): the new `csize_t` definition isn't consistently used, nor tested thoroughly..."
  ([#12597](https://github.com/nim-lang/Nim/issues/12597))
- Fixed "tables.take() is defined only for `Table` and missed for other table containers"
  ([#12519](https://github.com/nim-lang/Nim/issues/12519))
- Fixed "`pthread_key_t` errors on OpenBSD"
  ([#12135](https://github.com/nim-lang/Nim/issues/12135))
- Fixed "newruntime: simple seq pop at ct results in compile error"
  ([#12644](https://github.com/nim-lang/Nim/issues/12644))
- Fixed "[Windows] finish.exe C:\Users\<USERNAME>\.nimble\bin is not in your PATH environment variable."
  ([#12319](https://github.com/nim-lang/Nim/issues/12319))
- Fixed "Error with strformat + asyncdispatch + const"
  ([#12612](https://github.com/nim-lang/Nim/issues/12612))
- Fixed "MultipartData needs $"
  ([#11863](https://github.com/nim-lang/Nim/issues/11863))
- Fixed "Nim stdlib style issues with --styleCheck:error"
  ([#12687](https://github.com/nim-lang/Nim/issues/12687))
- Fixed "new $nimbleDir path substitution yields unexpected search paths"
  ([#12767](https://github.com/nim-lang/Nim/issues/12767))
- Fixed "Regression: inlined procs now get multiple rounds of destructor injection"
  ([#12766](https://github.com/nim-lang/Nim/issues/12766))
- Fixed "newruntime: compiler generates defective code"
  ([#12669](https://github.com/nim-lang/Nim/issues/12669))
- Fixed "broken windows modules path handling because of 'os.relativePath' breaking changes"
  ([#12734](https://github.com/nim-lang/Nim/issues/12734))
- Fixed "for loop tuple syntax not rendered correctly"
  ([#12740](https://github.com/nim-lang/Nim/issues/12740))
- Fixed "Crash when trying to use `type.name[0]`"
  ([#12804](https://github.com/nim-lang/Nim/issues/12804))
- Fixed "Enums should be considered Trivial types in Atomics"
  ([#12812](https://github.com/nim-lang/Nim/issues/12812))
- Fixed "Produce static/const initializations for variables when possible"
  ([#12216](https://github.com/nim-lang/Nim/issues/12216))
- Fixed "Assigning descriminator field leads to internal assert with --gc:destructors"
  ([#12821](https://github.com/nim-lang/Nim/issues/12821))
- Fixed "nimsuggest `use` command does not return all instances of symbol"
  ([#12832](https://github.com/nim-lang/Nim/issues/12832))
- Fixed "@[] is a problem for --gc:destructors"
  ([#12820](https://github.com/nim-lang/Nim/issues/12820))
- Fixed "Codegen ICE in allPathsAsgnResult"
  ([#12827](https://github.com/nim-lang/Nim/issues/12827))
- Fixed "seq[Object with ref and destructor type] doesn't work in old runtime"
  ([#12882](https://github.com/nim-lang/Nim/issues/12882))
- Fixed "Destructor not invoked because it is instantiated too late, old runtime"
  ([#12883](https://github.com/nim-lang/Nim/issues/12883))
- Fixed "The collect macro does not handle if/case correctly"
  ([#12874](https://github.com/nim-lang/Nim/issues/12874))
- Fixed "allow typed/untyped params in magic procs (even if not in stdlib)"
  ([#12911](https://github.com/nim-lang/Nim/issues/12911))
- Fixed "ARC/newruntime memory corruption"
  ([#12899](https://github.com/nim-lang/Nim/issues/12899))
- Fixed "tasyncclosestall.nim still flaky test: Address already in use"
  ([#12919](https://github.com/nim-lang/Nim/issues/12919))
- Fixed "newruntime and computed goto: variables inside the loop are in generated code uninitialised"
  ([#12785](https://github.com/nim-lang/Nim/issues/12785))
- Fixed "osx: dsymutil needs to be called for debug builds to keep debug info"
  ([#12735](https://github.com/nim-lang/Nim/issues/12735))
- Fixed "codegen ICE with ref objects, gc:destructors"
  ([#12826](https://github.com/nim-lang/Nim/issues/12826))
- Fixed "mutable iterator cannot yield named tuples"
  ([#12945](https://github.com/nim-lang/Nim/issues/12945))
- Fixed "parsecfg stores "\r\n" line breaks just as "\n""
  ([#12970](https://github.com/nim-lang/Nim/issues/12970))
- Fixed "db_postgres.getValue issues warning when no rows found"
  ([#12973](https://github.com/nim-lang/Nim/issues/12973))
- Fixed "ARC: Unpacking tuple with seq causes segfault"
  ([#12989](https://github.com/nim-lang/Nim/issues/12989))
- Fixed "ARC/newruntime: strutils.join on seq with only empty strings causes segfault"
  ([#12965](https://github.com/nim-lang/Nim/issues/12965))
- Fixed "regression (1.0.4): `{.push exportc.}` wrongly affects generic instantiations, causing codegen errors"
  ([#12985](https://github.com/nim-lang/Nim/issues/12985))
- Fixed "cdt, crash with --gc:arc, works fine with default gc"
  ([#12978](https://github.com/nim-lang/Nim/issues/12978))
- Fixed "ARC: No indexError thrown on out-of-bound seq access, SIGSEGV instead"
  ([#12961](https://github.com/nim-lang/Nim/issues/12961))
- Fixed "ARC/async: Returning in a try-block results in wrong codegen"
  ([#12956](https://github.com/nim-lang/Nim/issues/12956))
- Fixed "asm keyword is generating wrong output C code when --cc:tcc"
  ([#12988](https://github.com/nim-lang/Nim/issues/12988))
- Fixed "Destructor not invoked"
  ([#13026](https://github.com/nim-lang/Nim/issues/13026))
- Fixed "ARC/newruntime: Adding inherited var ref object to seq with base type causes segfault"
  ([#12964](https://github.com/nim-lang/Nim/issues/12964))
- Fixed "Style check error with JS compiler target"
  ([#13032](https://github.com/nim-lang/Nim/issues/13032))
- Fixed "regression(1.0.4): undeclared identifier: 'readLines'; plus another regression and bug"
  ([#13013](https://github.com/nim-lang/Nim/issues/13013))
- Fixed "regression(1.04) `invalid pragma: since` with nim js"
  ([#12996](https://github.com/nim-lang/Nim/issues/12996))
- Fixed "Sink to MemMove optimization in injectdestructors"
  ([#13002](https://github.com/nim-lang/Nim/issues/13002))
- Fixed "--gc:arc: `catch` doesn't work with exception subclassing"
  ([#13072](https://github.com/nim-lang/Nim/issues/13072))
- Fixed "nim c --gc:arc --exceptions:{setjmp,goto} incorrectly handles raise; `nim cpp --gc:arc` is ok"
  ([#13070](https://github.com/nim-lang/Nim/issues/13070))
- Fixed "typetraits feature request - get subtype of a generic type"
  ([#6454](https://github.com/nim-lang/Nim/issues/6454))
- Fixed "CountTable inconsistencies between keys() and len() after setting value to 0"
  ([#12813](https://github.com/nim-lang/Nim/issues/12813))
- Fixed "{.align.} pragma is not applied if there is a generic field"
  ([#13122](https://github.com/nim-lang/Nim/issues/13122))
- Fixed "ARC, finalizer, allow rebinding the same function multiple times"
  ([#13112](https://github.com/nim-lang/Nim/issues/13112))
- Fixed "`nim doc` treats `export localSymbol` incorrectly"
  ([#13100](https://github.com/nim-lang/Nim/issues/13100))
- Fixed "--gc:arc SIGSEGV (double free?)"
  ([#13119](https://github.com/nim-lang/Nim/issues/13119))
- Fixed "codegen bug with arc"
  ([#13105](https://github.com/nim-lang/Nim/issues/13105))
- Fixed "symbols not defined in the grammar"
  ([#10665](https://github.com/nim-lang/Nim/issues/10665))
- Fixed "[JS] Move is not defined"
  ([#9674](https://github.com/nim-lang/Nim/issues/9674))
- Fixed "[TODO] pathutils.`/` can return invalid AbsoluteFile"
  ([#13121](https://github.com/nim-lang/Nim/issues/13121))
- Fixed "regression(1.04) `nim doc main.nim` generates broken html (no css)"
  ([#12998](https://github.com/nim-lang/Nim/issues/12998))
- Fixed "Wrong supportsCopyMem on string in type section"
  ([#13095](https://github.com/nim-lang/Nim/issues/13095))
- Fixed "Arc, finalizer, out of memory"
  ([#13157](https://github.com/nim-lang/Nim/issues/13157))
- Fixed "`--genscript` messes up nimcache and future nim invocations"
  ([#13144](https://github.com/nim-lang/Nim/issues/13144))
- Fixed "--gc:arc with --exceptions:goto for "nim c" generate invalid c code"
  ([#13186](https://github.com/nim-lang/Nim/issues/13186))
- Fixed "[regression] duplicate member `_i1` codegen bug"
  ([#13195](https://github.com/nim-lang/Nim/issues/13195))
- Fixed "RTree investigations with valgrind for --gc:arc"
  ([#13110](https://github.com/nim-lang/Nim/issues/13110))
- Fixed "relativePath("foo", ".") returns wrong path"
  ([#13211](https://github.com/nim-lang/Nim/issues/13211))
- Fixed "asyncftpclient - problem with welcome.msg"
  ([#4684](https://github.com/nim-lang/Nim/issues/4684))
- Fixed "Unclear error message, lowest priority"
  ([#13256](https://github.com/nim-lang/Nim/issues/13256))
- Fixed "Channel messages are corrupted"
  ([#13219](https://github.com/nim-lang/Nim/issues/13219))
- Fixed "Codegen bug with exportc and case objects"
  ([#13281](https://github.com/nim-lang/Nim/issues/13281))
- Fixed "[bugfix] fix #11590: c compiler warnings silently ignored, giving undefined behavior"
  ([#11591](https://github.com/nim-lang/Nim/issues/11591))
- Fixed "[CI] tnetdial flaky test"
  ([#13132](https://github.com/nim-lang/Nim/issues/13132))
- Fixed "Cross-Compiling with -d:mingw fails to locate compiler under OSX"
  ([#10717](https://github.com/nim-lang/Nim/issues/10717))
- Fixed "`nim doc --project` broken with imports below main project file or duplicate names"
  ([#13150](https://github.com/nim-lang/Nim/issues/13150))
- Fixed "regression: isNamedTuple(MyGenericTuple[int]) is false, should be true"
  ([#13349](https://github.com/nim-lang/Nim/issues/13349))
- Fixed "--gc:arc codegen bug copying objects bound to C structs with missing C struct fields"
  ([#13269](https://github.com/nim-lang/Nim/issues/13269))
- Fixed "write requires conversion to string"
  ([#13182](https://github.com/nim-lang/Nim/issues/13182))
- Fixed "Some remarks to stdlib documentation"
  ([#13352](https://github.com/nim-lang/Nim/issues/13352))
- Fixed "a `check` in unittest generated by template doesn't show actual value"
  ([#6736](https://github.com/nim-lang/Nim/issues/6736))
- Fixed "Implicit return with case expression fails with 'var' return."
  ([#3339](https://github.com/nim-lang/Nim/issues/3339))
- Fixed "Segfault with closure on arc"
  ([#13314](https://github.com/nim-lang/Nim/issues/13314))
- Fixed "[Macro] Crash on malformed case statement with multiple else"
  ([#13255](https://github.com/nim-lang/Nim/issues/13255))
- Fixed "regression: `echo 'discard' | nim c -r -` generates a file '-' ; `-` should be treated specially"
  ([#13374](https://github.com/nim-lang/Nim/issues/13374))
- Fixed "on OSX, debugging (w gdb or lldb) a nim program crashes at the 1st call to `execCmdEx`"
  ([#9634](https://github.com/nim-lang/Nim/issues/9634))
- Fixed "Internal error in getTypeDescAux"
  ([#13378](https://github.com/nim-lang/Nim/issues/13378))
- Fixed "gc:arc mode breaks tuple let"
  ([#13368](https://github.com/nim-lang/Nim/issues/13368))
- Fixed "Nim compiler hangs for certain C/C++ compiler errors"
  ([#8648](https://github.com/nim-lang/Nim/issues/8648))
- Fixed "htmlgen does not support `data-*` attributes"
  ([#13444](https://github.com/nim-lang/Nim/issues/13444))
- Fixed "[gc:arc] setLen will cause string not to be null-terminated."
  ([#13457](https://github.com/nim-lang/Nim/issues/13457))
- Fixed "joinPath("", "") is "/" ; should be """
  ([#13455](https://github.com/nim-lang/Nim/issues/13455))
- Fixed "[CI] flaky test on windows: tests/osproc/texitcode.nim"
  ([#13449](https://github.com/nim-lang/Nim/issues/13449))
- Fixed "Casting to float32 on NimVM is broken"
  ([#13479](https://github.com/nim-lang/Nim/issues/13479))
- Fixed "`--hints:off` doesn't work (doesn't override ~/.config/nim.cfg)"
  ([#8312](https://github.com/nim-lang/Nim/issues/8312))
- Fixed "joinPath("", "") is "/" ; should be """
  ([#13455](https://github.com/nim-lang/Nim/issues/13455))
- Fixed "tables.values is broken"
  ([#13496](https://github.com/nim-lang/Nim/issues/13496))
- Fixed "global user config can override project specific config"
  ([#9405](https://github.com/nim-lang/Nim/issues/9405))
- Fixed "Non deterministic macros and id consistency problem"
  ([#12627](https://github.com/nim-lang/Nim/issues/12627))
- Fixed "try expression doesn't work with return on expect branch"
  ([#13490](https://github.com/nim-lang/Nim/issues/13490))
- Fixed "CI will break every 4 years on feb 28: times doesn't handle leap years properly"
  ([#13543](https://github.com/nim-lang/Nim/issues/13543))
- Fixed "[minor] `nimgrep --word` doesn't work with operators (eg misses  `1 +% 2`)"
  ([#13528](https://github.com/nim-lang/Nim/issues/13528))
- Fixed "`as` is usable as infix operator but its existence and precedence are not documented"
  ([#13409](https://github.com/nim-lang/Nim/issues/13409))
- Fixed "JSON unmarshalling drops seq's items"
  ([#13531](https://github.com/nim-lang/Nim/issues/13531))
- Fixed "os.joinPath returns wrong path when head ends '\' or '/' and tail starts '..'."
  ([#13579](https://github.com/nim-lang/Nim/issues/13579))
- Fixed "Block-local types with the same name lead to bad codegen (sighashes regression)"
  ([#5170](https://github.com/nim-lang/Nim/issues/5170))
- Fixed "tuple codegen error"
  ([#12704](https://github.com/nim-lang/Nim/issues/12704))
- Fixed "newHttpHeaders does not accept repeated headers"
  ([#13573](https://github.com/nim-lang/Nim/issues/13573))
- Fixed "regression: --incremental:on fails on simplest example"
  ([#13319](https://github.com/nim-lang/Nim/issues/13319))
- Fixed "strscan can't get value of last element in format"
  ([#13605](https://github.com/nim-lang/Nim/issues/13605))
- Fixed "hashes_examples crashes with "Bus Error" (unaligned access) on sparc64"
  ([#12508](https://github.com/nim-lang/Nim/issues/12508))
- Fixed "gc:arc bug with re-used `seq[T]`"
  ([#13596](https://github.com/nim-lang/Nim/issues/13596))
- Fixed "`raise CatchableError` is broken with --gc:arc  when throwing inside a proc"
  ([#13599](https://github.com/nim-lang/Nim/issues/13599))
- Fixed "cpp --gc:arc --exceptions:goto fails to raise with discard"
  ([#13436](https://github.com/nim-lang/Nim/issues/13436))
- Fixed "terminal doesn't compile with -d:useWinAnsi"
  ([#13607](https://github.com/nim-lang/Nim/issues/13607))
- Fixed "Parsing "sink ptr T" - region needs to be an object type"
  ([#12757](https://github.com/nim-lang/Nim/issues/12757))
- Fixed "gc:arc + threads:on + closures compilation error"
  ([#13519](https://github.com/nim-lang/Nim/issues/13519))
- Fixed "[ARC] segmentation fault"
  ([#13240](https://github.com/nim-lang/Nim/issues/13240))
- Fixed "times.toDateTime buggy on 29th, 30th and 31th of each month"
  ([#13558](https://github.com/nim-lang/Nim/issues/13558))
- Fixed "Deque misbehaves on VM"
  ([#13310](https://github.com/nim-lang/Nim/issues/13310))
- Fixed "Nimscript listFiles should throw exception when path is not found"
  ([#12676](https://github.com/nim-lang/Nim/issues/12676))
- Fixed "koch boot fails if even an empty config.nims is present in ~/.config/nims/ [devel regression]"
  ([#13633](https://github.com/nim-lang/Nim/issues/13633))
- Fixed "nim doc generates lots of false positive LockLevel warnings"
  ([#13218](https://github.com/nim-lang/Nim/issues/13218))
- Fixed "Arrays are passed by copy to iterators, causing crashes, unnecessary allocations and slowdowns"
  ([#12747](https://github.com/nim-lang/Nim/issues/12747))
- Fixed "Range types always uses signed integer as a base type"
  ([#13646](https://github.com/nim-lang/Nim/issues/13646))
- Fixed "Generate c code cannot compile with recent devel version"
  ([#13645](https://github.com/nim-lang/Nim/issues/13645))
- Fixed "[regression] VM: Error: cannot convert -1 to uint64"
  ([#13661](https://github.com/nim-lang/Nim/issues/13661))
- Fixed "Spurious raiseException(Exception) detected"
  ([#13654](https://github.com/nim-lang/Nim/issues/13654))
- Fixed "gc:arc memory leak"
  ([#13659](https://github.com/nim-lang/Nim/issues/13659))
- Fixed "Error: cannot convert -1 to uint (inside tuples)"
  ([#13671](https://github.com/nim-lang/Nim/issues/13671))
- Fixed "strformat issue with --gc:arc"
  ([#13622](https://github.com/nim-lang/Nim/issues/13622))
- Fixed "astToStr doesn't work inside generics"
  ([#13524](https://github.com/nim-lang/Nim/issues/13524))
- Fixed "oswalkdir.walkDirRec wont return folders"
  ([#11458](https://github.com/nim-lang/Nim/issues/11458))
- Fixed "`echo 'echo 1' | nim c -r -`  silently gives wrong results (nimBetterRun not updated for stdin)"
  ([#13412](https://github.com/nim-lang/Nim/issues/13412))
- Fixed "gc:arc destroys the global variable accidentally."
  ([#13691](https://github.com/nim-lang/Nim/issues/13691))
- Fixed "[minor] sigmatch errors should be sorted, for reproducible errors"
  ([#13538](https://github.com/nim-lang/Nim/issues/13538))
- Fixed "Exception when converting csize to clong"
  ([#13698](https://github.com/nim-lang/Nim/issues/13698))
- Fixed "ARC: variables are no copied on the thread spawn causing crashes"
  ([#13708](https://github.com/nim-lang/Nim/issues/13708))
- Fixed "Illegal distinct seq causes compiler crash"
  ([#13720](https://github.com/nim-lang/Nim/issues/13720))
- Fixed "cyclic seq definition crashes the compiler"
  ([#13715](https://github.com/nim-lang/Nim/issues/13715))
- Fixed "Iterator with openArray parameter make the argument evaluated many times"
  ([#13417](https://github.com/nim-lang/Nim/issues/13417))
- Fixed "net/asyncnet: Unable to access peer's certificate chain"
  ([#13299](https://github.com/nim-lang/Nim/issues/13299))
- Fixed "Accidentally "SIGSEGV: Illegal storage access" error after arc optimizations (#13325)"
  ([#13709](https://github.com/nim-lang/Nim/issues/13709))
- Fixed "Base64 Regression"
  ([#13722](https://github.com/nim-lang/Nim/issues/13722))
- Fixed "A regression (?) with --gc:arc and repr"
  ([#13731](https://github.com/nim-lang/Nim/issues/13731))
- Fixed "Internal compiler error when using the new variable pragmas"
  ([#13737](https://github.com/nim-lang/Nim/issues/13737))
- Fixed "bool conversion produces vcc 2019 warning at cpp compilation stage"
  ([#13744](https://github.com/nim-lang/Nim/issues/13744))
- Fixed "Compiler "does not detect" a type recursion error in the wrong code, remaining frozen"
  ([#13763](https://github.com/nim-lang/Nim/issues/13763))
- Fixed "[minor] regression: `Foo[0.0] is Foo[-0.0]` is now false"
  ([#13730](https://github.com/nim-lang/Nim/issues/13730))
- Fixed "`nim doc` - only whitespace on first line causes segfault"
  ([#13631](https://github.com/nim-lang/Nim/issues/13631))
- Fixed "hashset regression"
  ([#13794](https://github.com/nim-lang/Nim/issues/13794))
- Fixed "`os.getApplFreebsd` could return incorrect paths in the case of a long path"
  ([#13806](https://github.com/nim-lang/Nim/issues/13806))
- Fixed "Destructors are not inherited"
  ([#13810](https://github.com/nim-lang/Nim/issues/13810))
- Fixed "io.readLines AssertionError on devel"
  ([#13829](https://github.com/nim-lang/Nim/issues/13829))
- Fixed "exceptions:goto accidentally reset the variable during exception handling"
  ([#13782](https://github.com/nim-lang/Nim/issues/13782))
2020-04-05 01:29:15 +00:00
ryoon
54b7a6e427 Update to 1.0.2
Changelog:
v1.0.2 - 2019-10-23
Bugfixes

    fixes the --verbosity:2 regression
    Fixed "Fail to compile a file twice under Windows (v1.0 bug)." #12242
    fix nimpretty removing space before pragma
    JS: gensym is stricter for 'this'
    Fixed "VM Assertion Error with newruntime" #12294
    Fixed "Assertion error when running nim check on compiler/nim.nim" #12281
    Fixed "Compiler crash with empty array and generic instantiation with int as parameter" #12264
    Fixed "Regression in JS backend codegen "Error: request to generate code for .compileTime proc"" #12240
    Fix how relativePath handle case sensitiviy
    Fixed "SIGSEGV in compiler when using generic types and seqs" #12336
    Fixed "[1.0.0] weird interaction between import os and casting integer to char on macosx trigger bad codegen" #12291
    VM: no special casing for big endian machines
    Fixed "internal error: environment misses with a simple template inside one of Jester macros" #12323
    nimsuggest: fix tcp socket leak
    nimsuggest: fix tcp socket leak for epc backend
    Fixed "writeFile and write(f, str) skip null bytes on Windows" #12315
    Fixed "Crash in intsets symmetric_difference" #12366
    Fixed "[regression] VM crash when dealing with var param of a proc result" #12244
    fixes a koch regression that made 'koch boot --listcmd' not work anymore
    Fixed "[regression] inconsistent signed int mod operator between runtime, compiletime, and semfold" #12332
    Fixed "Boehm disables interior pointer checking" #12286
    Fixes semCustomPragma when nkSym
    Fixed yield in nkCheckedFieldExpr
    Fixed "randomize() from random not working on JS" #12418
    Fixed "Compiler crash with invalid object variant" #12379
    fix type's case in random.nim
    Fixed "Update docs with a better way to signal unimplemented methods" #10804
    Fixed "Nim language manual, push pragma is not explained well" #10824
    Fixed "[regression] Importing more than one module with same name from different packages produce bad codegen" #12420
    Namespace unittest enums to avoid name conflicts
    Fixed "VM checks unsigned integers for overflow." #12310
    Fixed "line directive is not generated for first line of function definition" #12426

Documentation improvements

    threadpool: fix link in docs (#12258)
    Fix spellings (#12277)
    fix #12278, don't expose internal PCRE documentation
    Fixed "Documentation of quitprocs is wrong" [#12279(https://github.com/nim-lang/Nim/issues/12279)
    Fix typo in docs
    Fix reference to parseSpec proc in readme
    [doc/tut1] removed discard discussion in comments
    Documentation improvements around the db interface
    Easier build instructions for windows - just run build_all.bat.
    fix a few dead links and a missing sentence in documentation
    Macro docs additions
    Updated the code example in the os module to use better grammar.
    Mention "lambdas" and => in the manual
    Better documentation on Garbage Collector
2019-10-30 12:28:48 +00:00
ryoon
6c40e13636 Update to 1.0.0
Changelog:
This is a major release containing nearly 60 commits. Most changes are bug fixes, but this release also includes a couple new features:

    Binaries can now be built and run using the new run command.
    The NimblePkgVersion is now defined so you can easily get the package version in your source code (example).

Some other highlights:

    Temporary files are now kept when the --debug flag is used.
    Fixed dependency resolution issues with "#head" packages (#432 and #672).
    The install command can now take Nim compiler flags via the new --passNim flag.
    Command line arguments are now passed properly to tasks (#633).
    The test command now respects the specified backend (#631).
    The dump command will no longer prompt and now has an implicit -y.
    Fixed bugs with the new nimscript executor (#665).
    Fixed multiple downloads and installs of the same package (#678).
    Nimble init no longer overwrites existing files (#581).
    Fixed incorrect submodule version being pulled when in a non-master branch (#675).
2019-10-04 13:25:23 +00:00
ryoon
918fd977da Update to 0.20.2
Changelog:
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

    Fixed "nimpretty goes crazy with this snippet" (#10295)
    Fixed "nimpretty doesn't trim all whitespace on the right side of an export marker" (#10177)
    Fixed "nimpretty gives invalid indentation to array elements" (#9505)
    Fixed "nimpretty doesn't indent correctly if preceding line ends with ;, { etc" (#10159)
    Fixed "Nimpretty wrong indentation for doc comments" (#10156)
    Fixed "HttpClient Documentation needs Proxy example" (#11281)
    Fixed "nimpretty aligns comment annoyingly" (#9399)
    Fixed "ENDB missing from Docs and TheIndex, remove ENDB from -fullhelp" (#11431)
    Fixed "Nimrod on Documentation generator" (#11460)
    Fixed "nimpretty (de)indents code where it shouldn't" (#11468)
    Fixed "nimpretty adds spaces where it shouldn't" (#11470)
    Fixed "nimpretty formats enums differently based on commas" (#11467)
    Fixed "strutils.rfind start parameter is unecessarily unusual" (#11430)
    Fixed "TinyC is not documented" (#11495)
    Fixed "c2nim missing from 0.20.0" (#11434)
    Fixed "nimsuggest doesn't work unless compiled with -d:danger" (#11482)
    Fixed "random.initRand crashes in Nim 0.20.0 JS backend" (#11450)
    Fixed "0.20.0 fails to bootstrap when passing "-verbosity:2" (or 3) to koch" (#11436)
    Fixed "Destructors lifting doesn't work with inheritance" (#11517)
    Fixed "std/sums missing from TheIndex" (#11543)
    Fixed "sequtils module: link is broken" (#11546)
    Fixed "Case Statement Macros do not work in functions above exported functions." (#11556)
    Fixed "newruntime: internal error when initializing a proc variable" (#11533)
    Fixed "newruntime: error when modifying a sequence" (#11524)
    Fixed "fmod and other math module functions are missing in js mode" (#4630)
    Fixed "Object variants and new runtime" (#11563)
    Fixed "newruntime exceptions" (#11577)
    Fixed "nimpretty is not aware that the next line is a part of the same context" (#11469)
    Fixed "Distinct procs fail to compile" (#11600)
    Fixed "[SharedTables] Error: undeclared identifier: 'defaultInitialSize'" (#11588)
    Fixed "newSeqOfCap is not working in newruntime" (#11098)
    Fixed "nimpretty destroys source with a source code filter" (#11532)
    Fixed "Unexpected behaviour when constructing with result" (#11525)
    Fixed "Regression in 0.20.0: Nested proc using outer scope variable fails to compile" (#11523)
    Fixed "os:standalone Error: redefinition of 'nimToCStringConv' " (#11445)
    Fixed "No ambiguity error on field overloaded by field=" (#11514)
    Fixed "object variants and new runtime part 2" (#11611)
    Fixed "seq Error: unhandled exception: value out of range: 32772 " (#11606)
    Fixed "Compiled binary includes full path to internal nim files" (#11572)
    Fixed "Newruntime: top-level string variable is empty after an array assignment" (#11614)
    Fixed "Newruntime: raise ObjContructor() doesn't compile" (#11628)
    Fixed "Owned ref can be copied and causes double-free" (#11617)
    Fixed "When compiling to JS (in -d:release) output contains toolchain path on dev's machine" (#11545)
    Fixed "wrong unicode string output" (#11618)
    Fixed "unittest "generic instantiation too nested" error" (#11515)
    Fixed "Last read of a var parameter generates sink instead of assignment" (#11633)
    Fixed "const table with proc type does not compile anymore" (#11479)
    Fixed "Can't use offsetOf on object that ends with an UncheckedArray" (#11320)
    Fixed "Newruntime/regression: Bad codegen for inline methods" (#11636)
    Fixed "String or sequences inside a loop are not cleared in each iteration" (#11510)
    Fixed "Nim -v doesn't acknowledge new danger flag" (#11484)
    Fixed "SIGSEGV while compiling when trying to instantiate a case type, that uses an enum with nsage of parts of strutils fails when using -d:useNimRtl" (#8405)
    Fixed "regression(0.20): finally block executed twice in VM" (#11610)
    Fixed "exportc symbol not exported, leading to link error" (#11651)
    Fixed "Render bug: opearatorasses refs across threads" (#7057)
    Fixed "BUG: "varargs[string, $]" calls $ n^2 times instead of n times (n=len(varargs))" (#8316)
    Fixed "Problem with the same name for module and exported type" (#3333)
    Fixed "-gc:go does notles/objects fail with "non-trivial" error..." (#11671)
    Fixed "Regression: parameter default value + typedesc parameter causes compiler crash" (#11660)
    Fixed "newruntime: undetected dangling ref" (#11350)
    Fixed "Newruntime: setLen() not working on sequences of owned refs" (#11530)
    Fixed "Incorrect overflow/underflow error in case statements" (#11551)
    Fixed "cgen preprocessor directive placed after struct declaration" (#11691)
    Fixed "continue in an except Exception as e block crashes the compiler." (#11683)
    Fixed "nimsuggest, nim check segfault when using bindSym and doAssert" (#10901)
    Fixed "Nimpretty issue, multiline string of x length only causes output grow every time." (#11700)
    Fixed "Array indexed by distinct int doesnt work with iterators" (#11715)
2019-07-17 21:56:37 +00:00
ryoon
cf40f8528a Update to 0.20.0
Changelog:
Changes affecting backwards compatibility

    shr is now sign preserving. Use -d:nimOldShiftRight to enable the old behavior globally.

    The isLower, isUpper family of procs in strutils/unicode operating on strings have been deprecated since it was unclear what these do. Note that the much more useful procs that operate on char or Rune are not affected.

    strutils.editDistance has been deprecated, use editdistance.editDistance or editdistance.editDistanceAscii instead.

    The OpenMP parallel iterator `||` now supports any #pragma omp directive and not just #pragma omp parallel for. See OpenMP documentation.

    The default annotation is parallel for, if you used OpenMP without annotation the change is transparent, if you used annotations you will have to prefix your previous annotations with parallel for.

    Furthermore, an overload with positive stepping is available.

    The unchecked pragma was removed, instead use system.UncheckedArray.

    The undocumented #? strongSpaces parsing mode has been removed.

    The not operator is now always a unary operator, this means that code like assert not isFalse(3) compiles.

    getImpl on a var or let symbol will now return the full IdentDefs tree from the symbol declaration instead of just the initializer portion.

    Methods are now ordinary “single” methods, only the first parameter is used to select the variant at runtime. For backwards compatibility use the new --multimethods:on switch.

    Generic methods are now deprecated; they never worked well.

    Compile time checks for integer and float conversions are now stricter. For example, const x = uint32(-1) now gives a compile time error instead of being equivalent to const x = 0xFFFFFFFF'u32.

    Using typed as the result type in templates/macros now means “expression with a type”. The old meaning of typed is preserved as void or no result type at all.

    A bug allowed macro foo(): int = 123 to compile even though a macro has to return a NimNode. This has been fixed.

    With the exception of uint and uint64, conversion to unsigned types are now range checked during runtime.

    Macro arguments of type typedesc are now passed to the macro as NimNode like every other type except static. Use typed for a behavior that is identical in new and old Nim. See the RFC Pass typedesc as NimNode to macros for more details.

Breaking changes in the standard library

    osproc.execProcess now also takes a workingDir parameter.

    std/sha1.secureHash now accepts openArray[char], not string. (Former successful matches should keep working, though former failures will not.)

    options.UnpackError is no longer a ref type and inherits from system.Defect instead of system.ValueError.

    system.ValueError now inherits from system.CatchableError instead of system.Defect.

    The procs parseutils.parseBiggestInt, parseutils.parseInt, parseutils.parseBiggestUInt and parseutils.parseUInt now raise a ValueError when the parsed integer is outside of the valid range. Previously they sometimes raised an OverflowError and sometimes they returned 0.

    The procs parseutils.parseBin, parseutils.parseOct and parseutils.parseHex were not clearing their var parameter number and used to push its value to the left when storing the parsed string into it. Now they always set the value of the parameter to 0 before storing the result of the parsing, unless the string to parse is not valid (then the value of number is not changed).

    streams.StreamObject now restricts its fields to only raise system.Defect, system.IOError and system.OSError. This change only affects custom stream implementations.

    nre’s RegexMatch.{captureBounds,captures}[] no longer return Option or nil/"", respectively. Use the newly added n in p.captures method to check if a group is captured, otherwise you’ll receive an exception.

    nre’s RegexMatch.{captureBounds,captures}.toTable no longer accept a default parameter. Instead uncaptured entries are left empty. Use Table.getOrDefault() if you need defaults.

    nre’s RegexMatch.captures.{items,toSeq} now returns an Option[string] instead of a string. With the removal of nil strings, this is the only way to indicate a missing match. Inside your loops, instead of capture == "" or capture == nil, use capture.isSome to check if a capture is present, and capture.get to get its value.

    nre’s replace() no longer throws ValueError when the replacement string has missing captures. It instead throws KeyError for named captures, and IndexError for unnamed captures. This is consistent with RegexMatch.{captureBounds,captures}[].

    splitFile now correctly handles edge cases, see #10047.

    isNil is no longer false for undefined in the JavaScript backend: now it’s true for both nil and undefined. Use isNull or isUndefined if you need exact equality: isNil is consistent with ===, isNull and isUndefined with ==.

    several deprecated modules were removed: ssl, matchers, httpserver, unsigned, actors, parseurl

    two poorly documented and not used modules (subexes, scgi) were moved to graveyard (they are available as Nimble packages)

    procs string.add(int) and string.add(float) which implicitly convert ints and floats to string have been deprecated. Use string.addInt(int) and string.addFloat(float) instead.

    case object branch transitions via system.reset are deprecated. Compile your code with -d:nimOldCaseObjects for a transition period.

    base64 module: The default parameter newLine for the encode procs was changed from "\13\10" to the empty string "".

Breaking changes in the compiler

    The compiler now implements the “generic symbol prepass” for when statements in generics, see bug #8603. This means that code like this does not compile anymore:

proc enumToString*(enums: openArray[enum]): string =
  # typo: 'e' instead 'enums'
  when e.low.ord >= 0 and e.high.ord < 256:
    result = newString(enums.len)
  else:
    result = newString(enums.len * 2)

    discard x is now illegal when x is a function symbol.

    Implicit imports via --import: module in a config file are now restricted to the main package.

Library additions

    There is a new stdlib module std/editdistance as a replacement for the deprecated strutils.editDistance.

    There is a new stdlib module std/wordwrap as a replacement for the deprecated strutils.wordwrap.

    Added split, splitWhitespace, size, alignLeft, align, strip, repeat procs and iterators to unicode.nim.

    Added or for NimNode in macros.

    Added system.typeof for more control over how type expressions can be deduced.

    Added macros.isInstantiationOf for checking if the proc symbol is instantiation of generic proc symbol.

    Added the parameter isSorted for the sequtils.deduplicate proc.

    Added os.relativePath.

    Added parseopt.remainingArgs.

    Added os.getCurrentCompilerExe (implemented as getAppFilename at CT), can be used to retrieve the currently executing compiler.

    Added xmltree.toXmlAttributes.

    Added std/sums module for fast summation functions.

    Added Rusage, getrusage, wait4 to the posix interface.

    Added the posix_utils module.

    Added system.default.

    Added sequtils.items for closure iterators, allows closure iterators to be used by the mapIt, filterIt, allIt, anyIt, etc.

Library changes

    The string output of macros.lispRepr proc has been tweaked slightly. The dumpLisp macro in this module now outputs an indented proper Lisp, devoid of commas.

    Added macros.signatureHash that returns a stable identifier derived from the signature of a symbol.

    In strutils empty strings now no longer match as substrings.

    The Complex type is now a generic object and not a tuple anymore.

    The ospaths module is now deprecated, use os instead. Note that os is available in a NimScript environment but unsupported operations produce a compile-time error.

    The parseopt module now supports a new flag allowWhitespaceAfterColon (default value: true) that can be set to false for better Posix interoperability. (Bug #9619.)

    os.joinPath and os.normalizePath handle edge cases like "a/b/../../.." differently.

    securehash was moved to lib/deprecated.

    The switch -d:useWinAnsi is not supported anymore.

    In times module, procs format and parse accept a new optional DateTimeLocale argument for formatting/parsing dates in other languages.

Language additions

    Vm support for float32<->int32 and float64<->int64 casts was added.
    There is a new pragma block noSideEffect that works like the gcsafe pragma block.
    added os.getCurrentProcessId.
    User defined pragmas are now allowed in the pragma blocks.
    Pragma blocks are no longer eliminated from the typed AST tree to preserve pragmas for further analysis by macros.
    Custom pragmas are now supported for var and let symbols.
    Tuple unpacking is now supported for constants and for loop variables.
    Case object branches can be initialized with a runtime discriminator if possible discriminator values are constrained within a case statement.

Language changes

    The standard extension for SCF (source code filters) files was changed from .tmpl to .nimf, it’s more recognizable and allows tools like Github to recognize it as Nim, see #9647. The previous extension will continue to work.

    Pragma syntax is now consistent. Previous syntax where type pragmas did not follow the type name is now deprecated. Also pragma before generic parameter list is deprecated to be consistent with how pragmas are used with a proc. See #8514 and #1872 for further details.

    Hash sets and tables are initialized by default. The explicit initHashSet, initTable, etc. are not needed anymore.

Tool changes

    jsondoc now includes a moduleDescription field with the module description. jsondoc0 shows comments as its own objects as shown in the documentation.
    nimpretty: –backup now defaults to off instead of on and the flag was undocumented; use git instead of relying on backup files.
    koch now defaults to build the latest stable Nimble version unless you explicitly ask for the latest master version via --latest.

Compiler changes

    The deprecated fmod proc is now unavailable on the VM.
    A new --outdir option was added.
    The compiled JavaScript file for the project produced by executing nim js will no longer be placed in the nimcache directory.
    The --hotCodeReloading has been implemented for the native targets. The compiler also provides a new more flexible API for handling the hot code reloading events in the code.
    The compiler now supports a --expandMacro:macroNameHere switch for easy introspection into what a macro expands into.
    The -d:release switch now does not disable runtime checks anymore. For a release build that also disables runtime checks use -d:release -d:danger or simply -d:danger.

Bugfixes

    Fixed “distinct generic typeclass not treated as distinct” (#4435)
    Fixed “multiple dynlib pragmas with function calls conflict with each other causing link time error” (#9222)
    Fixed “[RFC] extractFilename("usr/lib/") should return “lib” (not “”) and be called baseName (since works with dirs)” (#8341)
    Fixed “\0 in comment replaced with 0 in docs” (#8841)
    Fixed “round function in Math library sometimes doesn’t work” (#9082)
    Fixed “Async readAll in httpclient produces garbled output.” (#8994)
    Fixed “[regression] project config.nims not being read anymore” (#9264)
    Fixed “Using iterator within another iterator fails” (#3819)
    Fixed “nim js -o:dirname main.nim writes nothing, and no error shown” (#9154)
    Fixed “Wrong number of deallocations when using destructors” (#9263)
    Fixed “devel docs in nim-lang.github.io Source links point to master instead of devel” (#9295)
    Fixed “compiler/nimeval can’t be used twice: fails 2nd time with: Error: internal error: n is not nil” (#9180)
    Fixed “Codegen bug with exportc” (#9297)
    Fixed “Regular Expressions: replacing empty patterns only works correctly in nre” (#9306)
    Fixed “Openarray: internal compiler error when accessing length if not a param” (#9281)
    Fixed “finish completely removing web folder” (#9304)
    Fixed “counting the empty substring in a string results in infinite loop” (#8919)
    Fixed “[Destructors] Wrong moves and copies” (#9294)
    Fixed “proc isNil*(x: Any): bool = should be updated with non nil string, seq” (#8916)
    Fixed “doAssert AST expansion excessive” (#8518)
    Fixed “when Foo (of type iterator) is used where an expression is expected, show useful err msg instead of confusing Error: attempting to call undeclared routine Foo” (#8671)
    Fixed “List comprehensions do not work with generic parameter” (#5707)
    Fixed “strutils/isUpperAscii and unicode/isUpper consider space, punctuations, numbers as “lowercase”” (#7963)
    Fixed “Regular Expressions: replacing empty patterns only works correctly in nre” (#9306)
    Fixed “BUG: os.isHidden doesn’t work with directories; should use just paths, not filesystem access” (#8225)
    Fixed “Unable to create distinct tuple in a const with a type declaration” (#2760)
    Fixed “[nimpretty] raw strings are transformed into normal strings” (#9236)
    Fixed “[nimpretty] proc is transfered to incorrect code” (#8626)
    Fixed “[nimpretty] Additional new line is added with each format” (#9144)
    Fixed ““%NIM%/config/nim.cfg” is not being read” (#9244)
    Fixed “Illegal capture on async proc (except when the argument is seq)” (#2361)
    Fixed “Jsondoc0 doesn’t output module comments.” (#9364)
    Fixed “NimPretty has troubles with source code filter” (#9384)
    Fixed “tfragment_gc test is flaky on OSX” (#9421)
    Fixed “ansi color code templates fail to bind symbols” (#9394)
    Fixed “Term write rule crash compiler.” (#7972)
    Fixed “SIGSEGV when converting lines to closure iterator, most likely caused by defer” (#5321)
    Fixed “SIGSEGV during the compile” (#5519)
    Fixed “Compiler crash when creating a variant type” (#6220)
    Fixed ““continue” inside a block without loops gives “SIGSEGV: Illegal storage access. (Attempt to read from nil?)”” (#6367)
    Fixed “old changelogs should be kept instead of erased” (#9376)
    Fixed “illegal recursion with generic typeclass” (#4674)
    Fixed “Crash when closing an unopened file on debian 8.” (#9456)
    Fixed “nimpretty joins regular and doc comment” (#9400)
    Fixed “nimpretty changes indentation level of trailing comment” (#9398)
    Fixed “Some bugs with nimpretty” (#8078)
    Fixed “Computed gotos: bad codegen, label collision with if/statement in the while body” (#9276)
    Fixed “nimpretty not idempotent: keeps adding newlines below block comment” (#9483)
    Fixed “nimpretty shouldn’t format differently whether there’s a top-level newline” (#9484)
    Fixed “Regression: 0.18 code with mapIt() fails to compile on 0.19” (#9093)
    Fixed “nimpretty shouldn’t change file modif time if no changes => use os.updateFile” (#9499)
    Fixed “Nim/compiler/pathutils.nim(226, 12) canon"/foo/../bar" == "/bar" [AssertionError]” (#9507)
    Fixed “nimpretty adds a space before type, ptr, ref, object in wrong places” (#9504)
    Fixed “nimpretty badly indents block comment” (#9500)
    Fixed “typeof: Error: illformed AST: typeof(myIter(), typeOfIter)” (#9498)
    Fixed “newAsyncSmtp() raises exception with Nim 0.19.0” (#9358)
    Fixed “nimpretty wrongly adds empty newlines inside proc signature” (#9506)
    Fixed “HttpClient: requesting URL with no scheme fails” (#7842)
    Fixed “Duplicate definition in cpp codegen” (#6986)
    Fixed “Sugar - distinctBase: undeclared identifier uncheckedArray” (#9532)
    Fixed “Portable fsmonitor” (#6718)
    Fixed “Small RFC. Minimal stacktrace for Exceptions when frames are disabled” (#9434)
    Fixed “nim doc strutils.nim fails on 32 bit compiler with AssertionError on a RunnableExample” (#9525)
    Fixed “Error: undeclared identifier: ‘|’” (#9540)
    Fixed “using Selectors, Error: undeclared field: ‘OSErrorCode’” (#7667)
    Fixed “The “–” template from module nimscript mis-translates “out” key” (#6011)
    Fixed “logging error should go to stderr instead of stdout” (#9547)
    Fixed “when in generic should fail earlier” (#8603)
    Fixed “C++ codegen error when iterating in finally block in topmost scope” (#5549)
    Fixed “document nim --nep1:on” (#9564)
    Fixed “C++ codegen error when iterating in finally block in topmost scope” (#5549)
    Fixed “strutils.multiReplace() crashes if search string is “”” (#9557)
    Fixed “Missing docstrings are replaced with other text” (#9169)
    Fixed “Type which followed by a function and generated by a template will not shown in docs generated by nim doc” (#9235)
    Fixed “templates expand doc comments as documentation of other procedures” (#9432)
    Fixed “please implement http put and delete in httpClient” (#8777)
    Fixed “Module docs: 2 suggestions…” (#5525)
    Fixed “math.hypot under/overflows” (#9585)
    Fixed “=sink gets called on result when not used explicitly” (#9594)
    Fixed “Treat compl as a c++ keyword” (#6836)
    Fixed “Path in error message has ..\..\..\..\..\ prefix since 0.19.0” (#9556)
    Fixed “nim check gives SIGSEGV: Illegal storage access ; maybe because of sizeof” (#9610)
    Fixed “Cannot use a typedesc variable in a template” (#9611)
    Fixed “=sink gets called on result when not used explicitly” (#9594)
    Fixed “[NimScript] Error: arguments can only be given if the ‘–run’ option is selected” (#9246)
    Fixed “macros.getTypeImpl regression, crash when trying to query type information from ref object” (#9600)
    Fixed “[Regression] Complex.re and Complex.im are private” (#9639)
    Fixed “nim check: internal error: (filename: "vmgen.nim", line: 1119, column: 19)” (#9609)
    Fixed “optInd missing indent specification in grammar.txt” (#9608)
    Fixed “not as prefix operator causes problems” (#9574)
    Fixed “It is not possible to specify a pragma for the proc that returns lent T” (#9633)
    Fixed “Compiler crash when initializing table with module name” (#9319)
    Fixed “compiler crash” (#8335)
    Fixed ““SIGSEGV” without any “undeclared identifier” error” (#8011)
    Fixed “Incorrect parseopt parsing ?” (#9619)
    Fixed “Operator or causes a future to be completed more than once” (#8982)
    Fixed “Nimpretty adds instead of removes incorrect spacing inside backticks” (#9673)
    Fixed “nimpretty should hardcode indentation amount to 2 spaces” (#9502)
    Fixed “callSoon() is not working prior getGlobalDispatcher().” (#7192)
    Fixed “use nimf as standardized extention for nim files with source code filter?” (#9647)
    Fixed “Banning copy for a type prevents composing” (#9692)
    Fixed “smtp module doesn’t support threads.” (#9728)
    Fixed “Compiler segfault (stack overflow) compiling code on 0.19.0 that works on 0.18.0” (#9694)
    Fixed “nre doesn’t document quantifiers re"foo{2,4}"” (#9470)
    Fixed “ospaths still referenced despite its deprecation” (#9671)
    Fixed “move on dereferenced pointer results in bogus value” (#9743)
    Fixed “regression in discard statement” (#9726)
    Fixed “try statements and exceptions do not cooperate well” (#96)
    Fixed “XDeclaredButNotUsed doesn’t work with template, let/var/const, type; works with all other routine nodes” (#9764)
    Fixed “ Warning: fun is deprecated doesn’t check whether deprecated overload is actually used” (#9759)
    Fixed “Regression: tuple sizeof is incorrect if contains imported object” (#9794)
    Fixed “Internal error when calling =destroy without declaration” (#9675)
    Fixed “Internal error if =sink is used explictly” (#7365)
    Fixed “unicode.strip behaving oddly” (#9800)
    Fixed “X_examples.nim generated by runnableExamples should show line number where they came from” (#8289)
    Fixed “quit() fails with “unreachable statement after ‘return’”” (#9832)
    Fixed “quit() fails with “unreachable statement after ‘return’”” (#9832)
    Fixed “Error: internal error: genLiteral: ty is nil when a var is accessed in quote do” (#9864)
    Fixed “Regression: sizeof Error: cannot instantiate: ‘T’” (#9868)
    Fixed “Using a template as a routine pragma no longer works” (#9614)
    Fixed “Clang error on Rosencrantz” (#9441)
    Fixed “Enum fields get hintXDeclaredButNotUsed hint even when marked with used pragma” (#9896)
    Fixed “internal error: environment misses” (#9476)
    Fixed “SIGSEGV: setLen on a seq doesn’t construct objects at CT” (#9872)
    Fixed “Latest HEAD segfaults when compiling Aporia” (#9889)
    Fixed “Unnecessary semicolon in error message” (#9907)
    Fixed “koch temp c t.nim tries to look up t.nim in nim install directory (alongside koch)” (#9913)
    Fixed “Regression: sizeof Error: cannot instantiate: ‘T’” (#9868)
    Fixed “Showstopper regression: Nimscript no longer works “ (#9965)
    Fixed “Global imports in cfg file broken” (#9978)
    Fixed “Global imports in cfg file broken” (#9978)
    Fixed “Regression - Nim compiler shows all gcc commands used when config.nims present” (#9982)
    Fixed “[regression] Nimscript makes a program slower and more bloated” (#9995)
    Fixed “Regression in Nimscript projectDir() behavior, returns empty string” (#9985)
    Fixed “Global imports don’t work for non-std modules” (#9994)
    Fixed “Object constructor regression in JS backend” (#10005)
    Fixed “Regression: nimble install fails on nim devel” (#9991)
    Fixed “Another config.nims regression” (#9989)
    Fixed “nim js -d:nodejs main.nim gives: system.nim(1443, 7) Error: cannot 'importc' variable at compile time with a config.nims” (#9153)
    Fixed “how to profile? using --profiler:on causes: Error: undeclared identifier: ‘framePtr’” (#8991)
    Fixed “nim doc fail on lib/system/profiler.nim” (#9420)
    Fixed “[regression] ./koch tests: Error: overloaded ‘readFile’ leads to ambiguous calls (with ~/.config/nim/config.nims)” (#9120)
    Fixed “regression: normalizePath(“foo/..”) now incorrectly returns "", should be "." like before + in almost all other languages” (#10017)
    Fixed “Incorrect ‘not all cases are covered’ when using enums with nonconsecutive items” (#3060)
    Fixed “[ospaths] BUG: splitFile(“/a.txt”).dir = “” ; + other bugs with splitFile” (#8255)
    Fixed “GC bug: seems very slow where it shouldn’t; maybe it leaks?” (#10040)
    Fixed “Closure bug with the JS backend” (#7048)
    Fixed “Error: unhandled exception: sym is not accessible [FieldError]” (#10058)
    Fixed “with --errorMax:100 ; link step should not be attempted if previous step failed” (#9933)
    Fixed “import os or ospaths compilation error in js” (#10066)
    Fixed “Example for system.$[T: tuple | object] is misleading” (#7898)
    Fixed “Combining object variants and inheritance leads to SIGSEGV during compilation” (#10033)
    Fixed “Regression in distros.nim (foreignDep fails to compile)” (#10024)
    Fixed “Testament megatest fails with Nim not found” (#10049)
    Fixed “XDeclaredButNotUsed shows redundant info: declaration location shown twice” (#10101)
    Fixed “Nim beginner’s feedback: “echo type(1)” does not work” (#5827)
    Fixed “sizeof still broken with regard to bitsize/packed bitfields” (#10082)
    Fixed “Codegen init regression” (#10148)
    Fixed “toInt doesn’t raise an exception” (#2764)
    Fixed “allow import inside block: makes N runnableExamples run N x faster, minimizes scope pollution” (#9300)
    Fixed “Extra procs & docs for the unicode module” (#2353)
    Fixed “regression: CI failing Error: unhandled exception: cannot open: /Users/travis/.cache/nim/docgen_sample_d/runnableExamples/docgen_sample_examples.nim [IOError]” (#10188)
    Fixed “getAddrInfo index out of bounds error” (#10198)
    Fixed “can’t build a tuple with static int element” (#10073)
    Fixed “nimpretty creates foo.nim.backup for foo.nims” (#10211)
    Fixed “regression caused by WEXITSTATUS: nim cpp compiler/nim.nim fails on OSX” (#10231)
    Fixed “travis and appveyor should move the bulk of its logic to running a nim file” (#10041)
    Fixed “Error: undeclared field: 'foo' should show type (+ where type is defined) (hard to guess in generic code)” (#8794)
    Fixed “Discrepancy in Documentation About ‘f128 Type-Suffix” (#10213)
    Fixed “Incorrect error message” (#10251)
    Fixed “CI should call ./koch tools ; right now nimfind isn’t even being compiled” (#10039)
    Fixed “Building koch from nim devel fails when config.nims importing os present” (#10030)
    Fixed “unittest module uses programResult to report number of failures which can wrap” (#10261)
    Fixed “Nimscript doesn’t raise any exceptions” (#10240)
    Fixed “{.push raises: [].} breaks when combined with certain symbols” (#10216)
    Fixed “Support “#.” for auto-enumerated lists in RST docs” (#8158)
    Fixed “OpenSSL error breaking nimble and every package” (#10281)
    Fixed “execShellCmd returns 0 instead of nonzero when child process exits with signal (eg SIGSEGV)” (#10273)
    Fixed “nim check (and nim c –errorMax:0) SIGSEGV on first index out of bounds error” (#10104)
    Fixed “Module db_sqlite doesn’t finalize statements with db_sqlite.rows after breaking the iterator’s loop” (#7241)
    Fixed “Performance regression with –gc:markandsweep” (#10271)
    Fixed “internal error when using typedesc is comparison in a macro” (#10136)
    Fixed “cannot call template/macros with varargs[typed] to varargs[untyped]” (#10075)
    Fixed “nim v0.13.0 breaks symbol lookup in quote block” (#3744)
    Fixed “Some nimgrep issues” (#989)
    Fixed “Safecall problem?” (#9218)
    Fixed “Nim script is not supporting reading from stdin.” (#3983)
    Fixed “Parameter constraints: undeclared identifier ‘{}’ within a template scope” (#7524)
    Fixed “repr does not work with ‘var openarray’ parameter in function” (#7878)
    Fixed “CountTable raisen error instead of returning a count of 0” (#10065)
    Fixed “nim c -r main.nim foo1 "" foo3 doesn’t handle empty params or params w quotes” (#9842)
    Fixed “refs #10249 ; more debug info to diagnose failures” (#10266)
    Fixed “ObjectAssignmentError for aliased types” (#10203)
    Fixed “nim cpp treats Nan as 0.0 (during compile time)” (#10305)
    Fixed “terminal.nim colored output is not GCSAFE.” (#8294)
    Fixed “Building koch from nim devel fails when config.nims importing os present” (#10030)

    Fixed “every binary cmd line option should allow on/off switch” (#9629)
    Fixed “Wrong bounds check using template [] to access array in a const object” (#3899)
    Fixed “tdont_be_stupid.nim flaky test” (#10386)
    Fixed “Separate nim install guide for users and packagers” (#5182)
    Fixed “–embedsrc does not work on macos” (#10263)
    Fixed “Devel regression on static semcheck” (#10339)
    Fixed “vccexe.exe does not work without VS2015 x64 Native Tools command prompt.” (#10358)
    Fixed “ospaths still referenced despite its deprecation” (#9671)
    Fixed “Regression in sequtils” (#10433)
    Fixed “Path in error message has ..\..\..\..\..\ prefix since 0.19.0” (#9556)
    Fixed ““contributing” is listed as a module on theindex” (#10287)
    Fixed “const Foo=int compiles; is that legal? what does it mean?” (#8610)
    Fixed “parsecsv can’t handle empty lines at the beginning of the file” (#8365)
    Fixed “Generated c code is not compile with the vcc cl.exe before 2012 after v0.19” (#10352)
    Fixed “[Regression] converter to string leads fail to compile on 0.19” (#9149)
    Fixed “regression: memory leak with default GC” (#10488)
    Fixed “oids counter starts at zero; spec says it should be random” (#2796)
    Fixed “re quantifier{ under-documented” (#9471)
    Fixed “Minor issues in docs regarding keywords” (#9725)
    Fixed “Explained the proc "pretty" in detail, file: json.nim with comments and sample program” (#10466)
    Fixed “net.recvFrom address is always “0.0.0.0” for ipv6” (#7634)
    Fixed “import “path with space/bar.nim” gives error msg with wrong file name” (#10042)
    Fixed “Deprecation warnings for enum values print twice” (#8063)
    Fixed “Undefined behaviour in the usage of incrSeqV3” (#10568)
    Fixed “SetMaxPoolSize not heeded” (#10584)
    Fixed “CI broken: tests/macros/t8997.nim fails” (#10591)
    Fixed “prevent common user config to interfere with testament” (#10573)
    Fixed “static: writeFile doesn’t work anymore since system refactorings” (#10585)
    Fixed “export statement doesn’t support directories” (#6227)
    Fixed “https://nim-lang.github.io/Nim/io.html gives 404” (#10586)
    Fixed “Choosenim fails with “ambiguous call” in rst.nim” (#10602)
    Fixed “Enable experimental feature with command line argument has no effect.” (#10606)
    Fixed “Comparing function pointer with nil marks the proc as not gcsafe” (#6955)
    Fixed “httpclient.timeout not exported” (#10357)
    Fixed “nim check SIGSEGV (causing nimsuggest to fail too)” (#10547)
    Fixed “index out of bounds errors should show index and bound” (#9880)
    Fixed “Enable experimental feature with command line argument has no effect.” (#10606)
    Fixed “Comparing function pointer with nil marks the proc as not gcsafe” (#6955)
    Fixed “httpclient.timeout not exported” (#10357)
    Fixed “nim check SIGSEGV (causing nimsuggest to fail too)” (#10547)
    Fixed “certain seq manipulations fail when compiled to JS” (#10651)
    Fixed “system.insert does not work with strings in VM” (#10561)
    Fixed “Doc suggestion: include a link to theindex.html on …” (#5515)
    Fixed “koch boot fails on windows with choosenim-installed nim: proxyexe.nim error” (#10659)
    Fixed “getImpl on type symbol hides implementation” (#10702)
    Fixed “Missing stdlib modules” (#8164)
    Fixed “No “correct” way to declare inheritable ref object” (#10195)
    Fixed “Line number missing in stdlib trace” (#6832)
    Fixed “Better support for modifying XmlNodes” (#3797)
    Fixed “No documentation of AsyncStreams” (#6383)
    Fixed “set[ in proc definition crashes compiler” (#10678)
    Fixed “net.bindAddr fails binding to all interfaces if address == "" for ipv6” (#7633)
    Fixed “Tuple unpacking of for vars fails inside generic proc” (#10727)
    Fixed “initSet should be called initHashSet” (#10730)
    Fixed “inheritable placement not symmetric between object and ref object” (#3012)
    Fixed “Alloc functions have side effects, makes it hard to use side effect tracking with destructors” (#9746)
    Fixed “hashes:hash returns different values on Windows/Linux” (#10771)
    Fixed “switch(“cpu”, “i386”) with –cc:vcc doesn’t work when it is written on *.nims” (#10387)
    Fixed “async call now treated as non-gc safed call?” (#10795)
    Fixed “{.borrow.} hangs compiler on non-distinct type (should produce an error or warning)” (#10791)
    Fixed “DCE regression: modules can’t be eliminated” (#10703)
    Fixed “Unsafeaddr rendered as addr in typed AST “ (#10807)
    Fixed “Rendering of return statements in typed AST” (#10805)
    Fixed “Assigning shallow string to a field makes a copy” (#10845)
    Fixed “func keyword for proc types doesn’t imply noSideEffect” (#10838)
    Fixed “SPAN.attachedType in toc should have no width” (#10857)
    Fixed “[docgen] Generic type pragmas in wrong place” (#10792)
    Fixed “os.joinPaths documentation is inaccurate; should reference uri.combine” (#10836)
    Fixed ““invalid indentation” when assigning macro with code block to const” (#10861)
    Fixed “Nim crashes with SIGABRT after getting into a replaceTypeVars infinite loop.” (#10884)
    Fixed “Booleans Work Wrong in Compile-time” (#10886)
    Fixed “C / CPP backends differ in argument evaluation order” (#8202)
    Fixed “Change in syntax breaks valid code” (#10896)
    Fixed “auto return type in macros causes internal error” (#10904)
    Fixed “Nim string definition conflicts with other C/C++ instances” (#10907)
    Fixed “nim check crash with invalid code, lowest priority” (#10930)
    Fixed “nim check crash due to typing error, lowest priority” (#10934)
    Fixed “Stacktrace displayed two times” (#10922)
    Fixed “Cpp codegen regression. Showstopper” (#10948)
    Fixed “lent T can return garbage” (#10942)
    Fixed “Regression. atomicInc doesn’t compile with vcc and i386” (#10953)
    Fixed “{.pure.} has no effect on objects” (#10721)
    Fixed “nimpretty doesn’t put space around operators like a<b => a < b” (#10200)
    Fixed “nimpretty messes alignment, after import statement” (#9811)
    Fixed “Destructor regression for tuples unpacking” (#10940)
    Fixed “Link error when a module defines a global variable and has no stacktrace” (#10943)
    Fixed “std/json fails to escape most non-printables, breaking generation and parsing” (#10541)
    Fixed “rst/markdown parser can’t handle extra parentheses after link” (#10475)
    Fixed “Random: proc rand(x: HSlice) requires substraction” (#7698)
    Fixed “Bug in setTerminate()” (#10765)
    Fixed “ICE when using –newruntime with proc returning tuple” (#11004)
    Fixed “terminal.nim does not compile using –newruntime” (#11005)
    Fixed “Casting a seq to another seq generates invalid code with –newruntime” (#11018)
    Fixed “strformat/fmt doesn’t work for custom types [regression]” (#11012)
    Fixed “Casting a seq to another seq generates invalid code with –newruntime” (#11018)
    Fixed “newruntime - t.destructor != nil [AssertionError] with toTable()” (#11014)
    Fixed “templates (e.g. sequtils.toSeq) often shadow result” (#10732)
    Fixed “newruntime: Error: system module needs: NimStringDesc when calling $ inside method on an object variant” (#11048)
    Fixed “newruntime: internal error when iterating over seq (which is a field of an object) inside methods” (#11050)
    Fixed “Error: internal error: ‘=destroy’ operator not found for type owned Node” (#11053)
    Fixed “new output can be assigned to an unowned ref” (#11073)
    Fixed “Illegal storage access when adding to a ref seq” (#11065)
    Fixed “strformat float printing doesn’t print “.0” portion [regression]” (#11089)
    Fixed “nim doc2 ignores –docSeeSrcUrl parameter” (#6071)
    Fixed “runnableExamples + forLoop = segfault” (#11078)
    Fixed “destructible context without ‘result’ or ‘return’ should also be supported” (#1192)
    Fixed “new Obj crashes at the end of the program on newruntime” (#11082)
    Fixed “Documentation of the modules broken out of system.nim are missing “ (#10972)
    Fixed “DFA regression. Branches of AST trees are missed in control flow graph.” (#11095)
    Fixed “[Regression] nkIdentDefs can be left in vmgen” (#11111)
    Fixed “JS target does not prevent calling compileTime procs” (#11133)
    Fixed “rand can return invalid values of a range type” (#11015)
    Fixed “compiler crash on discard void” (#7470)
    Fixed “Unowned ref can trivially escape without causing any crashes” (#11114)
    Fixed “Destructor lifting regression” (#11149)
    Fixed “const alias to compile time function fails.” (#11045)
    Fixed “Using type instead of typedesc in template signature fails compilation” (#11058)
    Fixed “Compiler error caused by quote do: else” (#11175)
    Fixed “cast to non ptr UncheckedArray does not produce an error or warning” (#9403)
    Fixed “openArray generates incorrect C code with “incomplete type”” (#9578)
    Fixed “os:standalone Error: system module needs: appendString” (#10978)
    Fixed “gensym regression” (#10192)
    Fixed “new: module names need to be unique per Nimble broken on Windows” (#11196)
    Fixed “Compiler crash on cfsml bindings” (#11200)
    Fixed “Newruntime: compileTime variables can cause compilation to fail due to destructor injections” (#11204)
    Fixed “object self-assignment order-of-evaluation broken” (#9844)
    Fixed “seq self-assignment order-of-evaluation broken” (#9684)
    Fixed “Compiler crash with generic types and static generic parameters” (#7569)
    Fixed “C macro identifiers (e.g. errno) are not properly avoided in code generation” (#11153)
    Fixed “SIGSEGV in asgnRefNoCycle with const sequence” (#9825)
    Fixed “asyncdispatch could not be linked to nimrtl” (#6855)
    Fixed “Newruntime: Bad C++ codegen for ref types with destructors” (#11215)
    Fixed “Better error message for object variant with enum that is below it” (#4140)
    Fixed “Can’t declare a mixin.” (#11237)
    Fixed “Nim doc mangles signed octal literals” (#11131)
    Fixed “Selectors, Error: undeclared field: ‘OSErrorCode’ on macOS” (#11124)
    Fixed “--cppCompileToNamespace:foo fails compilation with import os” (#11194)
    Fixed “[OpenMP] Nim symbol interpolation support” (#9365)
    Fixed “Inconsistent typing error with gensymed var” (#7937)
    Fixed “New module names break file-specific flags” (#11202)
    Fixed “inheritance for generics does not work” (#88)
    Fixed “Possible bug related to generics type resolution/matched” (#6732)
    Fixed “static range type bounds not checked when conversion from intLit” (#3766)
    Fixed “threadpool: sync() deadlocks in high-CPU-usage scenarios” (#11250)
    Fixed “var result array - bad codegen (null pointer dereference)” (#8053)
    Fixed “future/sugar => syntax breaks with generics” (#7816)
    Fixed “os.joinPath removes the leading backslash from UNC paths (regression)” (#10952)
    Fixed “re: memory leak when calling re proc repeatedly” (#11139)
    Fixed “threadpool: tests/parallel/tconvexhull.nim segfaults intermittently on systems with more than 4 cores” (#11275)
    Fixed “Not equal when streams.readBool and peekBool compare true” (#11049)
    Fixed “os.tailDir fails on some paths” (#8395)
    Fixed “Power op ^ is not optimized for a: int; echo a ^ 2 case (minor bug)” (#10910)
    Fixed “str &= data doesn’t behave as str = str & data.” (#10963)
    Fixed “Unable to make a const instance of an inherited, generic object.” (#11268)
    Fixed “Overload precedence for non-builtin types” (#11239)
    Fixed “Error when trying to iterate a distinct type based array” (#7167)
    Fixed “Objects marked with {.exportc.} should be fully defined in generated header” (#4723)
    Fixed “Generic function specialization regression” (#6076)
    Fixed “compiler should give ambiguity errors in case of multiple compatible matches” (#8568)
    Fixed “xmltree.findAll doesn’t work as expected with htmlparser for non-lowercase names” (#8329)
    Fixed “wrong stack trace information about the raised exception” (#11309)
    Fixed “Newruntime: owned procs don’t implicitly convert to unowned in ==” (#11257)
    Fixed “order of imports can cause errors” (#11187)
    Fixed “Passing code via stdin to Nim stopped working [regression Nim 0.19+]” (#11294)
    Fixed “”–out:” switch is ineffective with “nim doc” [regression]” (#11312)
    Fixed “VC++ broken in devel: module machine type ‘X86’ conflicts with target machine type ‘x64’” (#11306)
    Fixed “Code that used multi aspect of multimethod now crashes at runtime” (#10912)
    Fixed “symbol resolution issues when ambiguous call happens in generic proc” (#11188)
    Fixed “compile pragma name collision” (#10299)
    Fixed “Unexpected behaviour on method dispatch” (#10038)
    Fixed “Nim object variant issue” (#1286)
    Fixed “json.to macro cannot handle ambiguous types even in a full form (module.Type)” (#11057)
    Fixed “Out of bounds access in CritBitTree” (#11344)
    Fixed “Newruntime: assignment to discriminant field in case objects not supported” (#11205)
    Fixed “Dynamic dispatch broken if base method returns generic var type” (#6777)
    Fixed “newruntime and unused generics: compiler crash” (#6755)
    Fixed “Type aliases do not work with Exceptions.” (#10889)
    Fixed “Compiler crash when accessing constant in nested template” (#5235)
    Fixed “unicode.nim Error: type mismatch: got <seq[char]> but expected ‘string’” (#9762)
    Fixed “Internal error with auto return in closure iterator” (#5859)
    Fixed “[Compiler Crash] - getAST + hasCustomPragma” (#7615)
    Fixed “debug mode compiler crash when executing some compile time code” (#8199)
    Fixed “Compiler does not set .typ inside macros when creating literal NimNodes” (#7792)
    Fixed “Error: internal error: expr: var not init sevColor_994035” (#8573)
    Fixed “internal error: could not find env param for when one iterator references another” (#9827)
    Fixed “internal error when assigning a type to a constant of typedesc” (#9961)
    Fixed “Overload resolution regression” (#11375)
    Fixed “strutils: toBin(64) uses ‘/’ for the 63rd bit if it’s set” (#11369)
    Fixed “base64.encode should not “prettify” the result by default” (#11364)
    Fixed “Nim ships latest nimble rather than stable” (#11402)
    Fixed “debugger:native no longer generates pdb file with cc:vcc” (#11405)
2019-06-15 01:29:49 +00:00
ryoon
2c09397919 Update to 0.19.6
Changelog:
Bugfixes

    Fixed “32 bit signed xor broken on VM” (#10482)
    Fixed “SetMaxPoolSize not heeded” (#10584)
    Fixed “uint inplace add in if branch is omitted when compiled to JS” (#10697)
    Fixed “Booleans Work Wrong in Compile-time” (#10886)
    Fixed “Bug in setTerminate()” (#10765)
    Fixed “Cannot raise generic exception” (#7845)
    Fixed “Nim string definition conflicts with other C/C++ instances” (#10907)
    Fixed “std/json fails to escape most non-printables, breaking generation and parsing” (#10541)
    Fixed “object self-assignment order-of-evaluation broken” (#9844)
    Fixed “Compiler crash with generic types and static generic parameters” (#7569)
2019-05-16 14:11:52 +00:00
ryoon
9eab040d9a Update to 0.19.4
Changelog:
0.19.4
Bugfixes

    Fixed “Latest HEAD segfaults when compiling Aporia” (#9889)
    Fixed “smtp module doesn’t support threads.” (#9728)
    Fixed “toInt doesn’t raise an exception” (#2764)
    Fixed “allow import inside block: makes N runnableExamples run N x faster, minimizes scope pollution” (#9300)
    Fixed “regression: CI failing Error: unhandled exception: cannot open: /Users/travis/.cache/nim/docgen_sample_d/runnableExamples/docgen_sample_examples.nim [IOError]” (#10188)
    Fixed “Discrepancy in Documentation About ‘f128 Type-Suffix” (#10213)
    Fixed “Performance regression with –gc:markandsweep” (#10271)
    Fixed “cannot call template/macros with varargs[typed] to varargs[untyped]” (#10075)
    Fixed “–embedsrc does not work on macos” (#10263)
    Fixed “terminal.nim colored output is not GCSAFE.” (#8294)
    Fixed “Path in error message has ..\..\..\..\..\ prefix since 0.19.0” (#9556)
    Fixed ““contributing” is listed as a module on theindex” (#10287)
    Fixed “[Regression] converter to string leads fail to compile on 0.19” (#9149)
    Fixed “oids counter starts at zero; spec says it should be random” (#2796)

0.19.2
Compiler changes

    Added support for the RISC-V 64 bit architecture named riscv64 (e.g. HiFive)

Bugfixes

    Fixed “Nim 0.19.0 docs have incorrect Source/Edit links” (#9083)
    Fixed “Json: compilation fails with aliased type” (#9111)
    Fixed “https://nim-lang.org/docs/nre.html gives 404 error” (#9119)
    Fixed “Leaving \\ at the end of a path in copyDir removes every file’s first char” (#9126)
    Fixed “nim doc SIGSEGV: Illegal storage access.” (#9140)
    Fixed “[doc] List of broken links in the doc site” (#9109)
    Fixed “Fix incorrect examples in nre docs” (#9053)
    Fixed “Clean up root of repo and release archives” (#4934)
    Fixed “Concept/converter/generics-related compiler crash” (#7351)
    Fixed “converter + concept causes compiler to quit without error” (#6249)
    Fixed “Error: internal error” (#6533)
    Fixed “Methods break static[T] (internal error: nesting too deep)” (#5479)
    Fixed “Memory error when checking if a variable is a string in concept” (#7092)
    Fixed “Internal error when using array of procs” (#5015)
    Fixed “[Regression] Compiler crash on proc with static, used to compile in nim 0.16” (#5868)
    Fixed “fixes/8099” (#8451)
    Fixed “distinct generic typeclass not treated as distinct” (#4435)
    Fixed “multiple dynlib pragmas with function calls conflict with each other causing link time error” (#9222)
    Fixed “\0 in comment replaced with 0 in docs” (#8841)
    Fixed “Async readAll in httpclient produces garbled output.” (#8994)
    Fixed “runnableExamples should be run by nim doc even if symbol is not public” (#9216)
    Fixed “[regression] project config.nims not being read anymore” (#9264)
    Fixed “Using iterator within another iterator fails” (#3819)
    Fixed “nim js -o:dirname main.nim writes nothing, and no error shown” (#9154)
    Fixed “devel docs in nim-lang.github.io Source links point to master instead of devel” (#9295)
    Fixed “Regular Expressions: replacing empty patterns only works correctly in nre” (#9306)
    Fixed “counting the empty substring in a string results in infinite loop” (#8919)
    Fixed “[nimpretty] raw strings are transformed into normal strings” (#9236)
    Fixed “[nimpretty] proc is transfered to incorrect code” (#8626)
    Fixed “[nimpretty] Additional new line is added with each format” (#9144)
    Fixed ““%NIM%/config/nim.cfg” is not being read” (#9244)
    Fixed “Illegal capture on async proc (except when the argument is seq)” (#2361)
    Fixed “Jsondoc0 doesn’t output module comments.” (#9364)
    Fixed “NimPretty has troubles with source code filter” (#9384)

    Fixed “tfragment_gc test is flaky on OSX” (#9421)
    Fixed “ansi color code templates fail to bind symbols” (#9394)
    Fixed “SIGSEGV when converting lines to closure iterator, most likely caused by defer” (#5321)
    Fixed “Compiler crash when creating a variant type” (#6220)

    Fixed “old changelogs should be kept instead of erased” (#9376)
    Fixed “Crash when closing an unopened file on debian 8.” (#9456)
    Fixed “nimpretty joins regular and doc comment” (#9400)
    Fixed “nimpretty changes indentation level of trailing comment” (#9398)
    Fixed “Some bugs with nimpretty” (#8078)
    Fixed “nimpretty not idempotent: keeps adding newlines below block comment” (#9483)
    Fixed “nimpretty shouldn’t format differently whether there’s a top-level newline” (#9484)
    Fixed “nimpretty shouldn’t change file modif time if no changes => use os.updateFile” (#9499)
    Fixed “nimpretty adds a space before type, ptr, ref, object in wrong places” (#9504)
    Fixed “nimpretty badly indents block comment” (#9500)
    Fixed “nimpretty wrongly adds empty newlines inside proc signature” (#9506)
    Fixed “Duplicate definition in cpp codegen” (#6986)
    Fixed “nim doc strutils.nim fails on 32 bit compiler with AssertionError on a RunnableExample” (#9525)

    Fixed “using Selectors, Error: undeclared field: ‘OSErrorCode’” (#7667)
    Fixed “strutils.multiReplace() crashes if search string is “”” (#9557)
    Fixed “Type which followed by a function and generated by a template will not shown in docs generated by nim doc” (#9235)
    Fixed “Module docs: 2 suggestions…” (#5525)
    Fixed “Missing docstrings are replaced with other text” (#9169)
    Fixed “templates expand doc comments as documentation of other procedures” (#9432)
    Fixed “Path in error message has ..\..\..\..\..\ prefix since 0.19.0” (#9556)

    Fixed “Nim/compiler/pathutils.nim(226, 12) canon"/foo/../bar" == "/bar" [AssertionError]” (#9507)
    Fixed “[Regression] Borrow stringify operator no longer works as expected” (#9322)
    Fixed “[NimScript] Error: arguments can only be given if the ‘–run’ option is selected” (#9246)
    Fixed “nim check: internal error: (filename: "vmgen.nim", line: 1119, column: 19)” (#9609)
    Fixed “optInd missing indent specification in grammar.txt” (#9608)
    Fixed “nimpretty should hardcode indentation amount to 2 spaces” (#9502)
    Fixed “Nimpretty adds instead of removes incorrect spacing inside backticks” (#9673)
    Fixed “Compiler segfault (stack overflow) compiling code on 0.19.0 that works on 0.18.0” (#9694)
2019-05-11 07:13:42 +00:00
ryoon
9ff16a98cc Update to 0.19
Changelog:
What’s new in 0.19.0

The nil state for strings/seqs is gone. Instead the default value for these is "" / @[]. Use --nilseqs:on for a transition period. This eliminates a large class of bugs that used to plague the average Nim code out there, including Nim’s standard library.

Accessing the binary zero terminator in Nim’s native strings is now invalid. Internally a Nim string still has the trailing zero for zero-copy interoperability with cstring. Compile your code with the new switch --laxStrings:on if you need a transition period.

These changes to strings and seqs give us more flexibility in how they are implemented and indeed alternative implementations are in development.

experimental is now a pragma and a command line switch that can enable specific language extensions, it is not an all-or-nothing switch anymore. We think this leads to a more robust development process where it’s clearly documented which parts of Nim are bleeding edge and which parts can be relied upon.

Other notable language additions:

    Dot calls combined with explicit generic instantiations can now be written as x.y[:z] which is transformed into y[z](x) by the parser.
    func is now an alias for proc {.noSideEffect.}.

    Anonymous tuples with a single element can now be written as (1,) with a trailing comma.

    In order to make for loops and iterators more flexible to use Nim now supports so called “for-loop macros”. See the manual for more details. This feature enables a Python-like generic enumerate implementation.

    Case statements can now be rewritten via macros. See the manual for more information. This feature enables custom pattern matching.

    The command syntax now supports keyword arguments after the first comma.

    Thread-local variables can now be declared inside procs. This implies all the effects of the global pragma.

    Nim now supports the except clause in the export statement.
    Range float types, example range[0.0 .. Inf]. More details in language manual.

Breaking changes to be mindful of

    The default location of nimcache for the native code targets was changed. Read the compiler user guide for more information.
    Lots of deprecated symbols in the standard library that have been deprecated for quite some time now like system.expr or the old type aliases starting with a T or P prefix have been removed.
    The exception hierarchy was slightly reworked, SystemError was renamed to CatchableError and is the new base class for any exception that is guaranteed to be catchable. This change should have minimal impact on most existing Nim code.

Async improvements

The “closure iterators” that Nim’s async macro is based on has been rewritten from the ground up and so async works completely with exception handling. Finally it is possible to use await in a try statement!
Nimble 0.9.0

This release includes a brand new version of Nimble. The new version contains a breaking change which you should read up on if you own hybrid packages. There are also the usual bug fixes and this release contains a lot of them.
2018-10-01 12:50:42 +00:00
ryoon
a9e261bc9c Update to 0.18.0
Changelog:
0.18.0:
Changes affecting backwards compatibility
Breaking changes in the standard library

    The [] proc for strings now raises an IndexError exception when the specified slice is out of bounds. See issue #6223 for more details. You can use substr(str, start, finish) to get the old behaviour back, see this commit for an example.

    strutils.split and strutils.rsplit with an empty string and a separator now returns that empty string. See issue #4377.

    Arrays of char cannot be converted to cstring anymore, pointers to arrays of char can! This means $ for arrays can finally exist in system.nim and do the right thing. This means $myArrayOfChar changed its behaviour! Compile with -d:nimNoArrayToString to see where to fix your code.

    reExtended is no longer default for the re constructor in the re module.

    The behavior of $ has been changed for all standard library collections. The collection-to-string implementations now perform proper quoting and escaping of strings and chars.

    newAsyncSocket taking an AsyncFD now runs setBlocking(false) on the fd.

    mod and bitwise and do not produce range subtypes anymore. This turned out to be more harmful than helpful and the language is simpler without this special typing rule.

    formatFloat/formatBiggestFloat now support formatting floats with zero precision digits. The previous precision = 0 behavior (default formatting) is now available via precision = -1.
    Moved from stdlib into Nimble packages:
        basic2d deprecated: use glm, arraymancer, neo, or another package instead
        basic3d deprecated: use glm, arraymancer, neo, or another package instead
        gentabs
        libuv
        polynumeric
        pdcurses
        romans
        libsvm
        joyent_http_parser

    Proc toCountTable now produces a CountTable with values correspoding to the number of occurrences of the key in the input. It used to produce a table with all values set to 1.

    Counting occurrences in a sequence used to be:

    let mySeq = @[1, 2, 1, 3, 1, 4]
    var myCounter = initCountTable[int]()

    for item in mySeq:
      myCounter.inc item

    Now, you can simply do:

    let
      mySeq = @[1, 2, 1, 3, 1, 4]
      myCounter = mySeq.toCountTable()

    If you use --dynlibOverride:ssl with OpenSSL 1.0.x, you now have to define openssl10 symbol (-d:openssl10). By default OpenSSL 1.1.x is assumed.

    newNativeSocket is now named createNativeSocket.

    newAsyncNativeSocket is now named createAsyncNativeSocket and it no longer raises an OS error but returns an osInvalidSocket when creation fails.

    The securehash module is now deprecated. Instead import std / sha1.
    The readPasswordFromStdin proc has been moved from the rdstdin to the terminal module, thus it does not depend on linenoise anymore.

Breaking changes in the compiler

    \n is now only the single line feed character like in most other programming languages. The new platform specific newline escape sequence is written as \p. This change only affects the Windows platform.

    The overloading rules changed slightly so that constrained generics are preferred over unconstrained generics. (Bug #6526)

    We changed how array accesses “from backwards” like a[^1] or a[0..^1] are implemented. These are now implemented purely in system.nim without compiler support. There is a new “heterogenous” slice type system.HSlice that takes 2 generic parameters which can be BackwardsIndex indices. BackwardsIndex is produced by system.^. This means if you overload [] or []= you need to ensure they also work with system.BackwardsIndex (if applicable for the accessors).

    The parsing rules of if expressions were changed so that multiple statements are allowed in the branches. We found few code examples that now fail because of this change, but here is one:

    t[ti] = if exp_negative: '-' else: '+'; inc(ti)

    This now needs to be written as:

    t[ti] = (if exp_negative: '-' else: '+'); inc(ti)

    The experimental overloading of the dot . operators now take an untyped parameter as the field name, it used to be a static[string]. You can use when defined(nimNewDot) to make your code work with both old and new Nim versions. See special-operators for more information.

    yield (or await which is mapped to yield) never worked reliably in an array, seq or object constructor and is now prevented at compile-time.

Library additions

    Added sequtils.mapLiterals for easier construction of array and tuple literals.

    Added system.runnableExamples to make examples in Nim’s documentation easier to write and test. The examples are tested as the last step of nim doc.

    Implemented getIoHandler proc in the asyncdispatch module that allows you to retrieve the underlying IO Completion Port or Selector[AsyncData] object in the specified dispatcher.

    For string formatting / interpolation a new module called strformat has been added to the stdlib.

    The ReadyKey type in the selectors module now contains an errorCode field to help distinguish between Event.Error events.

    Implemented an accept proc that works on a SocketHandle in nativesockets.

    Added algorithm.rotateLeft.

    Added typetraits.$ as an alias for typetraits.name.

    Added system.getStackTraceEntries that allows you to access the stack trace in a structured manner without string parsing.

    Added parseutils.parseSaturatedNatural.

    Added macros.unpackVarargs.

    Added support for asynchronous programming for the JavaScript backend using the asyncjs module.

    Added true color support for some terminals. Example:

    import colors, terminal

    const Nim = "Efficient and expressive programming."

    var
      fg = colYellow
      bg = colBlue
      int = 1.0

    enableTrueColors()

    for i in 1..15:
      styledEcho bgColor, bg, fgColor, fg, Nim, resetStyle
      int -= 0.01
      fg = intensity(fg, int)

    setForegroundColor colRed
    setBackgroundColor colGreen
    styledEcho "Red on Green.", resetStyle

Library changes

    echo now works with strings that contain \0 (the binary zero is not shown) and nil strings are equal to empty strings.

    JSON: Deprecated getBVal, getFNum, and getNum in favour of getBool, getFloat, getBiggestInt. A new getInt procedure was also added.

    rationals.toRational now uses an algorithm based on continued fractions. This means its results are more precise and it can’t run into an infinite loop anymore.

    os.getEnv now takes an optional default parameter that tells getEnv what to return if the environment variable does not exist.

    The random procs in random.nim have all been deprecated. Instead use the new rand procs. The module now exports the state of the random number generator as type Rand so multiple threads can easily use their own random number generators that do not require locking. For more information about this rename see issue #6934

    writeStackTrace is now proclaimed to have no IO effect (even though it does) so that it is more useful for debugging purposes.

    db_mysql module: DbConn is now a distinct type that doesn’t expose the details of the underlying PMySQL type.

    parseopt2 is now deprecated, use parseopt instead.

Language additions

    It is now possible to forward declare object types so that mutually recursive types can be created across module boundaries. See package level objects for more information.

    Added support for casting between integers of same bitsize in VM (compile time and nimscript). This allows to, among other things, reinterpret signed integers as unsigned.

    Custom pragmas are now supported using pragma pragma, please see language manual for details.

    Standard library modules can now also be imported via the std pseudo-directory. This is useful in order to distinguish between standard library and nimble package imports:

    import std / [strutils, os, osproc]
    import someNimblePackage / [strutils, os]

Language changes

    The unary < is now deprecated, for .. < use ..< for other usages use the pred proc.

    Bodies of for loops now get their own scope:

    # now compiles:
    for i in 0..4:
      let i = i + 1
      echo i

    To make Nim even more robust the system iterators .. and countup now only accept a single generic type T. This means the following code doesn’t die with an “out of range” error anymore:

    var b = 5.Natural
    var a = -5
    for i in a..b:
      echo i

    atomic and generic are no longer keywords in Nim. generic used to be an alias for concept, atomic was not used for anything.

    The memory manager now uses a variant of the TLSF algorithm that has much better memory fragmentation behaviour. According to http://www.gii.upv.es/tlsf/ the maximum fragmentation measured is lower than 25%. As a nice bonus alloc and dealloc became O(1) operations.

    The compiler is now more consistent in its treatment of ambiguous symbols: Types that shadow procs and vice versa are marked as ambiguous (bug #6693).

    codegenDecl pragma now works for the JavaScript backend. It returns an empty string for function return type placeholders.

    Extra semantic checks for procs with noreturn pragma: return type is not allowed, statements after call to noreturn procs are no longer allowed.
    Noreturn proc calls and raising exceptions branches are now skipped during common type deduction in if and case expressions. The following code snippets now compile:

    import strutils
    let str = "Y"
    let a = case str:
      of "Y": true
      of "N": false
      else: raise newException(ValueError, "Invalid boolean")
    let b = case str:
      of nil, "": raise newException(ValueError, "Invalid boolean")
      elif str.startsWith("Y"): true
      elif str.startsWith("N"): false
      else: false
    let c = if str == "Y": true
      elif str == "N": false
      else:
        echo "invalid bool"
        quit("this is the end")

    Pragmas now support call syntax, for example: {.exportc"myname".} and {.exportc("myname").}

    The deprecated pragma now supports a user-definable warning message for procs.

    proc bar {.deprecated: "use foo instead".} =
      return

    bar()

Tool changes

    The nim doc command is now an alias for nim doc2, the second version of the documentation generator. The old version 1 can still be accessed via the new nim doc0 command.

    Nim’s rst2html command now supports the testing of code snippets via an RST extension that we called :test:::

    .. code-block:: nim
        :test:
      # shows how the 'if' statement works
      if true: echo "yes"


0.17.0:
Changes affecting backwards compatibility

    There are now two different HTTP response types, Response and AsyncResponse. AsyncResponse’s body accessor returns a Future[string]!

    Due to this change you may need to add another await in your code.
    httpclient.request now respects the maxRedirects option. Previously redirects were handled only by get and post procs.
    The IO routines now raise EOFError for the “end of file” condition. EOFError is a subtype of IOError and so it’s easier to distinguish between “error during read” and “error due to EOF”.
    A hash procedure has been added for cstring type in hashes module. Previously, hash of a cstring would be calculated as a hash of the pointer. Now the hash is calculated from the contents of the string, assuming cstring is a null-terminated string. Equal string and cstring values produce an equal hash value.
    Macros accepting varargs arguments will now receive a node having the nkArgList node kind. Previous code expecting the node kind to be nkBracket may have to be updated.
    memfiles.open now closes file handles/fds by default. Passing allowRemap=true to memfiles.open recovers the old behavior. The old behavior is only needed to call mapMem on the resulting MemFile.
    posix.nim: For better C++ interop the field sa_sigaction*: proc (x: cint, y: var SigInfo, z: pointer) {.noconv.} was changed to sa_sigaction*: proc (x: cint, y: ptr SigInfo, z: pointer) {.noconv.}.
    The compiler doesn’t infer effects for .base methods anymore. This means you need to annotate them with .gcsafe or similar to clearly declare upfront every implementation needs to fullfill these contracts.
    system.getAst templateCall(x, y) now typechecks the templateCall properly. You need to patch your code accordingly.
    macros.getType and macros.getTypeImpl for an enum will now return an AST that is the same as what is used to define an enum. Previously the AST returned had a repeated EnumTy node and was missing the initial pragma node (which is currently empty for an enum).
    macros.getTypeImpl now correctly returns the implementation for a symbol of type tyGenericBody.
    If the dispatcher parameter’s value used in multi method is nil, a NilError exception is raised. The old behavior was that the method would be a nop then.
    posix.nim: the family of ntohs procs now takes unsigned integers instead of signed integers.
    In Nim identifiers en-dash (Unicode point U+2013) is not an alias for the underscore anymore. Use underscores instead.
    When the requiresInit pragma is applied to a record type, future versions of Nim will also require you to initialize all the fields of the type during object construction. For now, only a warning will be produced.
    The Object construction syntax now performs a number of additional safety checks. When fields within case objects are initialiazed, the compiler will now demand that the respective discriminator field has a matching known compile-time value.
    On posix, the results of waitForExit, peekExitCode, execCmd will return 128 + signal number if the application terminates via signal.
    ospaths.getConfigDir now conforms to the XDG Base Directory specification on non-Windows OSs. It returns the value of the XDG_CONFIG_DIR environment variable if it is set, and returns the default configuration directory, “~/.config/”, otherwise.
    Renamed the line info node parameter for newNimNode procedure.

    The parsing rules of do changed.

      foo bar do:
        baz

    Used to be parsed as:

      foo(bar(do:
        baz))

    Now it is parsed as:

      foo(bar, do:
        baz)

Library Additions

    Added system.onThreadDestruction.

    Added dial procedure to networking modules: net, asyncdispatch, asyncnet. It merges socket creation, address resolution, and connection into single step. When using dial, you don’t have to worry about the IPv4 vs IPv6 problem. httpclient now supports IPv6.

    Added to macro which allows JSON to be unmarshalled into a type.

      import json

      type
        Person = object
          name: string
          age: int

      let data = """
        {
          "name": "Amy",
          "age": 4
        }
      """

      let node = parseJson(data)
      let obj = node.to(Person)
      echo(obj)

Tool Additions

    The finish tool can now download MingW for you should it not find a working MingW installation.

Compiler Additions

    The name mangling rules used by the C code generator changed. Most of the time local variables and parameters are not mangled at all anymore. This improves the debugging experience.
    The compiler produces explicit name mangling files when --debugger:native is enabled. Debuggers can read these .ndi files in order to improve debugging Nim code.

Language Additions

    The try statement’s except branches now support the binding of a caught exception to a variable:

        try:
          raise newException(Exception, "Hello World")
        except Exception as exc:
          echo(exc.msg)

    This replaces the getCurrentException and getCurrentExceptionMsg() procedures, although these procedures will remain in the stdlib for the foreseeable future. This new language feature is actually implemented using these procedures.

    In the near future we will be converting all exception types to refs to remove the need for the newException template.
    A new pragma .used can be used for symbols to prevent the “declared but not used” warning. More details can be found here.

    The popular “colon block of statements” syntax is now also supported for let and var statements and assignments:

      template ve(value, effect): untyped =
        effect
        value

      let x = ve(4):
        echo "welcome to Nim!"

    This is particularly useful for DSLs that help in tree construction.

Language changes

    The .procvar annotation is not required anymore. That doesn’t mean you can pass system.$ to map just yet though.
2018-04-03 03:24:56 +00:00
wiz
3e75f0aaa2 Add HOMEPAGE. Prefer INSTALLATION_DIRS to AUTO_MKDIRS.
Fix pkglint warning.
2017-02-22 21:22:10 +00:00
kamil
e8a7461fbd Update nim from 0.14.2 to 0.16.0
Upstream changelog
==================

Changelog 0.16.0
Changes affecting backwards compatibility

    staticExec now uses the directory of the nim file that contains the staticExec call as the current working directory.
    TimeInfo.tzname has been removed from times module because it was broken. Because of this, the option "ZZZ" will no longer work in format strings for formatting and parsing.

Library Additions

    Added new parameter to error proc of macro module to provide better error message
    Added new deques module intended to replace queues. deques provides a superset of queues API with clear naming. queues module is now deprecated and will be removed in the future.
    Added hideCursor, showCursor, terminalWidth, terminalWidthIoctl and terminalSize to the terminal (doc) module.
    Added new module distros (doc) that can be used in Nimble packages to aid in supporting the OS's native package managers.

Tool Additions
Compiler Additions

    The C/C++ code generator has been rewritten to use stable name mangling rules. This means that compile times for edit-compile-run cycles are much reduced.

Language Additions

    The emit pragma now takes a list of Nim expressions instead of a single string literal. This list can easily contain non-strings like template parameters. This means emit works out of the box with templates and no new quoting rules needed to be introduced. The old way with backtick quoting is still supported but will be deprecated.

type Vector* {.importcpp: "std::vector", header: "<vector>".}[T] = object

template `[]=`*[T](v: var Vector[T], key: int, val: T) =
  {.emit: [v, "[", key, "] = ", val, ";"].}

proc setLen*[T](v: var Vector[T]; size: int) {.importcpp: "resize", nodecl.}
proc `[]`*[T](v: var Vector[T], key: int): T {.importcpp: "(#[#])", nodecl.}

proc main =
  var v: Vector[float]
  v.setLen 1
  v[0] = 6.0
  echo v[0]

    The import statement now supports importing multiple modules from the same directory:

import compiler / [ast, parser, lexer]

Is a shortcut for:

import compiler / ast, compiler / parser, compiler / lexer

Bugfixes

The list below has been generated based on the commits in Nim's git repository. As such it lists only the issues which have been closed via a commit, for a full list see this link on Github.

    Fixed "staticRead and staticExec have different working directories" (#4871)
    Fixed "CountTable doesn't support the '==' operator" (#4901)
    Fixed "documentation for module sequtls apply proc" (#4386)
    Fixed "Operator == for CountTable does not work." (#4946)
    Fixed "sysFatal (IndexError) with parseUri and the / operator" (#4959)
    Fixed "initialSize parameter does not work in OrderedTableRef" (#4940)
    Fixed "error proc from macro library could have a node parameter" (#4915)
    Fixed "Segfault when comparing OrderedTableRef with nil" (#4974)
    Fixed "Bad codegen when comparing isNil results" (#4975)
    Fixed "OrderedTable cannot delete entry with empty string or 0 key" (#5035)
    Fixed "Deleting specific keys from ordered table leaves it in invalid state." (#5057)
    Fixed "Paths are converted to lowercase on Windows" (#5076)
    Fixed "toTime(getGMTime(...)) doesn't work correctly when local timezone is not UTC" (#5065)
    Fixed "out of memory error from test= type proc call when parameter is a call to a table's [] proc" (#5079)
    Fixed "Incorrect field order in object construction" (#5055)
    Fixed "Incorrect codegen when importing nre with C++ backend (commit 8494338)" (#5081)
    Fixed "Templates, {.emit.}, and backtick interpolation do not work together" (#4730)
    Fixed "Regression: getType fails in certain cases" (#5129)
    Fixed "CreateThread doesn't accept functions with generics" (#43)
    Fixed "No instantiation information when template has error" (#4308)
    Fixed "realloc leaks" (#4818)
    Fixed "Regression: getType" (#5131)
    Fixed "Code generation for generics broken by sighashes" (#5135)
    Fixed "Regression: importc functions are not declared in generated C code" (#5136)
    Fixed "Calling split("") on string hangs program" (#5119)
    Fixed "Building dynamic library: undefined references (Linux)" (#4775)
    Fixed "Bad codegen for distinct + importc - sighashes regression" (#5137)
    Fixed "C++ codegen regression: memset called on a result variable of importcpp type" (#5140)
    Fixed "C++ codegen regression: using channels leads to broken C++ code" (#5142)
    Fixed "Ambiguous call when overloading var and non-var with generic type" (#4519)
    Fixed "[Debian]: build.sh error: unknown processor: aarch64" (#2147)
    Fixed "RFC: asyncdispatch.poll behaviour" (#5155)
    Fixed "Can't access enum members through alias (possible sighashes regression)" (#5148)
    Fixed "Type, declared in generic proc body, leads to incorrect codegen (sighashes regression)" (#5147)
    Fixed "Compiler SIGSEGV when mixing method and proc" (#5161)
    Fixed "Compile-time SIGSEGV when declaring .importcpp method with return value " (#3848)
    Fixed "Variable declaration incorrectly parsed" (#2050)
    Fixed "Invalid C code when naming a object member "linux"" (#5171)
    Fixed "[Windows] MinGW within Nim install is missing libraries" (#2723)
    Fixed "async: annoying warning for future.finished" (#4948)
    Fixed "new import syntax doesn't work?" (#5185)
    Fixed "Fixes #1994" (#4874)
    Fixed "Can't tell return value of programs with staticExec" (#1994)
    Fixed "startProcess() on Windows with poInteractive: Second call fails ("Alle Pipeinstanzen sind ausgelastet")" (#5179)


Version 0.15.2 released

We're happy to announce that the latest release of Nim, version 0.15.2, is now available!

As always, you can grab the latest version from the downloads page.

This release is a pure bugfix release fixing the most pressing issues and regressions of 0.15.0. For Windows we now provide zipfiles in addition to the NSIS based installer which proves to be hard to maintain and after all these months still has serious issues. So we encourage you download the .zip file instead of the .exe file! Unzip it somewhere, run finish.exe to detect your MingW installation, done. finish.exe can also set your PATH environment variable.
Bugfixes

The list below has been generated based on the commits in Nim's git repository. As such it lists only the issues which have been closed via a commit, for a full list see this link on Github.

    Fixed "NimMain not exported in DLL, but NimMainInner is" (#4840)
    Fixed "Tables clear seems to be broken" (#4844)
    Fixed "compiler: internal error" (#4845)
    Fixed "trivial macro breaks type checking in the compiler" (#4608)
    Fixed "derived generic types with static[T] breaks type checking in v0.15.0 (worked in v0.14.2)" (#4863)
    Fixed "xmlparser.parseXml is not recognised as GC-safe" (#4899)
    Fixed "async makes generics instantiate only once" (#4856)
    Fixed "db_common docs aren't generated" (#4895)
    Fixed "rdstdin disappeared from documentation index" (#3755)
    Fixed "ICE on template call resolution" (#4875)
    Fixed "Invisible code-block" (#3078)
    Fixed "nim doc does not generate doc comments correctly" (#4913)
    Fixed "nim doc2 fails on ARM when running against lib/pure/coro.nim" (#4879)
    Fixed "xmlparser does not unescape correctly" (#1518)
    Fixed "[docs] mysterious "raise hook"" (#3485)
    Fixed "assertion failure in non-release Nim when compiling NimYAML" (#4869)
    Fixed "A closure causes nimscript to fail with unhandled exception" (#4906)
    Fixed "startProcess changes working directory" (#4867)
    Fixed "bindsym to void template produces ICE" (#4808)
    Fixed "readline(TFile, var string) segfaults if second argument is nil" (#564)
    Fixed "times.parse gives the wrong day of the week for the first hour of the day." (#4922)
    Fixed "Internal error when passing parameter proc inside .gcsafe closure" (#4927)
    Fixed "Upcoming asyncdispatch doesn't compile with C++ backend on OS X" (#4928)



Changelog 0.15.0
Changes affecting backwards compatibility

    The json module now uses an OrderedTable rather than a Table for JSON objects.
    The split (doc) procedure in the strutils module (with a delimiter of type set[char]) no longer strips and splits characters out of the target string by the entire set of characters. Instead, it now behaves in a similar fashion to split with string and char delimiters. Use splitWhitespace to get the old behaviour.

    The command invocation syntax will soon apply to open brackets and curlies too. This means that code like a [i] will be interpreted as a([i]) and not as a[i] anymore. Likewise f (a, b) means that the tuple (a, b) is passed to f. The compiler produces a warning for a [i]:

    Warning: a [b] will be parsed as command syntax; spacing is deprecated

    See Issue #3898 for the relevant discussion.
    Overloading the special operators ., .(), .=, () now needs to be enabled via the {.experimental.} pragma.
    immediate templates and macros are now deprecated. Use untyped (doc) parameters instead.
    The metatype expr is deprecated. Use untyped (doc) instead.
    The metatype stmt is deprecated. Use typed (doc) instead.
    The compiler is now more picky when it comes to tuple types. The following code used to compile, now it's rejected:

import tables
var rocketaims = initOrderedTable[string, Table[tuple[k: int8, v: int8], int64]]()
rocketaims["hi"] = {(-1.int8, 0.int8): 0.int64}.toTable()

Instead be consistent in your tuple usage and use tuple names for named tuples:

import tables
var rocketaims = initOrderedTable[string, Table[tuple[k: int8, v: int8], int64]]()
rocketaims["hi"] = {(k: -1.int8, v: 0.int8): 0.int64}.toTable()

    Now when you compile console applications for Windows, console output encoding is automatically set to UTF-8.
    Unhandled exceptions in JavaScript are now thrown regardless of whether noUnhandledHandler is defined. But the stack traces should be much more readable now.
    In JavaScript, the system.alert procedure has been deprecated. Use dom.alert instead.
    De-deprecated re.nim because there is too much code using it and it got the basic API right.
    The type of headers field in the AsyncHttpClient type (doc) has been changed from a string table to the specialised HttpHeaders type.
    The httpclient.request (doc) procedure which takes the httpMethod as a string value no longer requires it to be prefixed with "http" (or similar).
    Converting a HttpMethod (doc) value to a string using the $ operator will give string values without the "Http" prefix now.
    The Request (doc) object defined in the asynchttpserver module now uses the HttpMethod type for the request method.

Library Additions

    Added readHeaderRow and rowEntry to the parsecsv (doc) module to provide a lightweight alternative to python's csv.DictReader.
    Added setStdIoUnbuffered proc to the system module to enable unbuffered I/O.
    Added center and rsplit to the strutils (doc) module to provide similar Python functionality for Nim's strings.
    Added isTitle, title, swapCase, isUpper, toUpper, isLower, toLower, isAlpha, isSpace, and capitalize to the unicode.nim (doc) module to provide unicode aware case manipulation and case testing.
    Added a new module strmisc (doc) to hold uncommon string operations. Currently contains partition, rpartition and expandTabs.
    Split out walkFiles in the os (doc) module to three separate procs in order to make a clear distinction of functionality. walkPattern iterates over both files and directories, while walkFiles now only iterates over files and walkDirs only iterates over directories.
    Added a synchronous HttpClient in the httpclient (doc) module. The old get, post and similar procedures are now deprecated in favour of it.
    Added a new macro called multisync allowing you to write procedures for synchronous and asynchronous sockets with no duplication.
    The async macro will now complete FutureVar[T] parameters automatically unless they have been completed already.

Tool Additions

    The documentation is now searchable and sortable by type.
    Pragmas are now hidden by default in the documentation to reduce noise.
    Edit links are now present in the documentation.

Compiler Additions

    The -d/--define flag can now optionally take a value to be used by code at compile time. (doc)

Nimscript Additions

    It's possible to enable and disable specific hints and warnings in Nimscript via the warning and hint procedures.
    Nimscript exports a proc named patchFile which can be used to patch modules or include files for different Nimble packages, including the stdlib package.

Language Additions

    Added {.intdefine.} and {.strdefine.} macros to make use of (optional) compile time defines. (doc)
    If the first statement is an import system statement then system is not imported implicitly anymore. This allows for code like import system except echo or from system import nil.

Bugfixes

The list below has been generated based on the commits in Nim's git repository. As such it lists only the issues which have been closed via a commit, for a full list see this link on Github.

    Fixed "RFC: should startsWith and endsWith work with characters?" (#4252)
    Fixed "Feature request: unbuffered I/O" (#2146)
    Fixed "clear() not implemented for CountTableRef" (#4325)
    Fixed "Cannot close file opened async" (#4334)
    Fixed "Feature Request: IDNA support" (#3045)
    Fixed "Async: wrong behavior of boolean operations on futures" (#4333)
    Fixed "os.walkFiles yields directories" (#4280)
    Fixed "Fix #4392 and progress on #4170" (#4393)
    Fixed "Await unable to wait futures from objects fields" (#4390)
    Fixed "TMP variable name generation should be more stable" (#4364)
    Fixed "nativesockets doesn't compile for Android 4.x (API v19 or older) because of gethostbyaddr" (#4376)
    Fixed "no generic parameters allowed for ref" (#4395)
    Fixed "split proc in strutils inconsistent for set[char]" (#4305)
    Fixed "Problem with sets in devel" (#4412)
    Fixed "Compiler crash when using seq[PNimrodNode] in macros" (#537)
    Fixed "ospaths should be marked for nimscript use only" (#4249)
    Fixed "Repeated deepCopy() on a recursive data structure eventually crashes" (#4340)
    Fixed "Analyzing destructor" (#4371)
    Fixed "getType does not work anymore on a typedesc" (#4462)
    Fixed "Error in rendering empty JSON array" (#4399)
    Fixed "Segmentation fault when using async pragma on generic procs" (#2377)
    Fixed "Forwarding does not work for generics, | produces an implicit generic" (#3055)
    Fixed "Inside a macro, the length of the seq data inside a queue does not increase and crashes" (#4422)
    Fixed "compiler sigsegv while processing varargs" (#4475)
    Fixed "JS codegen - strings are assigned by reference" (#4471)
    Fixed "when statement doesn't verify syntax" (#4301)
    Fixed ".this pragma doesn't work with .async procs" (#4358)
    Fixed "type foo = range(...) crashes compiler" (#4429)
    Fixed "Compiler crash" (#2730)
    Fixed "Crash in compiler with static[int]" (#3706)
    Fixed "Bad error message "could not resolve"" (#3548)
    Fixed "Roof operator on string in template crashes compiler (Error: unhandled exception: sons is not accessible [FieldError])" (#3545)
    Fixed "SIGSEGV during compilation with parallel block" (#2758)
    Fixed "Codegen error with template and implicit dereference" (#4478)
    Fixed "@ in importcpp should work with no-argument functions" (#4496)
    Fixed "Regression: findExe raises" (#4497)
    Fixed "Linking error - repeated symbols when splitting into modules" (#4485)
    Fixed "Error: method is not a base" (#4428)
    Fixed "Casting from function returning a tuple fails" (#4345)
    Fixed "clang error with default nil parameter" (#4328)
    Fixed "internal compiler error: openArrayLoc" (#888)
    Fixed "Can't forward declare async procs" (#1970)
    Fixed "unittest.check and sequtils.allIt do not work together" (#4494)
    Fixed "httpclient package can't make SSL requests over an HTTP proxy" (#4520)
    Fixed "False positive warning "declared but not used" for enums." (#4510)
    Fixed "Explicit conversions not using converters" (#4432)
    Fixed "Unclear error message when importing" (#4541)
    Fixed "Change console encoding to UTF-8 by default" (#4417)
    Fixed "Typedesc ~= Generic notation does not work anymore!" (#4534)
    Fixed "unittest broken?" (#4555)
    Fixed "Operator "or" in converter types seems to crash the compiler." (#4537)
    Fixed "nimscript failed to compile/run -- Error: cannot 'importc' variable at compile time" (#4561)
    Fixed "Regression: identifier expected, but found ..." (#4564)
    Fixed "varargs with transformation that takes var argument creates invalid c code" (#4545)
    Fixed "Type mismatch when using empty tuple as generic parameter" (#4550)
    Fixed "strscans" (#4562)
    Fixed "getTypeImpl crashes (SIGSEGV) on variant types" (#4526)
    Fixed "Wrong result of sort in VM" (#4065)
    Fixed "I can't call the random[T](x: Slice[T]): T" (#4353)
    Fixed "invalid C code generated (function + block + empty tuple)" (#4505)
    Fixed "performance issue: const Table make a copy at runtime lookup." (#4354)
    Fixed "Compiler issue: libraries without absolute paths cannot be found correctly" (#4568)
    Fixed "Cannot use math.`^` with non-int types." (#4574)
    Fixed "C codegen fails when constructing an array using an object constructor." (#4582)
    Fixed "Visual Studio 10 unresolved external symbol _trunc(should we support VS2010?)" (#4532)
    Fixed "Cannot pass generic subtypes to proc for generic supertype" (#4528)
    Fixed "Lamda-lifting bug leading to crash." (#4551)
    Fixed "First-class iterators declared as inline are compiled at Nim side (no error message) and fail at C" (#2094)
    Fixed "VS2010-warning C4090 : 'function' : different 'const' qualifiers" (#4590)
    Fixed "Regression: type mismatch with generics" (#4589)
    Fixed "„can raise an unlisted exception“ when assigning nil as default value" (#4593)
    Fixed "upcoming asyncdispatch.closeSocket is not GC-safe" (#4606)
    Fixed "Visual Studio 10.0 compiler errors, 12.0 warning" (#4459)
    Fixed "Exception of net.newContext: result.extraInternalIndex == 0 [AssertionError]" (#4406)
    Fixed "error: redeclaration of 'result_115076' with no linkage" (#3221)
    Fixed "Compiler crashes on conversion from int to float at compile time" (#4619)
    Fixed "wrong number of arguments regression in devel" (#4600)
    Fixed "importc $ has broken error message (and is not documented)" (#4579)
    Fixed "Compiler segfaults on simple importcpp in js mode [regression]" (#4632)
    Fixed "Critical reference counting codegen problem" (#4653)
    Fixed "tables.nim needs lots of {.noSideEffect.}" (#4254)
    Fixed "Capture variable error when using => macro" (#4658)
    Fixed "Enum from char: internal error getInt" (#3606)
    Fixed "Compiler crashes in debug mode (no error in release mode) with Natural discriminant in object variants" (#2865)
    Fixed "SIGSEGV when access field in const object variants" (#4253)
    Fixed "varargs cannot be used with template converter." (#4292)
    Fixed "Compiler crashes when borrowing $" (#3928)
    Fixed "internal error: genMagicExpr: mArrPut" (#4491)
    Fixed "Unhelpful error message on importc namespace collision" (#4580)
    Fixed "Problem with openarrays and slices" (#4179)
    Fixed "Removing lines from end of file then rebuilding does not rebuild [js only?]" (#4656)
    Fixed "getCurrentException and getCurrentExceptionMsg do not work with JS" (#4635)
    Fixed "generic proc parameter is not inferred if type parameter has specifier" (#4672)
    Fixed "Cannot instantiate generic parameter when it is parent type parameter" (#4673)
    Fixed "deepCopy doesn't work with inheritance after last commit" (#4693)
    Fixed "Multi-methods don't work when passing ref to a different thread" (#4689)
    Fixed "Infinite loop in effect analysis on generics" (#4677)
    Fixed "SIGSEGV when compiling NimYAML tests" (#4699)
    Fixed "Closing AsyncEvent now also unregisters it on non-Windows platforms" (#4694)
    Fixed "Don't update handle in upcoming/asyncdispatch poll() if it was closed" (#4697)
    Fixed "generated local variables declared outside block" (#4721)
    Fixed "Footer Documentation links, & Community link point to the wrong place under news entries" (#4529)
    Fixed "Jester's macro magic leads to incorrect C generation" (#4088)
    Fixed "cas bug in atomics.nim" (#3279)
    Fixed "nimgrep PEG not capturing the pattern 'A'" (#4751)
    Fixed "GC assert triggers when assigning TableRef threadvar" (#4640)
    Fixed ".this pragma conflicts with experimental ptr dereferencing when names conflict" (#4671)
    Fixed "Generic procs accepting var .importcpp type do not work [regression]" (#4625)
    Fixed "C Error on tuple assignment with array" (#4626)
    Fixed "module securehash not gcsafe" (#4760)
    Fixed "Nimble installation failed on Windows x86." (#4764)
    Fixed "Recent changes to marshal module break old marshalled data" (#4779)
    Fixed "tnewasyncudp.nim test loops forever" (#4777)
    Fixed "Wrong poll timeout behavior in asyncdispatch" (#4262)
    Fixed "Standalone await shouldn't read future" (#4170)
    Fixed "Regression: httpclient fails to compile without -d:ssl" (#4797)
    Fixed "C Error on declaring array of heritable objects with bitfields" (#3567)
    Fixed "Corruption when using Channels and Threads" (#4776)
    Fixed "Sometimes Channel tryRecv() erroneously reports no messages available on the first call on Windows" (#4746)
    Fixed "Improve error message of functions called without parenthesis" (#4813)
    Fixed "Docgen doesn't find doc comments in macro generated procs" (#4803)
    Fixed "asynchttpserver may consume unbounded memory reading headers" (#3847)
    Fixed "TLS connection to api.clashofclans.com hangs forever." (#4587)
2017-02-05 01:27:30 +00:00
kamil
3a53ccf1b9 Import nim-0.14.2 as lang/nim
Nim (formerly known as "Nimrod") is a statically typed, imperative
programming language that tries to give the programmer ultimate power
without compromises on runtime efficiency. This means it focuses on
compile-time mechanisms in all their various forms.

Beneath a nice infix/indentation based syntax with a powerful (AST based,
hygienic) macro system lies a semantic model that supports a soft realtime
GC on thread local heaps. Asynchronous message passing is used between
threads, so no "stop the world" mechanism is necessary. An unsafe shared
memory heap is also provided for the increased efficiency that results from
that model.

Originally packaged in pkgsrc-wip by:
 - Christian Koch
 - Roland Illig
and
 - myself.
2016-09-18 01:02:43 +00:00