summary refs log tree commit diff stats
path: root/changelog.md
Commit message (Collapse)AuthorAgeFilesLines
* fixes #24174; allow copyDir and copyDirWithPermissions skipping special ↵ringabout2024-09-271-0/+1
| | | | | files (#24190) fixes #24174
* improve changelogs (#24188)ringabout2024-09-271-7/+7
| | | Co-authored-by: metagn <metagngn@gmail.com>
* make `genericsOpenSym` work at instantiation time, new behavior in `openSym` ↵metagn2024-09-181-5/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | (#24111) alternative to #24101 #23892 changed the opensym experimental switch so that it has to be enabled in the context of the generic/template declarations capturing the symbols, not the context of the instantiation of the generics/templates. This was to be in line with where the compiler gives the warnings and changes behavior in a potentially breaking way. However `results` [depends on the old behavior](https://github.com/arnetheduck/nim-results/blob/71d404b314479a6205bfd050f4fe5fe49cdafc69/results.nim#L1428), so that the callers of the macros provided by results always take advantage of the opensym behavior. To accomodate this, we change the behavior of the old experimental option that `results` uses, `genericsOpenSym`, so that ignores the information of whether or not symbols are intentionally opened and always gives the opensym behavior as long as it's enabled at instantiation time. This should keep `results` working as is. However this differs from the normal opensym switch in that it doesn't generate `nnkOpenSym`. Before it was just a generics-only version of `openSym` along with `templateOpenSym` which was only for templates. So `templateOpenSym` is removed along with this change, but no one appears to have used it.
* add posix uint changes to changelog + fix Nlink, Dev on FreeBSD (#24088)metagn2024-09-091-0/+9
| | | | | | | refs #24078, refs #24076 Since these changes are potentially breaking, add them to changelog, also add Nlink as mentioned in https://github.com/nim-lang/Nim/issues/24076#issuecomment-2337666555.
* enable closures tests for JS & implement `finished` for JS (#23521)ringabout2024-09-091-0/+3
|
* open new scope for const values (#24084)metagn2024-09-091-0/+10
| | | | | | | | | | | | | fixes #5395 Previously values of `const` statements used the same scope as the `const` statement itself, meaning variables could be declared inside them and referred to in other statements in the same block. Now each `const` value opens its own scope, so any variable declared in the value of a constant can only be accessed for that constant. We could change this to open a new scope for the `const` *section* rather than each constant, so the variables can be used in other constants, but I'm not sure if this is sound.
* expose `rangeBase` typetrait, fix enum conversion warning (#24056)metagn2024-09-061-0/+2
| | | | | | | | | | | | | | | | refs #21682, refs #24038 The `rangeBase` typetrait added in #21682 which gives the base type of a range type is now added publicly to `typetraits`. Previously it was only privately used in `repr_v2` and in `enumutils` since #24052 (coincidentally I didn't see this until now). This is part of an effort to make range types easier to work with in generics, as mentioned in #24038. Its use combined with #24037 is also tested. The condition for the "enum to enum conversion" warning is now also restricted to conversions between different enum base types, i.e. conversion between an enum type and a range type of itself doesn't give a warning. I put this in this PR since the test gave the warning and so works as a regression test.
* document partial generics breaking changes (#24055)metagn2024-09-041-0/+13
| | | refs #24010, split from #24051
* fixes typo (#24026)ringabout2024-08-291-1/+1
|
* opensym for templates + move behavior of opensymchoice to itself (#24007)metagn2024-08-281-17/+39
| | | | | | | | | | | | | | | | | | | | | | | fixes #15314, fixes #24002 The OpenSym behavior first added to generics in #23091 now also applies to templates, since templates can also capture symbols that are meant to be replaced by local symbols if the context imports symbols with the same name, as in the issue #24002. The experimental switch `templateOpenSym` is added to enable this behavior for templates only, and the experimental switch `openSym` is added to enable it for both templates and generics, and the documentation now mainly mentions this switch. Additionally the logic for `nkOpenSymChoice` nodes that were previously wrapped in `nkOpenSym` now apply to all `nkOpenSymChoice` nodes, and so these nodes aren't wrapped in `nkOpenSym` anymore. This means `nkOpenSym` can only have children of kind `nkSym` again, so it is more in line with the structure of symchoice nodes. As for why they aren't merged with `nkOpenSymChoice` nodes yet, we need some way to signal that the node shouldn't become ambiguous if other options exist at instantiation time, we already captured a symbol at the beginning and another symbol can only replace it if it's closer in scope and unambiguous.
* generate symchoice for ambiguous types in templates & generics + handle ↵metagn2024-08-251-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | types in symchoices (#23997) fixes #23898, supersedes #23966 and #23990 Since #20631 ambiguous type symbols in templates are rejected outright, now we generate a symchoice for type nodes if they're ambiguous, a generalization of what was done in #22375. This is done for generics as well. Symchoices also handle type symbols better now, ensuring their type is a `typedesc` type; this probably isn't necessary for everything to work but it makes the logic more robust. Similar to #23989, we have to prepare for the fact that ambiguous type symbols behave differently than normal type symbols and either error normally or relegate to other routine symbols if the symbol is being called. Generating a symchoice emulates this behavior, `semExpr` will find the type symbol first, but since the symchoice has other symbols, it will count as an ambiguous type symbol. I know it seems spammy to carry around an ambiguity flag everywhere, but in the future when we have something like #23104 we could just always generate a symchoice, and the symchoice itself would carry the info of whether the first symbol was ambiguous. But this could harm compiler performance/memory use, it might be better to generate it only when we have to, which in the case of type symbols is only when they're ambiguous.
* opensym as node kind + fixed experimental switch (#23892)metagn2024-08-121-1/+10
| | | | | | | | | | | | | | | refs https://github.com/nim-lang/Nim/pull/23873#discussion_r1687995060, fixes #23386, fixes #23385, supersedes #23572 Turns the `nfOpenSym` node flag implemented in #23091 and extended in #23102 and #23873, into a node kind `nkOpenSym` that forms a unary node containing either `nkSym` or `nkOpenSymChoice`. Since this affects macros working on generic proc AST, the node kind is now only generated when the experimental switch `genericsOpenSym` is enabled, and a new node flag `nfDisabledOpenSym` is set to the `nkSym` or `nkOpenSymChoice` when the switch is not enabled so that we can give a warning. Now that the experimental switch has more reasonable semantics, we define `nimHasGenericsOpenSym2`.
* deprecate `owner` from `std/macros` (#23828)ringabout2024-07-121-0/+2
|
* Replacement PR for https://github.com/nim-lang/Nim/pull/23779 that (#23793)c-blake2024-07-071-4/+7
| | | | | | | makes new hash the default, with an opt-out (& js-no-big-int) define. Also update changelog (& fix one typo). Only really expect the chronos hash-order sensitive test to fail until they merge that PR and tag a new release.
* Add Farm Hash conditioned upon `nimPreviewHashFarm` as 64-bit `Hash` (#23735)c-blake2024-06-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Unlike present Nim this actually fills `Hash` for `string` & related. For the curious, note that `hashData` remains the aboriginal Nim string hasher & `import hashes {.all.}` allows simultaneous test/time of {orig, murmur, farm} on your favorite CPU & back end compiler. Update tests also conditioned upon `nimPreviewHashFarm` so they should pass either with or without that `define` on. In `--jsbigint=on` mode, only the lower 32-bits of `Hash` match nimvm & run-time values because `type Hash = int` and on JS int=int32, not int64 as for 64-bit Nim platforms. Due to the matching, `const` Table should match run-time `Table` on all platforms. To operate in `--jsbigint=off` mode is feasible but needs much "double precision mul/xor/ror/shr-arithmetic"-style work. That is distracting & also of questionable value since JS added BigInt in 2018, ringabout added Nim support for it in 2021 & `nimPreviewHashFarm` is unlikely to swap from an opt-in to an opt-out default before 2025..2026 which will have given a backward looking time window of 7..8 years for deployment platforms - reasonably generous. Add a changelog entry for 2.2.
* implement `legacy:jsNoLambdaLifting` for compatibility (#23727)ringabout2024-06-171-0/+2
|
* provides a `$` function for `Path` (#23617)ringabout2024-05-171-0/+1
| | | Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* fixes #4299 #12492 #10849; lambda lifting for JS backend (#23484)ringabout2024-04-111-0/+2
| | | | | | | | fixes #4299 fixes #12492 fixes #10849 It binds `function` with `env`: `function.bind(:env)` to ease codegen for now
* remove `internalNew` from system (#23475)ringabout2024-04-041-0/+1
|
* ORC: added -d:nimOrcStats switch and related API (#23272)Andreas Rumpf2024-02-211-2/+5
|
* Add `toSinglyLinkedRing` and `toDoublyLinkedRing` to `std/lists` (#22952)Eric N. Vander Weele2023-12-241-0/+1
| | | | Allow for conversion from `openArray`s, similar to `toSinglyLinkedList` and `toDoublyLinkedList`.
* add switch, warning, and `bind` support for new generic injection behavior ↵metagn2023-12-221-0/+35
| | | | | | | | | | | | | | | | | | | | | (#23102) refs #23091, especially post merge comments Unsure if `experimental` and `bind` are the perfect constructs to use but they seem to get the job done here. Symbol nodes do not get marked `nfOpenSym` if the `bind` statement is used for their symbol, and `nfOpenSym` nodes do not get replaced by new local symbols if the experimental switch is not enabled in the local context (meaning it also works with `push experimental`). However this incurs a warning as the fact that the node is marked `nfOpenSym` means we did not `bind` it, so we might want to do that or turn on the experimental switch if we didn't intend to bind it. The experimental switch name is arbitrary and could be changed. --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* add tuple unpacking changes to changelog (#23093)metagn2023-12-181-0/+19
| | | | | | closes #23042 Adds changes from #22537 and #22611 to changelog (I believe both are set for 2.2).
* enable vtable implementation for C++ and make it an experimental feature ↵ringabout2023-11-301-1/+1
| | | | | | | | | | | (#23004) follow up https://github.com/nim-lang/Nim/pull/22991 - [x] turning it into an experimental feature --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* rework the vtable implementation embedding the vtable array directly with ↵ringabout2023-11-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | new strictions on methods (#22991) **TODO** - [x] fixes changelog With the new option `nimPreviewVtables`, `methods` are confined in the same module where the type of the first parameter is defined - [x] make it opt in after CI checks its feasibility ## In the following-up PRs - [ ] in the following PRs, refactor code into a more efficient one - [ ] cpp needs special treatments since it cannot embed array in light of the preceding limits: ref https://github.com/nim-lang/Nim/pull/20977#discussion_r1035528927; we can support cpp backends with vtable implementations later on the comprise that uses indirect vtable access --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* fixes #22286; enforce Non-var T destructors by `nimPreviewNonVarDestructor` ↵ringabout2023-11-251-0/+1
| | | | | | | | | | | | | | | | | | (#22975) fixes #22286 ref https://forum.nim-lang.org/t/10642 For backwards compatibilities, we might need to keep the changes under a preview compiler flag. Let's see how many packags it break. **TODO** in the following PRs - [ ] Turn the `var T` destructors warning into an error with `nimPreviewNonVarDestructor` --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* adds C++ features to change log (#22906)Juan M Gómez2023-11-031-0/+3
| | | | Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: Juan Carlos <juancarlospaco@gmail.com>
* Fix #22862 - change the httpclient user-agent to be valid spec-wise (#22882)Yardanico2023-10-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Per https://datatracker.ietf.org/doc/html/rfc9110#name-user-agent a User-Agent is defined as follows: ``` User-Agent = product *( RWS ( product / comment ) ) ``` Where ``` product = token ["/" product-version] product-version = token ``` In this case, `token` is defined in RFC 7230 - https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6: ``` token = 1*tchar tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA ; any VCHAR, except delimiters ``` or, in the original RFC 2616 - https://datatracker.ietf.org/doc/html/rfc2616#section-2.2 (next page): ``` token = 1*<any CHAR except CTLs or separators> separators = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\" | <"> | "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT ``` which means that a `token` cannot have whitespace. Not sure if this should be in the breaking changelog section - theoretically, some clients might've relied on the old Nim user-agent? For some extra info, some other languages seem to have adopted the same hyphen user agent to specify the language + module, e.g.: - https://github.com/python/cpython/blob/main/Lib/urllib/request.py#L1679 (`Python-urllib/<version>`) Fixes #22862.
* deprecate htmlparser (#22870)ringabout2023-10-261-0/+1
| | | | | | | | | ref https://github.com/nim-lang/Nim/pull/22848 see also https://github.com/nim-lang/htmlparser will build the documentation later when everything else is settled --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* fixes #22856; enables `-d:nimStrictDelete` (#22858)ringabout2023-10-241-0/+1
| | | | | | | | fixes #22856 `-d:nimStrictDelete` is introduced in 1.6.0, which promised to be enabled in the coming versions. To keep backwards incompatibilities, it also extends the feature of `-d:nimAuditDelete`, which now mimics the old behaviors.
* marking a field with noInit allows to skip constructor initialiser (#22802)Juan M Gómez2023-10-081-1/+1
| | | Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* copyFile with POSIX_FADV_SEQUENTIAL (#22776)Juan Carlos2023-10-011-0/+1
| | | | | | | | | | | - Continuation of https://github.com/nim-lang/Nim/pull/22769 - See https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_fadvise.html - The code was already there in `std/posix` since years ago. 3 line diff. --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* copyFile with bufferSize instead of hardcoded value (#22769)Juan Carlos2023-09-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - `copyFile` allows to specify `bufferSize` instead of hardcoded wrong value. Tiny diff. # Performance - 1200% Performance improvement. # Check it yourself Execute: ```bash for i in $(seq 0 10); do bs=$((1024*2**$i)) printf "%7s Kb\t" $bs timeout --foreground -sINT 2 dd bs=$bs if=/dev/zero of=/dev/null 2>&1 | sed -n 's/.* \([0-9.,]* [GM]B\/s\)/\1/p' done ``` (This script can be ported to PowerShell for Windows I guess, it works in Windows MinGW Bash anyways). # Stats - Hardcoded `8192` or `8000` Kb bufferSize gives `5` GB/s. - Setting `262144` Kb bufferSize gives `65` GB/s (script suggestion). --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* deprecates `newSeqUninitialized` replaced by `newSeqUninit` (#22739)ringabout2023-09-291-0/+1
| | | | | | | ref #19727 closes #22586 https://github.com/nim-lang/Nim/issues/22554 needs it to move on. `newSeqUnsafe` can be introduced later.
* fixes #22763; nimcache in nim.cfg uses the relative path to the config file ↵ringabout2023-09-281-0/+1
| | | | | (#22764) fixes #22763
* ref #19727; implement `setLenUninit` for seqsv2 (#22767)ringabout2023-09-281-0/+2
| | | ref #19727
* Fix #21407 (#22759)Juan Carlos2023-09-281-0/+1
| | | | | | | - Fix #21407 --------- Co-authored-by: Amjad Ben Hedhili <amjadhedhili@outlook.com>
* Add `hasDefaultValue` type trait (#22636)Amjad Ben Hedhili2023-09-041-1/+2
| | | Needed for #21842.
* fixes #22555; implements `newStringUninit` (#22572)ringabout2023-08-291-0/+2
| | | | | | | | | | | | | * fixes newStringUninitialized; implement `newStringUninitialized` * add a simple test case * adds a changelog * Update lib/system.nim * Apply suggestions from code review rename to newStringUninit
* follow up #22322; fixes changelog (#22381)ringabout2023-08-041-2/+2
|
* fixes changelog (#21590)ringabout2023-03-311-1/+0
|
* This adds `parseutils.parseSize`, an inverse to `strutils.formatSize` (#21349)c-blake2023-02-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * This adds `parseutils.parseSize`, an inverse to `strutils.formatSize` which has existed since 2017. It is useful for parsing the compiler's own output logs (like SuccessX) or many other scenarios where "human readable" units have been chosen. The doc comment and tests explain accepted syntax in detail. Big units lead to small numbers, often with a fractional part, but we parse into an `int64` since that is what `formatSize` stringifies and this is an inverse over partial function slots. Although metric prefixes z & y for zettabyte & yottabyte are accepted, these will saturate the result at `int64.high` unless the qualified number is a small fraction. This should not be much of a problem until such sizes are common (at which point another overload with the parse result either `float64` or `int128` could be added). Tests avoids `test()` because of a weakly related static: test() failure as mentioned in https://github.com/nim-lang/Nim/pull/21325. This is a more elemental VM failure. As such, it needs its own failure exhibition issue that is a smaller test case. (I am working on that, but unless there is a burning need to `parseSize` at compile-time before run-time it need not hold up this PR.) * This worked with `int` but fails with `int64`. Try for green tests. * Lift 2-result matching into a `checkParseSize` template and format as a table of input & 2 expected outputs which seems nicer and to address https://github.com/nim-lang/Nim/pull/21349#pullrequestreview-1294407679 * Fix (probably) the i386 trouble by using `int64` consistently. * Improve documentation by mentioning saturation. * Improve documentation with `runnableExamples` and a little more detail in the main doc comment based on excellent code review by @juancarlospaco: https://github.com/nim-lang/Nim/pull/21349#pullrequestreview-1294564155 * Address some more @juancarlospaco code review concerns. * Remove a stray space. * Mention milli-bytes in docs to maybe help clarify why wild conventions are so prone to going case-insensitive-metric. * Add some parens.
* add 2.0 changelog (#21107)ringabout2022-12-171-293/+3
| | | [backport: 2.0] add v2.0 changelog
* fix #19580; add warning for bare except: clause (#21099)ringabout2022-12-151-0/+2
| | | | | | | | | | | | | | | | | | | | | * fix #19580; add warning for bare except: clause * fixes some easy ones * Update doc/manual.md * fixes docs * Update changelog.md * addition * Apply suggestions from code review Co-authored-by: Jacek Sieka <arnetheduck@gmail.com> * Update doc/tut2.md Co-authored-by: Jacek Sieka <arnetheduck@gmail.com>
* generic `define` pragma + string alias (#20979)metagn2022-12-131-3/+27
| | | | | | | | | * generic `define` pragma + string alias * clean * add tests and document * remove char/float, minimize changelog
* add a changelog for nimble (#21078)ringabout2022-12-121-3/+1
|
* Remove deprecated rightSize (#21011)Juan Carlos2022-12-081-0/+2
| | | | | * Remove deprecated rightSize nop * Remove deprecated rightSize nop
* add a changelog for `std/cmdline` (#21039)ringabout2022-12-081-0/+1
| | | for a changelog for `std/cmdline`
* build the documentation of official packages (#20986)ringabout2022-12-061-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * remove db stuffs * remove punycode * remove * fixes script * add cloner * patches * disable * patch * fixes external packages * disable two packages * preview documentation build * try again * fixes URL * fixes a bug * simplify * fixes documentaion * fixes * Apply suggestions from code review
* Named arguments in commands + many grammar fixes (#20994)metagn2022-12-061-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Breaking parser changes, implement https://github.com/nim-lang/RFCs/issues/442 Types are separated from expressions and better reflected in the grammar. * add test * more accurate grammar * fix keyword typedescs * accept expressions in proc argument lists * CI "fixes" * fixes * allow full ref expressions again, adapt old tests * cleanup, fix some tests * improve grammar, try and revert semtypes change * restrict sigil binding to identOrLiteral * fix, should have caught this immediately * add changelog entry, fix double not nil bug * correct grammar * change section * fix * real fix hopefully * fix test * support LL(1) for tuples * make grammar.txt too