summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
* Allocator: Track number of foreign cells a small chunk has access to (#23856)SirOlaf2024-07-201-29/+46
| | | | | | | | | Ref: https://github.com/nim-lang/Nim/issues/23788 There was a small leak in the above issue even after fixing the segfault. The sizes of `free` and `acc` were changed to 32bit because adding the `foreignCells` field will drastically increase the memory usage for programs that hold onto memory for a long time if they stay as 64bit.
* fix generics treating symchoice symbols as uninstantiated (#23860)metagn2024-07-192-1/+96
| | | | | | | | | | | | | fixes #23853 Since #22610 generics turns the `Name` in the `GT.Name` expression in the test code into a sym choice. The problem is when the compiler tries to instantiate `GT.Name` it also instantiates the sym choice symbols. `Name` has type `template (E: type ExtensionField)` which contains the unresolved generic type `ExtensionField`, which the compiler mistakes as an uninstantiated node, when it's just part of the type of the template. The compilation of the node itself and hence overloading will handle the instantiation of the proc, so we avoid instantiating it in `semtypinst`, similar to how the first nodes of call nodes aren't instantiated.
* Add '.' (period, dot, ..) to `FormatLiterals` so that `ss.fff` can work. ↵c-blake2024-07-191-1/+1
| | | | | | | | | | | | | (#23861) Honestly, to me the entire design of a (highly!) restricted set of `FormatLiterals` characters seems antithetical to the very idea of a format string template. Fixing that is a much larger change, though. So, this PR just adds `'.'` so that the standard (both input & output!) notation for decimal numbers in Nim can be used for the seconds part of a time format in `lib/pure/times.format(.., f)`. It should only make legal what was illegal and should be harmless since `'.'` is not used in any special way otherwise.
* fixes #23858; 2.2.0 rc1 regression with cdecl functions (#23859)ringabout2024-07-184-4/+17
| | | | | | fixes #23858 We should not assign fields to fields for returns of function calls because calls might have side effects.
* doc: times.nim: DD -> dd (#23857)lit2024-07-181-2/+2
| | | `YYYY-MM-dd` was mistaken as `YYYY-MM-DD`.
* Set type of object constructor during annotateType (#23852)SirOlaf2024-07-172-0/+24
| | | | | | Fix https://github.com/nim-lang/Nim/issues/23547 Tested locally with the included test, the test from constantine and the original issue.
* Add constantine to important_packages.nim (#23801)Mamy Ratsimbazafy2024-07-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This adds Constantine to the important packages. Release announcements: - https://forum.nim-lang.org/t/11935 - https://github.com/mratsim/constantine/releases/tag/v0.1.0 Unfortunately at the moment I'm in a conundrum. - Constantine cannot compile on devel due to https://github.com/nim-lang/Nim/issues/23547 - The workaround is changing ```Nim func mulCheckSparse*(a: var QuadraticExt, b: static QuadraticExt) {.inline.} = ``` to ```Nim template mulCheckSparse*(a: var QuadraticExt, b: QuadraticExt) = ``` but this does not compile on v2.0.8 due to `gensym` issues despite https://github.com/nim-lang/Nim/pull/23716 ![image](https://github.com/nim-lang/Nim/assets/22738317/21c875d7-512f-4c21-8547-d12534e93a58). i.e. as mentioned in the issue https://github.com/nim-lang/Nim/issues/23711 there is another gensym bug within templates that was fixed in devel but not the v2.0.x series and that is not fixed by #23716
* fixes #23848; The comand `nim gendepend` defaults to ORC (#23851)ringabout2024-07-171-1/+2
| | | fixes #23848
* Fixes #23846; prepend nimArgs to args (#23847)EuklidAlexandria2024-07-171-2/+3
| | | | Fixes #23846. Probably, nimArgs should be prepended in other places (e.g. `buildDocSamples`).
* fixes #23844; Nim devel nightly i386 build failing (#23849)ringabout2024-07-171-1/+1
| | | | | | | | | | | | fixes #23844 follow up https://github.com/nim-lang/Nim/pull/23834 ```nim type Timespec* {.importc: "struct timespec", header: "<time.h>", final, pure.} = object ## struct timespec tv_sec*: Time ## Seconds. tv_nsec*: clong ## Nanoseconds. ```
* Add warnings about exec usage. (#23820)Antonis Geralis2024-07-171-2/+9
| | | | | | | | | | | Related to https://github.com/nim-lang/Nim/issues/23819 and also found in discord https://discord.com/channels/371759389889003530/371759389889003532/1260845467147829372 Since nothing can be done, besides deprecating the function, a warning is a better option. --------- Co-authored-by: Juan Carlos <juancarlospaco@gmail.com>
* fixes #23837; cursor now processes distinct types with a destructor (#23845)ringabout2024-07-172-2/+62
| | | fixes #23837
* make routine implicitly gensym when other gensym symbol exists again (#23842)metagn2024-07-164-9/+26
| | | | | | | | | | | | | fixes #23813, partially reverts #23392 Before #23392, if a `gensym` symbol was defined before a proc with the same name in a template even with an `inject` annotation, the proc would be `gensym`. After #23392 the proc was instead changed to be `inject` as long as no `gensym` annotation was given. Now, to keep compatibility with the old behavior, the behavior is changed back to infer the proc as `gensym` when no `inject` annotation is given, however an explicit `inject` annotation will still inject the proc. This is also documented in the manual as the old behavior was undocumented and the new behavior is slightly different.
* fixes semi-regression; discard check now skips `nkHiddenSubConv` (#23840)ringabout2024-07-162-1/+10
| | | | | follow up https://github.com/nim-lang/Nim/pull/23681 ref https://forum.nim-lang.org/t/11987
* fixes regression; block can have arbitrary exit points; too hard for a ↵ringabout2024-07-162-5/+18
| | | | | | | | simple analysis (#23839) follow up https://github.com/nim-lang/Nim/pull/23681 ref https://forum.nim-lang.org/t/11987 ref https://github.com/nim-lang/Nim/issues/23836#issuecomment-2227267251
* [minor] fixes wrong error messages (#23841)ringabout2024-07-161-1/+1
|
* Silence `hint:performance` message when using very basic http client (#23832)c-blake2024-07-151-1/+2
| | | | | | | | | | | | code such as: ```Nim import std/httpclient # nim c --hint:performance:on echo newHttpClient(proxy=nil, headers=newHttpHeaders({"Accept": "*/*"})).getContent("x") ``` (Fix was suggested by @ringabout in a private channel.) Seems useful since `httpclient` is so basic/probably pervasive with many hundreds of `import`s across the NimbleVerse.
* Use monotonic timestamp to calculate timeouts refs #23826 (#23834)Mark Leyva2024-07-151-10/+16
| | | | | | Related to #23826. This address issues raised [here](https://github.com/nim-lang/Nim/pull/23826#issuecomment-2226877361) by using a monotonic timestamp to calculate timeouts and increasing the max sleep time to 50ms.
* bump NimVersion to 2.1.9 (#23831)Miran2024-07-121-1/+1
| | | This is a 2.2 RC1.
* fixes #23825; Busy wait on waitid, sleeping at regular intervals (#23826)Mark Leyva2024-07-122-102/+58
| | | | | | | | | Addresses #23825 by using the approaching described in https://github.com/nim-lang/Nim/pull/23743#issuecomment-2199523110. This takes the approach from Python's `subprocess` library which calls `waitid` in loop, while sleeping at regular intervals. CC @alex65536
* refactor: The popular 'r' field is now named 'snippet' (#23829)Andreas Rumpf2024-07-1218-292/+291
|
* deprecate `owner` from `std/macros` (#23828)ringabout2024-07-122-1/+3
|
* fixes 23823; array static overload - again (#23824)Ryan McConnell2024-07-112-0/+12
| | | #23823
* fixes #3011; handles meta fields defined in the ref object (#23818)ringabout2024-07-113-14/+33
| | | | | | | | | | | | | | | | | | | | | | | fixes #3011 In https://github.com/nim-lang/Nim/pull/23532, meta fields that defined in the object are handled. In this PR, RefObjectTy is handled as well: ```nim type Type = ref object context: ref object ``` Ref alias won't trigger mata fields checking so there won't have cascaded errors on `TypeBase`. ```nim type TypeBase = object context: ref object Type = ref TypeBase context: ref object ```
* closes #22095; adds a test case (#23822)ringabout2024-07-111-0/+20
| | | closes #22095
* fixes #20865; fixes #20987; Missing bounds check in array slicing (#23814)ringabout2024-07-104-11/+27
| | | | fixes #20865 fixes #20987
* fixes #22389; fixes #19840; don't fold paths containing `addr` (#23807)ringabout2024-07-093-5/+21
| | | | fixes #22389; fixes #19840
* conditional compilation of gcd(SomeInteger,SomeInteger) in std/math (#23773)quimt2024-07-091-34/+37
| | | | | | | | | | | The most specific version of `gcd(int,int)` in `std/math` uses bitwise comparisons from C compilers, which can't be borrowed on the js platform in the web browser. Conditional compilation here should fix the issue for this and downstream libraries such as `std/rationals` when compiling to browser js as the backend. --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* remove nir; succeeded by nif (#23809)ringabout2024-07-0922-6984/+11
| | | ref https://github.com/nim-lang/nif
* Bumps nimble so the next Nim release includes the latest changes (#23808)Juan M Gómez2024-07-091-1/+1
|
* Add support for nvcc & hipcc (cuda/rocm) (#23805)Andrew Brower2024-07-083-2/+42
| | | | | | | | | | | | | | I've been working on making some basic cuda examples work, both with cuda (nvcc) and with AMD HIP (hipcc) https://github.com/monofuel/hippo - hipcc is just a drop-in replacement for clang and works out of the box with clang settings in Nim. hipcc is capable of compiling for AMD ROCm or to CUDA, depending on how HIP_PLATFORM is set. - nvcc is a little quirky. we can use `-x cu` to tell it to handle nim's `.cpp` files as if they were `.cu` files. nvcc expects all backend compiler flags to be wrapped with a special `-Xcompiler=""` flag when compiling and also when linking. I manually tested on a linux desktop with amd and a laptop with nvidia.
* Adjust the correct chunk's free space in allocator (#23795)SirOlaf2024-07-081-2/+2
| | | Fixes #23788
* Replacement PR for https://github.com/nim-lang/Nim/pull/23779 that (#23793)c-blake2024-07-0711-56/+75
| | | | | | | 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.
* [backport] fixes #23796; remove extra indirection for args in importc'ed ↵Alexander Kernozhitsky2024-07-062-1/+27
| | | | | functions in cpp (#23800) fixes #23796
* Update documentation for parseEnum in strutils.nim (#23804)Leon Lysak2024-07-061-2/+2
| | | | | | | added small note regarding style insensitivity for parsing enums. the casing of the first letter is still taken into account for this function. was confused a little at first because when I read "style insensitive manner" I thought it meant casing as well and ran into a couple of `ValueError`'s because of it.
* fixes #23790; roll back instCounter properly in case of exceptions (#23802)Alexander Kernozhitsky2024-07-063-3/+17
| | | fixes #23790
* Optimize closure iterator locals (#23787)Yuriy Glukhov2024-07-037-124/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This pr redefines the relation between lambda lifting and closureiter transformation. Key takeaways: - Lambdalifting now has less distinction between closureiters and regular closures. Namely instead of lifting _all_ closureiter variables, it lifts only those variables it would also lift for simple closure, i.e. those not owned by the closure. - It is now closureiter transformation's responsibility to lift all the locals that need lifting and are not lifted by lambdalifting. So now we lift only those locals that appear in more than one state. The rest remains on stack, yay! - Closureiter transformation always relies on the closure env param created by lambdalifting. Special care taken to make lambdalifting create it even in cases when it's "too early" to lift. - Environments created by lambdalifting will contain `:state` only for closureiters, whereas previously any closure env contained it. IMO this is a more reasonable approach as it simplifies not only lambdalifting, but transf too (e.g. freshVarsForClosureIters is now gone for good). I tried to organize the changes logically by commits, so it might be easier to review this on per commit basis. Some ugliness: - Adding lifting to closureiters transformation I had to repeat this matching of `return result = value` node. I tried to understand why it is needed, but that was just another rabbit hole, so I left it for another time. @Araq your input is welcome. - In the last commit I've reused currently undocumented `liftLocals` pragma for symbols so that closureiter transformation will forcefully lift those even if they don't require lifting otherwise. This is needed for [yasync](https://github.com/yglukhov/yasync) or else it will be very sad. Overall I'm quite happy with the results, I'm seeing some noticeable code size reductions in my projects. Heavy closureiter/async users, please give it a go.
* fixes #23784; don't allow fold paths containing `nkAddr` (#23792)ringabout2024-07-032-1/+158
| | | | | | | fixes #23784 notes that before https://github.com/nim-lang/Nim/pull/23477, it didn't fold paths containing `addr`/`unsafeAddr` because it retained the form of the magic function: `mAddr`.
* This test for issue 9739 never needed to depend upon hash order (#23791)c-blake2024-07-031-2/+1
| | | | | (for `string` or any other key type). Independence is nice to ever change orders. So, change it to just `len` & a `doAssert` like the other test in the same file.
* fixes #23775; injectdestructors now handles discardable statements (#23780)ringabout2024-07-023-2/+27
| | | fixes #23775
* Fixed issues when using `std/parseopt` in miscripts with cmdline = "" (#23785)Gianmarco2024-07-021-3/+15
| | | | | | | Using initOptParser with an empty cmdline (so that it gets the cmdline from the command line) in nimscripts does not yield the expected results. Fixes #23774.
* Fix doc: '\c' '\L' in lexbase.nim (#23781)lit2024-07-011-4/+4
| | | - In lexbase.nim, `\c` `\L` were rendered as `c` `L`.
* refine: strmisc.expandTabs better code structure (#23783)lit2024-07-011-9/+6
| | | | | | | | | After this pr, for a string with just 20 length and 6 `'\t'`, the time reduces by about 1.5%[^t]. Also, the code is clearer than the previous at some places. [^t]: Generally speaking, this rate increases with length. I may test for longer string later.
* fixes #23755; array static inference during overload resolution (#23760)Ryan McConnell2024-07-013-11/+71
| | | | | | | #23755 --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Revert "Document move limitations" (#23778)Andreas Rumpf2024-07-011-1/+0
| | | | | Reverts nim-lang/Nim#23763 Too vague and fear inducing.
* fixes #5091; Ensure we don't wait on an exited process on Linux (#23743)Mark Leyva2024-07-012-0/+20
| | | | | Fixes #5091. Ensure we don't wait on an exited process on Linux
* [backport] fixes #23748; do not skip materializing temporaries for proc ↵Alexander Kernozhitsky2024-06-303-4/+48
| | | | | arguments (#23769) fixes #23748
* Comment out flaky test in tests/stdlib/thttpclient (#23772)Alexander Kernozhitsky2024-06-291-6/+6
| | | | | | | | | ``` $ curl -v http://example.com/404 |& grep 'HTTP/1.1' > GET /404 HTTP/1.1 < HTTP/1.1 500 Internal Server Error ``` So, the test with http://example.com/404 should be disabled, I think.
* Document move limitations (#23763)Juan Carlos2024-06-291-0/+1
| | | | - See https://github.com/nim-lang/Nim/issues/23759#issuecomment-2192123783
* Bumps nimble to entryPoints commit (#23766)Juan M Gómez2024-06-291-1/+1
|