summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
* adds C++ features to change log (#22906)Juan M Gómez2023-11-031-0/+3
| | | | Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: Juan Carlos <juancarlospaco@gmail.com>
* fixes #22866; fixes #19998; ensure destruction for Object construction with ↵ringabout2023-11-023-11/+19
| | | | | | custom destructors (#22901) fixes #22866; fixes #19998
* Fix `IndexDefect` errors in httpclient on invalid/weird headers (#22886)Yardanico2023-11-012-11/+26
| | | | | | | | | | | | | | | | | | | | | Continuation of https://github.com/nim-lang/Nim/pull/19262 Fixes https://github.com/nim-lang/Nim/issues/19261 The parsing code is still too lenient (e.g. it will happily parse header names with spaces in them, which is outright invalid by the spec), but I didn't want to touch it beyond the simple changes to make sure that `std/httpclient` won't throw `IndexDefect`s like it does now on those cases: - Multiline header values - No colon after the header name - No value after the header name + colon One question remains - should I keep `toCaseInsensitive` exported in `httpcore` or just copy-paste the implementation? --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* fixes #22883; replace `default(typeof(` with `reset`; suppress `Unsaf… ↵ringabout2023-11-014-7/+11
| | | | | | | | | | | | | | | | | | | | | | | (#22895) fixes #22883 …eDefault` warnings avoid issues mentioned by https://forum.nim-lang.org namely, it allocated unnecessary stack objects in the loop ```c while (1) { tyObject_N__8DSNqSGSHBKOhI8CqSgAow T5_; nimZeroMem((void *)(&T5_), sizeof(tyObject_N__8DSNqSGSHBKOhI8CqSgAow)); eqsink___test4954_u450((&(*t_p0).data.p->data[i].Field1), T5_); } ``` It might be more efficient in some cases follow up https://github.com/nim-lang/Nim/pull/21821
* so close... (#22885)Andreas Rumpf2023-10-317-159/+255
|
* minor fixes for node20 (#22894)ringabout2023-10-312-3/+3
|
* bump node to 20.x; since 16.x is End-of-Life (#22892)ringabout2023-10-303-9/+9
|
* fixes nightlies; fixes incompatible types with csource_v2 (#22889)ringabout2023-10-301-3/+3
| | | | | | | | | | ref https://github.com/nim-lang/nightlies/actions/runs/6686795512/job/18166625042#logs > /home/runner/work/nightlies/nightlies/nim/compiler/nir/nirvm.nim(163, 35) Error: type mismatch: got 'BiggestInt' for 'b.m.lit.numbers[litId(b.m.types.nodes[int(y)])]' but expected 'int' Or unifies the type in one way or another
* complete std prefixes for stdlib (#22887)ringabout2023-10-30142-275/+277
| | | | follow up https://github.com/nim-lang/Nim/pull/22851 follow up https://github.com/nim-lang/Nim/pull/22873
* NIR: progress (#22884)Andreas Rumpf2023-10-293-19/+96
|
* prepare for the enforcement of `std` prefix (#22873)ringabout2023-10-2988-149/+244
| | | follow up https://github.com/nim-lang/Nim/pull/22851
* NIR: VM + refactorings (#22835)Andreas Rumpf2023-10-2911-649/+1538
|
* Fix #22862 - change the httpclient user-agent to be valid spec-wise (#22882)Yardanico2023-10-292-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Per https://datatracker.ietf.org/doc/html/rfc9110#name-user-agent a User-Agent is defined as follows: ``` User-Agent = product *( RWS ( product / comment ) ) ``` Where ``` product = token ["/" product-version] product-version = token ``` In this case, `token` is defined in RFC 7230 - https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6: ``` token = 1*tchar tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA ; any VCHAR, except delimiters ``` or, in the original RFC 2616 - https://datatracker.ietf.org/doc/html/rfc2616#section-2.2 (next page): ``` token = 1*<any CHAR except CTLs or separators> separators = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\" | <"> | "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT ``` which means that a `token` cannot have whitespace. Not sure if this should be in the breaking changelog section - theoretically, some clients might've relied on the old Nim user-agent? For some extra info, some other languages seem to have adopted the same hyphen user agent to specify the language + module, e.g.: - https://github.com/python/cpython/blob/main/Lib/urllib/request.py#L1679 (`Python-urllib/<version>`) Fixes #22862.
* build documentation for `htmlparser` (#22879)ringabout2023-10-271-1/+4
| | | | | | I have added a note for installment https://github.com/nim-lang/htmlparser/pull/5 > In order to use this module, run `nimble install htmlparser`.
* fixes #22868; fixes `std/nre` leaks under ARC/ORC (#22872)ringabout2023-10-271-0/+2
| | | fixes #22868
* deprecate htmlparser (#22870)ringabout2023-10-262-0/+3
| | | | | | | | | ref https://github.com/nim-lang/Nim/pull/22848 see also https://github.com/nim-lang/htmlparser will build the documentation later when everything else is settled --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* fixes #22867; fixes cstring modification example on Nim Manual (#22871)ringabout2023-10-261-1/+2
| | | fixes #22867
* doc: fix typos (#22869)shuoer862023-10-254-5/+5
| | | doc: fix typos
* fixes #22856; enables `-d:nimStrictDelete` (#22858)ringabout2023-10-242-5/+2
| | | | | | | | fixes #22856 `-d:nimStrictDelete` is introduced in 1.6.0, which promised to be enabled in the coming versions. To keep backwards incompatibilities, it also extends the feature of `-d:nimAuditDelete`, which now mimics the old behaviors.
* fixes `system.delete` that raises defects (#22857)ringabout2023-10-231-1/+1
|
* fix use after free (#22854)握猫猫2023-10-231-2/+2
| | | | | | 1. `freeAddrInfo` is called prematurely, the variable `myAddr` is still in use 2. Use defer syntax to ensure that `freeAddrInfo` is also called on exceptions
* C++: ptr fields now pulls the whole type if it's a member in nkDotExpr (#22855)Juan M Gómez2023-10-233-1/+24
|
* Fix #22826: Don't skip generic instances in type comparison (#22828)SirOlaf2023-10-212-4/+12
| | | | | | | | | | | | | | Close #22826 I am not sure why this code skips generic insts, so letting CI tell me. Update: It has told me nothing. Maybe someone knows during review. Issue itself seems to be that the generic instance is skipped thus it ends up being just `float` which makes it use the wrong generic instance of the proc because it matches the one in cache --------- Co-authored-by: SirOlaf <>
* 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-202-1/+17
| | | | | efficient than sets and reasonable for holeyenums (#22845) fixes #22844
* fix #22834 (#22843)rockcavera2023-10-201-9/+38
| | | | | | | 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
* Bisect default Linux (#22840)Juan Carlos2023-10-181-0/+5
| | | | | | | | | | | | - Bisect default to Linux only. Tiny diff, YAML only. | OS | How to? | |----|---------| | Linux | `-d:linux` | | Windows | `-d:windows` | | OS X | `-d:osx` | If no `-d:linux` nor `-d:windows` nor `-d:osx` is used then defaults to Linux.
* fixes #22836; Unnecessary warning on 'options.none' with 'strictDefs'… ↵ringabout2023-10-181-1/+1
| | | | | | | (#22837) … enabled fixes #22836
* NIR: temporary ID generation bugfix (#22830)Andreas Rumpf2023-10-165-44/+61
|
* the compiler can be compiled with vcc (#22832)Juan M Gómez2023-10-161-1/+1
|
* closes #16919; followup #16820, test tsugar on all backends (#22829)ringabout2023-10-161-8/+8
| | | | closes #16919 followup #16820
* NIR: store sizes, alignments and offsets in the type graph; beginning… ↵Andreas Rumpf2023-10-1622-387/+1389
| | | | | (#22822) …s of a patent-pending new VM
* Update readme.md (#22827)Himaj Patil2023-10-151-3/+5
| | | Added table view in Compiling section of documentation
* fixes #19250; fixes #22259; ORC AssertionDefect not ↵ringabout2023-10-132-0/+55
| | | | | | | | | | | containsManagedMemory(n.typ) (#22823) fixes #19250 fixes #22259 The strings, seqs, refs types all have this flag, why should closures be treated differently? follow up https://github.com/nim-lang/Nim/pull/14336
* fixes #22354; Wrong C++ codegen for default parameter values in ORC (#22819)ringabout2023-10-132-30/+49
| | | | | | fixes #22354 It skips `nkHiddenAddr`. No need to hoist `var parameters` without side effects. Besides, it saves lots of temporary variables in ORC.
* NIR: progress (#22817)Andreas Rumpf2023-10-1216-101/+281
| | | | | | Done: - [x] Implement conversions to openArray/varargs. - [x] Implement index/range checking.
* update nimble (#22814)ringabout2023-10-111-1/+1
| | | | | | | | | | Issues like https://github.com/nim-lang/nimble/issues/1149 keep popping up. One way or another, we should alleviate the pain. Finally, we should consider https://github.com/nim-lang/nimble/pull/1141#discussion_r1316829521 as an option using some kind of cron script to update https://nim-lang.org/nimble/packages.json. It's turning into a really annoying problem.
* Import std/stackframes in ast2ir.nim (#22815)SirOlaf2023-10-111-0/+3
| | | | | Ref https://github.com/nim-lang/Nim/pull/22777#issuecomment-1758090410 Co-authored-by: SirOlaf <>
* NIR: Nim intermediate representation (#22777)Andreas Rumpf2023-10-1135-122/+4009
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-113-4/+16
| | | | | | | (#22813) …t holes fixes #22790
* use lent for the return value of index accesses of tables (#22812)ringabout2023-10-111-2/+2
| | | ref https://forum.nim-lang.org/t/10525
* suppress incorrect var T destructor warnings for newFinalizer in stdlib (#22810)ringabout2023-10-112-3/+5
| | | | | | | | | | | | in `std/nre` ```nim proc initRegex(pattern: string, flags: int, study = true): Regex = new(result, destroyRegex) ``` gives incorrect warnings like ``` C:\Users\blue\Documents\Nim\lib\impure\nre.nim(252, 6) Error: A custom '=destroy' hook which takes a 'var T' parameter is deprecated; it should take a 'T' parameter [Deprecated ```
* allows cast int to bool/enum in VM (#22809)ringabout2023-10-111-2/+2
| | | | | Since they are integer types, by mean of allowing cast integer to enums in VM, we can suppress some enum warnings in the stdlib in the unified form, namely using a cast expression.
* adds support for noDecl in constructor (#22811)Juan M Gómez2023-10-113-2/+12
| | | Notice the test wouldnt link before
* fixes #8893; guard against array access in renderer (#22807)ringabout2023-10-091-1/+1
| | | fixes #8893
* marking a field with noInit allows to skip constructor initialiser (#22802)Juan M Gómez2023-10-085-4/+85
| | | Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* fixes nimsuggest false error on lifetime tracking hook fixes #22794 (#22805)Juan M Gómez2023-10-081-0/+1
| | | | | fixes #22794 Not sure if it's too much.
* Add getCursorPos() to std/terminal (#22749)Matt Rixman2023-10-081-1/+47
| | | | | | | | | | | 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>
* fixes #22787; marks `var section` in the loop as reassign preventing cursor ↵ringabout2023-10-072-0/+41
| | | | | | | | | (#22800) fixes #22787 --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Fix typo/grammar in exception tracking section (#22801)Levi Notik2023-10-071-1/+1
| | | | | | | | I came across this sentence in the Nim Manual and couldn't make sense of it. I believe this is the correct fix for the sentence. --------- Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>