summary refs log tree commit diff stats
path: root/lib/std
Commit message (Collapse)AuthorAgeFilesLines
* Silence several Hint[Performance] warnings (#23003)c-blake2023-11-291-1/+1
| | | | With `--mm:arc` one gets the "implicit copy; if possible, rearrange your program's control flow" `Performance` warnings without these `move`s.
* reserve `sysFatal` for `Defect` (#22158)Jacek Sieka2023-11-061-9/+6
| | | | | | | | 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.
* complete std prefixes for stdlib (#22887)ringabout2023-10-3035-52/+52
| | | | follow up https://github.com/nim-lang/Nim/pull/22851 follow up https://github.com/nim-lang/Nim/pull/22873
* explicitly import using `std/` in `tempfiles.nim` (#22851)Vindaar2023-10-201-1/+1
| | | | | 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).
* fixes #22844; uses arrays to store holeyenums for iterations; much more ↵ringabout2023-10-201-1/+1
| | | | | efficient than sets and reasonable for holeyenums (#22845) fixes #22844
* NIR: Nim intermediate representation (#22777)Andreas Rumpf2023-10-111-15/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* document `atomicInc` and `atomicDec` (#22789)ringabout2023-10-041-0/+2
|
* copyFile with POSIX_FADV_SEQUENTIAL (#22776)Juan Carlos2023-10-011-0/+8
| | | | | | | | | | | - 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-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - `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>
* make parseEnum skip type aliases for enum type sym (#22727)metagn2023-09-191-1/+2
| | | fixes #22726
* Update osfiles.nim, make `moveFile` consider permission on *nix (#22719)litlighilit2023-09-181-1/+1
| | | see https://github.com/nim-lang/Nim/issues/22674
* fixes incorrect cint overflow in system (#22718)ringabout2023-09-181-1/+1
| | | fixes #22700
* allow tuples and procs in 'toTask' + minor things (#22530)Andreas Rumpf2023-08-221-1/+1
|
* Add staticFileExists and staticDirExists (#22278)Tomohiro2023-08-181-0/+13
|
* fixes syncio document (#22498)Nan Xiao2023-08-171-2/+2
|
* Markdown code blocks migration part 8 (#22478)Andrey Makarov2023-08-155-52/+57
|
* fixes CI (#22471)ringabout2023-08-142-3/+3
| | | | | Revert "fixes bareExcept warnings; catch specific exceptions (#21119)" This reverts commit 9207d77848d6f5db3635ae64f3cd4972cdbe3296.
* fixes syncio document (#22467)Nan Xiao2023-08-141-2/+2
|
* fixes bareExcept warnings; catch specific exceptions (#21119)ringabout2023-08-132-3/+3
| | | | | * fixes bareExcept warnings; catch specific exceptions * Update lib/pure/coro.nim
* replace `doAssert false` with `raiseAssert` in lib, which works better with ↵ringabout2023-08-118-14/+14
| | | | strictdefs (#22458)
* clean up `gc:arc` or `gc:orc` in docs and in error messages (#22408)ringabout2023-08-081-2/+2
| | | | | * clean up gc:arc/orc in docs * in error messages
* use strictdefs for compiler (#22365)ringabout2023-08-061-0/+1
| | | | | | | | | | | | | | | * wip; use strictdefs for compiler * checkpoint * complete the chores * more fixes * first phase cleanup * Update compiler/bitsets.nim * cleanup
* Prevent early destruction of gFuns, fixes AddressSanitizer: ↵norrath-hero-cn2023-08-051-1/+1
| | | | | heap-use-after-free (#22386) Prevent destruction of gFuns before callClosures
* Revert adding generic `V: Ordinal` parameter to `succ`, `pred`, `inc`, `dec` ↵konsumlamm2023-08-063-11/+11
| | | | | | | (#22328) * Use `int` in `digitsutils`, `dragonbox`, `schubfach` * Fix error message
* Fix searchExtPos so that it returns -1 when the path is not a file ext (#22245)Tomohiro2023-08-041-4/+17
| | | | | | | * Fix searchExtPos so that it returns -1 when the path is not a file ext * fix comparision expression * Remove splitDrive from searchExtPos
* Remove declared and not used variable in packedsets.bitincl (#22334)Eric N. Vander Weele2023-07-271-1/+0
| | | | When compiling code that uses PackedSet with warnings enabled, `var ret` in `bitincl` emits a "XDeclaredButNotUsed" warning.
* fixes #22163; use `{.push warning[BareExcept]:off.}` to override settings ↵ringabout2023-06-271-2/+2
| | | | | | | temporarily (#21390) * use `{.push warning[BareExcept]:off.}` to override settings temporarily * likewise, suppress expect
* allow destructors to accept non var parameters; deprecate `proc =destroy(x: ↵ringabout2023-06-212-12/+28
| | | | | | | | | | var T)` (#22130) * make destructors accept non var parameters * define nimAllowNonVarDestructor * add a test case and a changelog * update documentation and error messages * deprecate destructors taking 'var T'
* avoid `AnyEnumConv` warning in `genEnumCaseStmt` (#22061)Etan Kissling2023-06-101-10/+11
| | | | | | | When parsing enums from strings using `genEnumCaseStmt`, `AnyEnumConv` warnings are generated due to conversion from integer value. It seems possible meanwhile to refer to the actual `enum` value by symbol instead of being required to do the conversion from `ord`, even when the `enum` is defined in a `block`.
* Remove debug echo from with (#22047)Antonis Geralis2023-06-081-1/+0
|
* Nested `with` blocks (#22042)awr12023-06-082-6/+24
| | | | | * Implemented with-nesting in underscoredCalls() * Add tests for nested with
* fixes #21977; add sideEffects to dirExists, fileExists and symlinkExists ↵ringabout2023-06-014-6/+6
| | | | (#21978)
* Implements: [C++] constructor pragma improvement (fix #21921) (#21916)Juan M Gómez2023-05-302-4/+4
| | | | | | | | | | | | | | | * implements: [C++] constructor pragma improvement (fix #21921) t * fix test so it doesnt use echo in globals * Update compiler/ccgtypes.nim * Update lib/std/private/dragonbox.nim --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Suggest files and paths modules (#21950)Federico Ceratto2023-05-292-0/+6
|
* js -r defines nodejs & program result undeclared if unavailable (#21849)metagn2023-05-241-7/+3
| | | | | | | | | | | * js -r defines nodejs & program result undefined if unavailable fixes #16985, fixes #16074 * fix * add changelog too * minor word change
* tasks that support return values (#21859)Andreas Rumpf2023-05-171-25/+35
| | | tasks.nim: Code cleanups and support expressions that produce a value
* isolation spec update; WIP (#21843)Andreas Rumpf2023-05-141-3/+3
| | | | | | | | | | | * isolation spec update; WIP * wip * docs update, WIP * progress * Update doc/manual.md
* add getDataDir to std/appdirs.nim (#21754)Ecorous2023-05-121-0/+17
| | | | | | | | | | | * add getDataDir to std/appdirs.nim * reuse `osappdirs.getDataDir` * Update lib/std/appdirs.nim --------- Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* clean up SOME pending/xxx/issue link comments (#21826)metagn2023-05-116-13/+15
| | | | | * clean up SOME pending/xxx/issue link comments * great
* fix #9423 followup #17594: distinct generics now work in VM (#21816)ringabout2023-05-101-6/+1
| | | | | | | | | * fix #9423 distinct generics now work in vm * fixes cpp tests --------- Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
* fixes #19863; move sha1, md5 to nimble packages for 2.0 (#21702)ringabout2023-05-021-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * move sha1, md5 to nimble packages * boot the compiler * fixes tests * build the documentation * fixes docs * lol, I forgot koch.nim * add `nimHasChecksums` define * clone checksums but maybe copying is better * bump nimble hash * use ChecksumsStableCommit * fixes tests * deprecate them * fixes paths * fixes koch
* refact: Remove assertion effect hiding workaround (#21472)quantimnot2023-04-211-6/+1
| | | | | | | | refact: Remove asseertion effect hiding workaround There was a code comment to remove after bootstrapping with `nim >= 1.4.0`. Co-authored-by: quantimnot <quantimnot@users.noreply.github.com> Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* static link pthread correctly (#21693)ringabout2023-04-201-2/+0
|
* fixes nightlies regression (#21689)ringabout2023-04-191-2/+1
| | | | | | | | | | | | * fixes nightlies regression ref https://github.com/nim-lang/Nim/pull/21659 ref https://github.com/nim-lang/nightlies/actions/runs/4727252660/jobs/8387899690 > /home/runner/work/nightlies/nightlies/nim-1.9.3/lib/std/sysrand.nim(198, 12) Error: cannot evaluate at compile time: EINTR Because EINTR is not a const on i386 * Update lib/std/sysrand.nim
* warn on set types bigger than max size, default to 0..255 for int literals ↵metagn2023-04-171-2/+2
| | | | | | | | | | | | | | | | | | | (#21659) * test implicitly huge set types refs https://github.com/nim-lang/RFCs/issues/298 * oh my god * boot at least * don't error, fix remaining issues, no 2 len arrays * fix runnable example * test assuming 0..255 for int literal * test refactor, add changelog, test
* fixes #18146; fixes #19372; disable tlsEmulation on windows; static link ↵ringabout2023-04-141-0/+4
| | | | | | | pthreads with mingw (#21668) * fixes #18146; disable tlsEmulation on windows; static link libwinthreads DLL * whatever
* int64/uint64 as bigint in JS (#21613)metagn2023-04-113-4/+19
| | | | | | | | | | | * int64/uint64 as bigint in JS * fix CI * convert to compile option * fix lie * smaller diff, changelog entry
* fixes #21638; `fromJson` should support empty objects (#21641)ringabout2023-04-111-11/+16
| | | | | * fixes #21638; `fromJson` should supports empty objects * complete the logic
* remove useVersion (#21626)metagn2023-04-081-1/+1
| | | test removing useVersion
* remove decades-deprecated Win32 API *A function support (#21315)tersec2023-03-027-129/+54
|
rtik K. Agaram <vc@akkartik.com> 2016-12-26 20:44:10 -0800 committer Kartik K. Agaram <vc@akkartik.com> 2016-12-26 20:58:37 -0800 3713 - cross-link calls with definitions in html' href='/akkartik/mu/commit/html/032array.cc.html?h=hlt&id=201458e3bd2f1d79a0ea0b853552e9df267e92b1'>201458e3 ^
204dae92 ^

201458e3 ^
204dae92 ^


201458e3 ^

204dae92 ^

201458e3 ^
204dae92 ^

201458e3 ^
204dae92 ^
201458e3 ^
204dae92 ^
201458e3 ^

204dae92 ^

201458e3 ^
204dae92 ^

201458e3 ^
204dae92 ^


201458e3 ^

204dae92 ^
201458e3 ^
204dae92 ^

201458e3 ^
204dae92 ^

201458e3 ^
204dae92 ^
201458e3 ^
204dae92 ^
201458e3 ^

204dae92 ^
201458e3 ^
204dae92 ^

201458e3 ^
204dae92 ^

201458e3 ^
204dae92 ^
201458e3 ^
204dae92 ^
201458e3 ^

204dae92 ^
201458e3 ^
204dae92 ^




201458e3 ^
204dae92 ^








201458e3 ^

204dae92 ^


201458e3 ^
204dae92 ^



201458e3 ^
204dae92 ^











201458e3 ^
204dae92 ^

201458e3 ^
9e751bb8 ^

204dae92 ^



9e751bb8 ^

204dae92 ^



9e751bb8 ^

204dae92 ^




201458e3 ^
204dae92 ^
9e751bb8 ^

204dae92 ^







fd7d8138 ^
204dae92 ^
9e751bb8 ^

204dae92 ^



201458e3 ^
9e751bb8 ^

204dae92 ^

201458e3 ^
598f1b53 ^
fd7d8138 ^

204dae92 ^





201458e3 ^
204dae92 ^


201458e3 ^
204dae92 ^

9e751bb8 ^
204dae92 ^

9e751bb8 ^
204dae92 ^

201458e3 ^
9e751bb8 ^

204dae92 ^



201458e3 ^
204dae92 ^


9e751bb8 ^


204dae92 ^

201458e3 ^
204dae92 ^


201458e3 ^





9e751bb8 ^
201458e3 ^
204dae92 ^

201458e3 ^
204dae92 ^
201458e3 ^
204dae92 ^


201458e3 ^
204dae92 ^










201458e3 ^
204dae92 ^








201458e3 ^
204dae92 ^


201458e3 ^
204dae92 ^








201458e3 ^
204dae92 ^


201458e3 ^
204dae92 ^








201458e3 ^
204dae92 ^



201458e3 ^
204dae92 ^










201458e3 ^
204dae92 ^










201458e3 ^
204dae92 ^

201458e3 ^
9e751bb8 ^

204dae92 ^



9e751bb8 ^

204dae92 ^



9e751bb8 ^

204dae92 ^



201458e3 ^
204dae92 ^
9e751bb8 ^

204dae92 ^


9e751bb8 ^

204dae92 ^









9e751bb8 ^

204dae92 ^



201458e3 ^
9e751bb8 ^

204dae92 ^
201458e3 ^
fd7d8138 ^
204dae92 ^



201458e3 ^
9e751bb8 ^

204dae92 ^





201458e3 ^
204dae92 ^









201458e3 ^
204dae92 ^


201458e3 ^
204dae92 ^









201458e3 ^
204dae92 ^


201458e3 ^
204dae92 ^




201458e3 ^
204dae92 ^



201458e3 ^
204dae92 ^










201458e3 ^
204dae92 ^

201458e3 ^
9e751bb8 ^

204dae92 ^



9e751bb8 ^

204dae92 ^







9e751bb8 ^

204dae92 ^

201458e3 ^
204dae92 ^





201458e3 ^
204dae92 ^

672e3e50 ^


a654e4ec ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714