| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
`readLine` proc in asyncfile module caused IndexDefect when it reached
EoF. Now it returns empty string instead.
|
|
|
|
|
|
|
|
|
|
|
| |
- 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>
|
|
|
|
|
| |
I couldn't find any documentation on the syntax for --hint:X:on|off with
`nimscript` except in [this old forum
post](https://forum.nim-lang.org/t/8526#55236).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The goal of this PR is to make `typeRel` accurate to it's definition for
generics:
```
# 3) When used with two type classes, it will check whether the types
# matching the first type class (aOrig) are a strict subset of the types matching
# the other (f). This allows us to compare the signatures of generic procs in
# order to give preferrence to the most specific one:
```
I don't want this PR to break any code, and I want to preserve all of
Nims current behaviors. I think that making this more accurate will help
serve as ground work for the future. It may not be possible to not break
anything but this is my attempt.
So that it is understood, this code was part of another PR (#22143) but
that problem statement only needed this change by extension. It's more
organized to split two problems into two PRs and this issue, being
non-breaking, should be a more immediate improvement.
---------
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
| |
fixes #22554
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- `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>
|
|
|
|
|
|
|
|
| |
have side effects (#22770)
fixes #22696
partially revert https://github.com/nim-lang/Nim/pull/16281
`join` calls `$` interally, which might introduce a sideeffect call.
|
|
|
|
|
|
|
|
|
| |
fixes #20435
---------
Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
Co-authored-by: Jake Leahy <jake@leahy.dev>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
|
|
|
|
| |
ref #19727
closes #22586
https://github.com/nim-lang/Nim/issues/22554 needs it to move on.
`newSeqUnsafe` can be introduced later.
|
|
|
|
|
| |
(#22764)
fixes #22763
|
|
|
|
|
|
|
|
|
|
| |
compiler crash (#22768)
`Foo()` below makes the compiler crash.
```nim
proc makeBoo(a:cint = 10, b:cstring = "hello", foo: Foo = Foo()): Boo {.importcpp, constructor.}
```
|
|
|
| |
ref #19727
|
|
|
|
|
|
|
|
| |
Doesn't exists anymore.
Use `window.localStorage.getItem("key").isNil` instead

|
|
|
|
|
|
|
| |
- Fix #21407
---------
Co-authored-by: Amjad Ben Hedhili <amjadhedhili@outlook.com>
|
|
|
|
| |
- Documentation only.
- Sometimes newbies try to use Valgrind with RefC etc.
|
|
|
| |
ref https://github.com/inim-repl/INim/pull/139
|
|
|
| |
- Mention Bisect bot in Bisect documentation.
|
|
|
|
| |
fixes #10542
revives and close #20169
|
|
|
|
|
| |
Closes #15351
Stumbled across the issue and found it now works
|
| |
|
|
|
| |
fixes #22706
|
|
|
| |
It's equivalent to `newString`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Support multiple OS Bisects (Linux, Windows, MacOS).
- Install Valgrind only if needed to speed up non-Valgrind builds.
- Valgrind+MacOS bisect support.
- Show IR of OK repro code samples.
- YAML only, tiny diff.
#### New features
- Bisect bugs that only reproduce on Windows and OSX.
#### See also
- https://github.com/juancarlospaco/nimrun-action/pull/10
|
|
|
|
|
|
| |
Should help with stuff like the checksums package which only takes
`openArray[char]`
Co-authored-by: SirOlaf <>
|
|
|
| |
Causes problems when working with `cstring`s.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
```nim
echo newString(8)
```
results in:
```
D:\User\test.js:25
var code_33556944 = c_33556931.toString(16);
^
TypeError: Cannot read properties of undefined (reading 'toString')
at toJSStr (D:\User\test.js:25:50)
at rawEcho (D:\User\test.js:70:16)
at Object.<anonymous> (D:\User\test.js:101:1)
at Module._compile (node:internal/modules/cjs/loader:1095:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1147:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47
Node.js v17.0.1
Error: execution of an external program failed: '"C:\Program Files\nodejs\node.exe" --unhandled-rejections=strict D:\User\test.js'
```
|
| |
|
|
|
| |
fixes #22519
|
|
|
|
| |
fixes #22246
resurrects #22350
|
|
|
| |
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
| |
- Add Atomic ARC to Documentation. Documentation only, tiny diff.
|
|
|
|
|
|
|
| |
(#22722)
…in typeMasked
fixes #22687
|
|
|
|
|
|
|
|
|
|
|
|
| |
`{.push overflowChecks: off.}` works in backends. Though it could be
implemented as a magic function.
By inspecting the generated C code, the overflow check is eliminated in
the debug or release mode.

Likewise, the index checking is probably not needed.
|
| |
|
|
|
| |
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
| |
|
|
|
|
| |
closes #8390, closes #11726, closes #8446, closes #21221, closes #7461,
closes #7995
|
|
|
| |
fixes #22726
|
| |
|
|
|
| |
fixes #22692
|
|
|
|
|
|
|
|
|
|
| |
Add descriptions for `rawProc` and `rawEnv`. See
<https://forum.nim-lang.org/t/10485> for more informations.
---------
Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
Co-authored-by: Juan Carlos <juancarlospaco@gmail.com>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
| |
see https://github.com/nim-lang/Nim/issues/22674
|
|
|
| |
fixes #22700
|
|
|
|
|
|
| |
fixes #21615; fixes #16735
It also partially fixes | #22673, though It still gives 'baseless'
warnings.
|
|
|
| |
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
refs #22605
Sym choice nodes are now only allowed to pass through semchecking if
contexts ask for them to (with `efAllowSymChoice`). Otherwise they are
resolved or treated as ambiguous. The contexts that can receive
symchoices in this PR are:
* Call operands and addresses and emulations of such, which will subject
them to overload resolution which will resolve them or fail.
* Type conversion operands only for routine symchoices for type
disambiguation syntax (like `(proc (x: int): int)(foo)`), which will
resolve them or fail.
* Proc parameter default values both at the declaration and during
generic instantiation, which undergo type narrowing and so will resolve
them or fail.
This means unless these contexts mess up sym choice nodes should never
leave the semchecking stage. This serves as a blueprint for future
improvements to intermediate symbol resolution.
Some tangential changes are also in this PR:
1. The `AmbiguousEnum` hint is removed, it was always disabled by
default and since #22606 it only started getting emitted after the
symchoice was soundly resolved.
2. Proc setter syntax (`a.b = c` becoming `` `b=`(a, c) ``) used to
fully type check the RHS before passing the transformed call node to
proc overloading. Now it just passes the original node directly so proc
overloading can deal with its typechecking.
|
|
|
|
|
|
|
| |
Close #22713
---------
Co-authored-by: SirOlaf <>
|
|
|
| |
fixes #22699
|
|
|
| |
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
|
|
| |
-
https://github.com/nim-lang/Nim/actions/runs/6187256704/job/16796720625#step:4:29
- https://github.com/nim-lang/Nim/issues/22699
|