Commit Graph

6699 Commits

Author SHA1 Message Date
konsumlamm
eef2948ec2 Fix #12595 (#16874) 2021-01-31 01:00:18 +01:00
Saem Ghani
1097cc4173 nimsuggest prioritize non-deprecated suggestions (#16816)
* penalizes the quality score of deprecated symbols
* uses quality more pervasively in order to reflect deprecation impact
* impacts both sug and con

additional notes:
* linux i386 CI was failing
* this is because the suggested results differ slightly in their sort
* 64 bit tables.getOrDefault:441 was returned, while 32 bit returned 422
* for now simply removing the last line is good enough
2021-01-29 15:15:35 +01:00
flywind
f09d97d6d3 close #16844 (#16852)
* close #16844
* better
* comment
* Update compiler/renderer.nim
2021-01-29 14:31:41 +01:00
Timothee Cour
6e267d28b3 remove conditionals on nimHasUserErrors, nimNoNilSeqs2, nimNoNilSeqs (#16861)
* cleanup docs for type(nil) | type(nil); simplify nimHasUserErrors

* simplify nimNoNilSeqs2

* simplify nimNoNilSeqs

* fixup
2021-01-29 14:30:24 +01:00
Timothee Cour
b0f38a63c4 fix #16815 round(x,places) works again in vm (#16825)
* fix #16815 round+places works again in vm

* improve tests; fix for linux 32bit

* fix test for windows
2021-01-28 10:40:18 +01:00
Timothee Cour
e112974920 fix #16752: threadvar now works with importcpp types; osx now uses native TLS (--tlsEmulation:off), which can be orders of magnitude faster (#16750)
* osx now uses native TLS, which can be orders of magnitude faster

* add {.cppNonPod.}

* improve test

* changelog, docs, disable part of windows test
2021-01-27 22:35:43 +01:00
Andreas Rumpf
25745ad195 IC: final implementation steps (#16801)
* removed dead code
* we need even more laziness for the generic caches
* make it bootstrap on older Nims
* wrote more deserialization code
* IC: replay required methods information
2021-01-25 20:52:26 +01:00
Saem Ghani
d99ea00829 fixed nim-lang/nimsuggest#48 type aware sug (#16814)
* suggesting identifiers accounts context over scope (distance)
* key takeaway: context fit is prioritized over a heuristics like scope
2021-01-25 07:36:47 +01:00
Clyybber
301e5838ec Finer analysis for array access (#16787)
* Refine the analysis for array access
* Cleanup
* Add comments
2021-01-24 21:01:41 +01:00
Andreas Rumpf
8241e55023 IC: next steps (#16729)
* IC: dead code elimination pass
* preparations for a different codegen strategy
* added documentation to the newly written code
* IC: backend code
* IC: backend adjustments
* optimized the compiler a bit
* IC: yet another massive refactoring
* fixes regressions
* cleanups
2021-01-23 08:06:15 +01:00
Clyybber
57d5c1465a Part-to-whole optimization (#16775) 2021-01-21 15:25:00 +01:00
Timothee Cour
00d9176e91 some comments for amd64 and nimvm CPU (#16756) 2021-01-20 11:10:11 +01:00
Clyybber
ccb11a63fb Reboot of #16195 (#16746)
* fix #16185

* fix test

* fix comment

* fix comment

* better approach

* Add more tests and move sameLocation to injectdestructors

* Better and more strict sameLocation

* Small cleanup and preliminary spec clarification

* Fix

* Fix doc

* Expand test

Co-authored-by: Andrey R (cooldome) <ariabushenko@gmail.com>
2021-01-20 11:05:56 +01:00
Timothee Cour
4fc7fcb775 --hintAsError (#16763)
* --hintAsError

* add test, changelog

* condsyms
2021-01-20 10:49:59 +01:00
Juan Carlos
78a99587a4 Deprecate TaintedString (#15423)
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
2021-01-15 18:56:38 -08:00
cooldome
fc9cf2088d Fix 16722 (#16730)
* fix #16722

* fix spacing

* spacing
2021-01-15 18:16:24 +00:00
Andrey Makarov
554fe8f88f conservative approach to fix #15184 (#16723) 2021-01-15 00:53:36 +01:00
Andreas Rumpf
1fd4c666dc IC: next steps (#16705)
* code cleanups
* refactorings for IC
* more refactorings for IC
* IC: attach the 'nil' type to its module
* IC: refactorings and improvements
* IC: progress
* IC: more serialization fixes
* IC: embarrassing omission
* code cleanups
2021-01-14 17:30:41 +01:00
Timothee Cour
7f67c593c1 improve formatting of error message when runnableExamples fails (#16677) 2021-01-13 19:09:00 -08:00
Saem Ghani
bb3c6d0797 fixes nim-lang/nimsuggest#103 con dot exprs (#16657)
- con calls for dot exprs now returns results
- discovered an issue with dot expr results -- documented
2021-01-12 13:35:21 +01:00
Andreas Rumpf
cf6dd57efe IC: next steps (#16632)
* removed dead code
* beginnings of a rodfile reader
* IC: record global VM state changes and pragma state changes
* IC: replay pragmas and VM state changes
* implemented rod load file simuation for easier, extensive testing
* critical bugfix
* IC: stress test logic; should also help with recursive module dependencies; WIP
* IC: loading from .rod files begins to work reliably
* removed ugly hacks
* yet another silly mistake
2021-01-12 09:36:51 +01:00
Andrey Makarov
fd5c8ef208 RST: implement internal targets (#16614) 2021-01-11 19:51:04 +01:00
flywind
aa185c0e9b fix #13517 (#16681) 2021-01-11 15:07:48 +01:00
flywind
be6e8916fa fix negative nan (#16628) 2021-01-11 11:39:38 +01:00
Saem Ghani
bbc96f974d fixed nim-lang/nimsuggest#82 pure enum field sug (#16676)
- previous code wasn't account for tyEnum being wrapped in tyTypeDesc
- now pure enum fields are suggested
2021-01-11 10:18:01 +01:00
Timothee Cour
f6c2450cdb fix #16555, fixes #16405: len, high honors '\0' for cstring in vm (#16610) 2021-01-11 10:16:20 +01:00
cooldome
0286a0879b fix #16651 (#16658)
* fix #16651
2021-01-11 10:09:38 +01:00
flywind
2c6f5ae681 fix #16650 (#16660) 2021-01-10 21:51:29 +00:00
Andreas Rumpf
add1ccb6cb compiler: minor refactoring (#16633) 2021-01-08 13:36:03 +01:00
Andrew
596da7f9a0 happy new year 2021 again (#16638) 2021-01-08 09:29:32 +01:00
Andreas Rumpf
796498525a IC: next steps (#16550)
* cleanups
* ast.nim: cleanups
* IC: no more sym.tab field, stored externally in the module graph
* nimble compiles again
* rodfiles: store bitwidth of integers and the endianness in the cookie because we serialize 'int' directly
* rodfiles: added compilerproc and export sections
* rodfiles: added all the missing sections
* rodfiles: track the missing information
* IC: architecture for lazy loading of proc bodies
* make tests green again
* completed the lazy loading of proc bodies
* symbol lookup integration, part 1
* symbol lookup integration, part 2
* symbol lookup integration, part 3
* make tcompilerapi work again
* rodfiles: fixed config change handling
2021-01-07 20:26:40 +01:00
flywind
bab0aa6ecf add math.signbit (#16592) 2021-01-07 08:48:02 +01:00
Timothee Cour
025ca660f7 [backport 1.0] add backend support for js bigint (#16606)
* add backend support for js bigint

* cleanup

* add tests

* add -d:nimHasJsBigIntBackend

* cleanup

* more tests
2021-01-06 20:28:24 +01:00
Saem Ghani
21dfa04cbf fixes nim-lang/nimsuggest#119 outline includes (#16608)
nimsuggest outline should account for includes, now it does:
- the module prefix will be of the module doing the including
- the filename will be of the module that was included
- adds a test case for it
2021-01-06 20:26:16 +01:00
cooldome
58b9191354 fix #16516 method dispatch for sink args (#16594)
* fix #16516

* fix comment

* Trigger build
2021-01-06 10:47:03 +00:00
Andreas Rumpf
6317e4004d make --gc:arc --exceptions:quirky work again [backport:1.4] (#16583)
* make --gc:arc --exceptions:quirky work again [backport:1.4]

* fixes #16404 [backport:1.4]
2021-01-04 19:44:50 +01:00
flywind
acf3715ea8 continue #15456 add #pragma directives compiler support (#16472)
* continue #15456
* follow the advice from juan_carlos
2021-01-04 11:34:13 +01:00
Timothee Cour
471aab86a0 fix #16526 run config.nims before foo.nim.cfg (#16557)
* fix #16526 run config.nims before foo.nim.cfg

* add test
2021-01-02 21:41:44 +01:00
flywind
b8775bff57 fix is "closure" (#16552) 2021-01-02 17:11:46 +01:00
Timothee Cour
854ff26ac5 fix #16206, nim r / nim -r recompiles if cwd changes (#16349) 2021-01-02 01:33:59 -08:00
Andreas Rumpf
73a8b950cb big steps torwards an efficient, simple IC implementation (#16543)
* reworked ID handling
* the packed AST now has its own ID mechanism
* basic serialization code works
* extract rodfiles to its own module
* rodfiles: store and compare configs
* rodfiles: store dependencies
* store config at the end
* precise dependency tracking
* dependency tracking for rodfiles
* completed loading of PSym, PType, etc
* removed dead code
* bugfix: do not realloc seqs when taking addr into an element
* make IC opt-in for now
* makes tcompilerapi green again
* final cleanups

Co-authored-by: Andy Davidoff <github@andy.disruptek.com>
2021-01-02 07:30:39 +01:00
Timothee Cour
0d0e43469f fix #14340 (#16386) 2021-01-01 22:55:22 +01:00
flywind
515cd45420 Add math.copySign (#16406)
* add math.copySign
* fix + tests
2020-12-30 15:09:30 +01:00
Timothee Cour
8508c4e1c2 fix hintProcessing dots interference with static:echo and hintCC; add tests for nim secret, add tests for hintProcessing, misc other bug fixes (#16495)
* fix dots interfering with static:echo
* add tests
* fix hintProcessing dots for hintCC
* improve trunner tests
* fix bug: readLineFromStdin now writes prompt to stdout, consistent with linenoise and rdstdin
* disable a failing test for windows
2020-12-30 14:58:41 +01:00
flywind
95f599ca2d move asciitables to std/private/ (#16498)
* move asciitables

* minor
2020-12-29 16:20:47 +01:00
Timothee Cour
c9886a4952 use -d:nimCompilerStackraceHints in more places (#16400) 2020-12-29 02:12:05 -08:00
Alexander Ivanov
672dc5cd87 Nil type check implementation (#15287)
* Nil checking
* Enable current older not nil checking again, run new checking only under flag, skip our test
* Enable tests, work on try/except and bugs, fix notnil tests

* Enable strictNotNil tests (currently with lowercase category) and add some expected output
* Work on try/except/finally: still some things unclear and a lot of code can raise out of try
* Fix the notnil build by going back to the old version of a test which I shouldn't have changed

* Fix test : use action compile
* Work on mutation and aliasing: not finished
* Render var parititions graph, try to understand it, fix a nilcheck if bug
* Rebase, progress on working with partitions
* Improve time logic
* Fix some bugs, use graph indices instead of symbol in nil map
* Fix bugs, test simpler ident aliasing for now, support two mutation levels
* Support ContentMutation and ReAssignment: for now just detect possible re assignment for var parameters of calls
* Enable several simple passing tests
* Cleanup a bit, fix condition/branch infix-related bug
* Remove some files, address some comments by Araq
* Use internalError and no quit for now
* Separate tests with expected warnings and with expected ok, fix a bug with if with a single branch related to copyMap
* Fix new data structures, bugs: make tests pass, disable some for now
* Work on fixing errors with non-sym nodes, aliasing: tests fail
* Work on alias support: simple set-based logic, todo more tests and ref sets?
* Use ref sets: TODO can we think of handle seq-s similar to varpartitions' Araq ones
* Handle defers in one place, stop raising in reverse to make an async test compile with strictNotNil, add a commented out test
* Dot expressions: call/reassignment. Other refactorings and distinct, SeqOfDistinct support. Checkout an older varpartitions
* Work on field tracking
* Backup : trying to fix bugs when running some stdlib stuff for running an async test
* Start a section about strict not nil checking in experimental manual
* Fix experimental strict not nil manual section and move it to another file based on Araq feedback
* Fix unstructured flow and double warning problems, fix manual, cleanup
* Fix if/elif/else : take in account structure according to Araq feedback
* Refactor a bit
* Work on bracket expr support, re-enable tests, clarify in manual/tests/implementation static index support for now
* Work on compiling stdlib and compiler with strictNotNil
* Small fixes to the manual for strictNotNil
* Fix idgen for strict check nil rebase
* Enable some simple tests, remove old stuff, comment out code/print
* Copy the original varpartitions source instead of my changes
* Remove some files
2020-12-29 10:31:11 +01:00
Timothee Cour
f9a15dbae9 fix nim secret dots interfering with prompt (#16491)
* fix nim secret dots

* cleanups
2020-12-28 12:19:47 +01:00
cooldome
fbc8a40c7a fix #15043 (#16441) [backport:1.4]
* fix #15043

* Trigger build
2020-12-27 20:05:33 +01:00
flywind
792e4a0392 Revert #16478 (#16483)
* minor

* Revert "minor"

This reverts commit ef1807cbb4.
2020-12-27 23:08:48 +08:00