| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
At least on modern Nim `tempfiles` is not usable if the user has
https://github.com/oprypin/nim-random installed, because the compiler
picks the nimble path over the stdlib path (apparently).
|
|
|
|
|
| |
efficient than sets and reasonable for holeyenums (#22845)
fixes #22844
|
|
|
|
|
|
|
| |
fix #22834
Edit: also fixes `result.addrList` when IPv6, which previously only
performed a `result.addrList = cstringArrayToSeq(s.h_addr_list)` which
does not provide the textual representation of an IPv6
|
|
|
|
|
|
|
| |
(#22837)
… enabled
fixes #22836
|
| |
|
|
|
|
|
| |
(#22822)
…s of a patent-pending new VM
|
|
|
|
|
|
| |
Done:
- [x] Implement conversions to openArray/varargs.
- [x] Implement index/range checking.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Theoretical Benefits / Plans:
- Typed assembler-like language.
- Allows for a CPS transformation.
- Can replace the existing C backend by a new C backend.
- Can replace the VM.
- Can do more effective "not nil" checking and static array bounds
checking.
- Can be used instead of the DFA.
- Easily translatable to LLVM.
- Reasonably easy to produce native code from.
- Tiny memory consumption. No pointers, no cry.
**In very early stages of development.**
Todo:
- [x] Map Nim types to IR types.
- [ ] Map Nim AST to IR instructions:
- [x] Map bitsets to bitops.
- [ ] Implement string cases.
- [ ] Implement range and index checks.
- [x] Implement `default(T)` builtin.
- [x] Implement multi string concat.
- [ ] Write some analysis passes.
- [ ] Write a backend.
- [x] Integrate into the compilation pipeline.
|
|
|
|
|
|
|
| |
(#22813)
…t holes
fixes #22790
|
|
|
| |
ref https://forum.nim-lang.org/t/10525
|
|
|
|
|
|
|
|
|
|
|
| |
This would be handy for making terminal apps which display content below
the prompt (e.g. `fzf` does this).
Need to test it on windows before I remove "draft" status.
---------
Co-authored-by: Matt Rixman <MatrixManAtYrService@users.noreply.github.com>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
|
| |
It's not used in the compiler, besides, it doesn't seem to be a common
operation. Follows the discussion on the Discord.
|
|
|
|
|
| |
fixes #22711
Per @elcritch's awesome solution
|
| |
|
|
|
|
| |
fixes #22778
follow up https://github.com/nim-lang/Nim/pull/19835
|
|
|
|
| |
`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).
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
ref #19727
closes #22586
https://github.com/nim-lang/Nim/issues/22554 needs it to move on.
`newSeqUnsafe` can be introduced later.
|
|
|
| |
ref #19727
|
|
|
|
|
|
|
|
| |
Doesn't exists anymore.
Use `window.localStorage.getItem("key").isNil` instead
![Screenshot from 2023-09-28
07-22-41](https://github.com/nim-lang/Nim/assets/74574275/65d58921-58c7-4a81-9f3b-5faa3a79c4f2)
|
|
|
|
|
|
|
| |
- Fix #21407
---------
Co-authored-by: Amjad Ben Hedhili <amjadhedhili@outlook.com>
|
|
|
| |
It's equivalent to `newString`.
|
|
|
|
|
|
| |
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
|
|
|
| |
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
|
|
|
|
| |
(#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.
![image](https://github.com/nim-lang/Nim/assets/43030857/49c3dbf4-675e-414a-b972-b91cf218c9f8)
Likewise, the index checking is probably not needed.
|
|
|
| |
fixes #22726
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
| |
followup of #19771.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* `PrepareSeqAdd`
* `add`
* `setLen`
* `grow`
Merge after #21842.
---------
Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
|
|
|
|
|
|
|
| |
It's used in `newSeqUninitialized`.
---------
Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
|
|
|
| |
fixes #22664
|
|
|
|
|
|
|
|
| |
* `prepareAdd`
* `toNimStr`
* `setLengthStrV2`
* `NimAsgnStrV2`
* `prepareMutation`
* Some cleanups
|
|
|
| |
Needed for #21842.
|
|
|
|
|
|
|
|
|
|
| |
This implements Pandoc Markdown-style footnotes,
that are compatible with Pandoc referencing syntax:
Ref. [^ftn].
[^ftn]: Block.
See https://pandoc.org/MANUAL.html#footnotes for more examples.
|
|
|
|
|
|
|
|
|
|
|
| |
instead (#22576)
* deprecate `std/threadpool`; use `malebolgia` instead
* Apply suggestions from code review
* Apply suggestions from code review
* change the URL of inim
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fixes newStringUninitialized; implement `newStringUninitialized`
* add a simple test case
* adds a changelog
* Update lib/system.nim
* Apply suggestions from code review
rename to newStringUninit
|
|
|
|
|
| |
ref https://github.com/nim-lang/nightlies/actions/runs/5970369118/job/16197865657
> /home/runner/work/nightlies/nightlies/nim/lib/pure/os.nim(678, 30) Error: getApplOpenBsd() can raise an unlisted exception: ref OSError
|