summary refs log tree commit diff stats
path: root/lib/system
Commit message (Collapse)AuthorAgeFilesLines
* fixes #22852; real bugfix is tied to bug #22672 (#23013)Andreas Rumpf2023-11-301-1/+4
|
* 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/+5
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* reserve `sysFatal` for `Defect` (#22158)Jacek Sieka2023-11-062-8/+8
| | | | | | | | Per manual, `panics:on` affects _only_ `Defect`:s - thus `sysFatal` should not redirect any other exceptions. Also, when `sysFatal` is used in `nimPanics` mode, it should use regular exception handling pipeline to ensure exception hooks are called consistently for all raised defects.
* fixes #22860; suppress `AnyEnumConv` warning when iterating over set (#22904)ringabout2023-11-041-1/+4
| | | fixes #22860
* complete std prefixes for stdlib (#22887)ringabout2023-10-303-3/+3
| | | | follow up https://github.com/nim-lang/Nim/pull/22851 follow up https://github.com/nim-lang/Nim/pull/22873
* NIR: VM + refactorings (#22835)Andreas Rumpf2023-10-291-2/+2
|
* NIR: store sizes, alignments and offsets in the type graph; beginning… ↵Andreas Rumpf2023-10-162-1/+4
| | | | | (#22822) …s of a patent-pending new VM
* NIR: progress (#22817)Andreas Rumpf2023-10-121-0/+3
| | | | | | Done: - [x] Implement conversions to openArray/varargs. - [x] Implement index/range checking.
* NIR: Nim intermediate representation (#22777)Andreas Rumpf2023-10-115-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* fixes #22790; use cast suppress AnyEnumConv warnings for enums withou… ↵ringabout2023-10-111-4/+13
| | | | | | | (#22813) …t holes fixes #22790
* fixes #22711; Check atomicArc for atomic destroy race condition (#22788)ringabout2023-10-041-8/+15
| | | | | fixes #22711 Per @elcritch's awesome solution
* docs: add another switch example for nimscript (#22772)daylin2023-09-301-0/+1
| | | | | 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).
* deprecates `newSeqUninitialized` replaced by `newSeqUninit` (#22739)ringabout2023-09-291-2/+0
| | | | | | | ref #19727 closes #22586 https://github.com/nim-lang/Nim/issues/22554 needs it to move on. `newSeqUnsafe` can be introduced later.
* ref #19727; implement `setLenUninit` for seqsv2 (#22767)ringabout2023-09-281-0/+24
| | | ref #19727
* Initialize `newString` in js [backport:1.6] (#22745)Amjad Ben Hedhili2023-09-231-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | ```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' ```
* items, pairs and friends now use `unCheckedInc` (#22729)ringabout2023-09-201-26/+31
| | | | | | | | | | | | `{.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.
* Fix `capacity` for const and shallow [backport] (#22705)Amjad Ben Hedhili2023-09-183-4/+4
|
* followup of #22568 (#22690)Amjad Ben Hedhili2023-09-141-24/+17
|
* Make capacity work with refc [backport] (#22697)Amjad Ben Hedhili2023-09-133-11/+26
| | | followup of #19771.
* Remove some unnecessary initialization in `seq` operations (#22677)Amjad Ben Hedhili2023-09-101-7/+35
| | | | | | | | | | | | * `PrepareSeqAdd` * `add` * `setLen` * `grow` Merge after #21842. --------- Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* Make `newSeqOfCap` not initialize memory. (#21842)Amjad Ben Hedhili2023-09-092-2/+11
| | | | | | | It's used in `newSeqUninitialized`. --------- Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* fixes #22664; guard against potential seqs self assignments (#22671)ringabout2023-09-081-0/+6
| | | fixes #22664
* Remove some unnecessary initialization in string operations (#22579)Amjad Ben Hedhili2023-09-071-37/+61
| | | | | | | | * `prepareAdd` * `toNimStr` * `setLengthStrV2` * `NimAsgnStrV2` * `prepareMutation` * Some cleanups
* newStringOfCap now won't initialize all elements anymore (#22568)ringabout2023-08-281-2/+3
| | | newStringOfCap nows won't initialize all elements anymore
* Markdown code blocks migration part 9 (#22506)Amjad Ben Hedhili2023-08-192-13/+13
| | | | | * Markdown code blocks migration part 9 * fix [skip ci]
* Fix `seq.capacity` (#22488)Amjad Ben Hedhili2023-08-171-2/+2
|
* fixes #22481; fixes `card` undefined misalignment behavior (#22484)ringabout2023-08-151-1/+3
| | | | | | | | | * fixes `card` undefined misalignment behavior * Update lib/system/sets.nim --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Markdown code blocks migration part 8 (#22478)Andrey Makarov2023-08-155-47/+51
|
* clean up `gc:arc` or `gc:orc` in docs and in error messages (#22408)ringabout2023-08-083-9/+9
| | | | | * clean up gc:arc/orc in docs * in error messages
* Revert adding generic `V: Ordinal` parameter to `succ`, `pred`, `inc`, `dec` ↵konsumlamm2023-08-061-5/+5
| | | | | | | (#22328) * Use `int` in `digitsutils`, `dragonbox`, `schubfach` * Fix error message
* Make `repr(HSlice)` always available (#22332)konsumlamm2023-08-041-10/+0
| | | Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* bump the devel version to 211 (#22356)ringabout2023-08-011-3/+3
|
* fixes #22262; fixes `-d:useMalloc` broken with `--mm:none` and `--threads ↵ringabout2023-08-011-1/+1
| | | | | | | on` (#22355) * fixes #22262; -d:useMalloc broken with --mm:none and threads on * fixes
* remove thread duplicated code (#22348)Bung2023-07-311-5/+0
|
* fixes #22256; fixes GC_disableOrc overflow (#22257)ringabout2023-07-111-1/+1
|
* Rename `seq.add` parameter to be consistent with `refc` (#22244)Solitude2023-07-101-2/+2
|
* Fix #21401 (#22232)Juan Carlos2023-07-071-0/+8
|
* uint arithmetic for pointers (#22159)Jacek Sieka2023-06-272-2/+2
| | | | | | | pointers are not signed and arithmetic may correctly cross int.max threshold this PR only fixes 2 occurances - there are plenty however in the std lib
* rm zero-extension and uint conversions deprecated since 0.19.9 (#22151)tersec2023-06-251-56/+0
|
* added new experimental API isUniqueRef (#21812)Andreas Rumpf2023-06-161-0/+12
| | | | | * added new experimental API isUniqueRef * typo
* bump NimVersion to 1.9.5 (#22112)Miran2023-06-161-1/+1
|
* small fixes for atomicArc (#22017)ringabout2023-06-062-3/+3
| | | | | * small fixes for atomicArc * Update lib/system/arc.nim
* lift the `=dup` hook (#21903)ringabout2023-06-021-4/+0
| | | | | | * fixes tests again * remove helper functions * fixes closures, owned refs * final cleanup
* fixes fieldDefect loses enum type info in ORC; consistent with VM and refc ↵ringabout2023-05-291-0/+4
| | | | | (#21954) fixes fieldDefect loses enum type info in ORC
* Remove GC (#21904)Juan Carlos2023-05-251-749/+0
| | | | | * . * Remove GC v2
* fixes #21847; let `parseFloat` behave like `strtod` (#21854)ringabout2023-05-171-1/+3
|
* make ORC threadlocal, take two (#21818)Andreas Rumpf2023-05-101-6/+6
| | | | | * ORC: make rootsThreshold thread local [backport] * fixes the regression
* fix nimrtl and nimhcr on arc/orc (#21814)metagn2023-05-093-4/+4
| | | | | | | | | | | * fix/workaround for nimrtl and nimhcr on arc/orc fixes #21803 * try fix clang, debug linux failure * just make duplicated procs not rtl * actual fix for duplicated procs
* Improve and refactor cellseqs_v2 in Nim standard library (#21796)Jordan Gillard2023-05-091-13/+10
| | | | | | | | | | | * Refactor and optimize cellseqs_v2 in Nim standard library * Extract resizing logic into a separate 'resize' procedure for better readability and separation of concerns * Implement realloc for non-threaded cases to improve memory operations efficiency * Use ',' instead of ';' between parameters in 'add' procedure for consistency with other Nim code * Respond to Araq's feedback: Refactor resize function to use reallocShared This commit replaces the usage of allocShared and deallocShared with reallocShared to optimize memory allocation and deallocation while resizing the CellSeq.