summary refs log tree commit diff stats
path: root/compiler/vmops.nim
Commit message (Collapse)AuthorAgeFilesLines
* Add `contains` to `std/macrocache` (#21304)Jake Leahy2023-02-011-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add test cases * Implement contains for CacheSeq * Implement contains for CacheTable * Fix implementation of hasKey * Remove contains for CacheSeq Fix runnable examples I was accidently using --doccmd:skip so I didn't spot the failure locally * Implement hasKey as a VM callback instead of magic * Implement suggestions from PR Co-Authored-By: ringabout <ringabout@users.noreply.github.com> * Update lib/core/macrocache.nim --------- Co-authored-by: ringabout <ringabout@users.noreply.github.com> Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* fixes #14409; fixes #10674 VM callbacks switch to table-index seqs (#21297)ringabout2023-01-261-1/+1
| | | | | | | * fixes #14409; fixes#10674 VM callbacks switch to table-index seqs * fixes package name * reduce runtime cost
* fixes #18134; registers `formatBiggestFloat` in VM (#21299)ringabout2023-01-261-1/+7
| | | | | fixes #18134; registers formatBiggestFloat in vmops strformat supports float format in VM
* remove legacy code (#21134)ringabout2022-12-261-40/+38
| | | | | * remove legacy code * fixes
* disable "Warning: gc is deprecated" in compiler (#21137)ringabout2022-12-201-0/+2
| | | | | * disable "Warning: gc is deprecated" in compiler * Apply @tersec 's suggestion
* fix #21045; getTime with vmopsDanger is broken; alternative to #21054 (#21056)ringabout2022-12-101-2/+3
| | | | | * fix #21045 getTime with vmopsDanger is broken; alternative to #21054 * typo
* createDir is now callable at compile time (#20824)Don-Duong Quach2022-11-141-3/+18
|
* refactor os imports into corresponding small modules (#20720)ringabout2022-11-011-1/+2
|
* change vm imports after bootstrapping (#20602)ringabout2022-10-201-1/+2
|
* [std/os] split and re-export (#20593)ringabout2022-10-201-3/+6
| | | | | | | * [std/os] split and export * move to private modules * fixes docs and tests Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
* refactor envvars, oserrors; register vmops (#20592)ringabout2022-10-181-7/+10
| | | | | * refactor envvars, oserrors; register vmops * remove type definitions
* move formatfloat out of system (#20195)ringabout2022-08-241-2/+2
| | | | | | | | | | | | | | | * move formatfloat out of system * fixes doc * Update changelog.md * careless * fixes * deprecate system/formatfloat * better handling
* bootstrap the compiler with nimPreviewSlimSystem (#20176)ringabout2022-08-091-1/+1
| | | | | * bootstrap the compiler with nimPreviewSlimSystem * threads
* .forbids pragma: defining forbidden tags (#20050)Lancer112112022-07-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * .forbids pragma: defining illegal effects for proc types This patch intends to define the opposite of the .tags pragma: a way to define effects which are not allowed in a proc. * updated documentation and changelogs for the forbids pragma * renamed notTagEffects to forbiddenEffects * corrected issues of forbids pragma the forbids pragma didn't handle simple restrictions properly and it also had issues with subtyping * removed incorrect character from changelog * added test to cover the interaction of methods and the forbids pragma * covering the interaction of the tags and forbids pragmas * updated manual about the forbids pragma * removed useless statement * corrected the subtyping of proc types using the forbids pragma * updated manual for the forbids pragma * updated documentations for forbids pragma * updated nim docs * updated docs with rsttester.nim * regenerated documentation * updated rst docs * Update changelog.md Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com> * updated changelog * corrected typo Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* Change `styleCheck` to ignore foreign packages (#19822)quantimnot2022-07-141-32/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Change `styleCheck` to ignore foreign packages * Symbols from foreign packages are now ignored. * Fixed `styleCheck` violations in `compiler` package. * Added symbol ownership to custom annotation pragmas. * Minor refactors to cleanup style check callsites. * Minor internal documentation of reasons why a symbol isn't checked. Style violations were fixed in the compiler after thet were exposed by the changes. The compiler wouldn't compile otherwise. Symbol ownership for custom pragma annotations is needed for checking the annotation's style. A NPE was raised otherwise. Fixes #10201 See also nim-lang/RFCs#456 * Fix a misunderstanding about excluding field style checks I had refactored the callsites of `styleCheckUse` to apply the DRY principle, but I misunderstood the field access handling in a template as a general case. This corrects it. * Fix some `styleCheck` violations in `compiler/evalffi` The violations were exposed in CI when the compiler was built with libffi. * Removed some uneeded transitionary code * Add changelog entry Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
* [vm] refactor `stdlib.marshal.load` (#19905)flywind2022-06-191-17/+1
| | | refactor stdlib.marshal.load
* move assertions out of system (#19599)flywind2022-03-231-0/+4
|
* register callback for marshal in VM (#19578)flywind2022-03-081-1/+35
| | | | | | | | | | | | | * register callback for marshal in VM * remove unrelated code * polish * more tests * more tests * add loadVM and toVM
* move io out of system (#19442)flywind2022-02-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | * move io out of system * fix tests * fix tests * next step * rename to syncio * rename * fix nimscript * comma * fix * fix parts of errors * good for now * fix test
* add mm to compilesettings; deprecate gc (#19394)flywind2022-01-161-0/+1
|
* Use openarray of bytes in md5 (#19307)hlaaftana2022-01-151-6/+0
| | | | | | | | | | * Use openarray of bytes in md5 * fix CI * cleanup * use noSideEffect for bootstrapping * fix CI again * actually fix CI by checking if it works * this is getting ridiculous * put old md5 version in compiler, remove vmop
* envPairs works in vm, nims (#18615)Timothee Cour2021-09-291-3/+11
| | | | | * envPairs works in vm, nims * fixup
* followup #18759: make compiler build cleanly with 0 warnings/hints (#18764)Timothee Cour2021-08-281-2/+4
|
* more minor bootstrapping cleanups (#18759)Miran2021-08-281-1/+0
|
* fixes #18371 (#18617)Andreas Rumpf2021-07-301-2/+5
|
* delEnv now works at CT (#18568)Timothee Cour2021-07-271-1/+2
|
* make -d:nimFpRoundtrips work consistently in vm vs rt, fix #18400, etc (#18531)Timothee Cour2021-07-201-0/+11
| | | | | | * compiler/vmhooks: add getVar to allow vmops with var params * addFloat vmops with var param * cgen now renders float32 literals in c backend using roundtrip float to string
* minor clenup in vmops (#18529)Timothee Cour2021-07-191-4/+5
|
* enable VM tracing in user code via `{.define(nimVmTrace).}` (#18244)Timothee Cour2021-06-241-0/+3
| | | | | | | * enable VM tracing in user code via `{.define(nimVmTrace).}` * add vmutils.vmTrace * add vmTrace
* merge BuildMode into SuccessX, remove code duplication w drnim, add useful ↵Timothee Cour2021-06-141-0/+1
| | | | | | | | | | | info to successx, add gc to compilesettings (#18252) * merge BuildMode into SuccessX, add more info * refactor duplicated with drnim * fixup * address comment
* bring back std/ prefix within compiler and ensure it works in bootstrap + ↵Timothee Cour2021-04-301-8/+8
| | | | | | | | | | | | | bsd (#17902) * [WIP] bring back std/ prefix within compiler and ensure it works in bootstrap + bsd * refs https://github.com/nim-lang/Nim/pull/16282#discussion_r616846863 * sounds very similar to https://github.com/nim-lang/Nim/pull/14291 * more: vmops * update tools/ci_generate.nim * auto-generate freebsd.yml as well, to avoid duplication with openbsd.yml * cleanup * undo temporary CI removal
* CIs: attempt to use csources_v1 (#16282)Andreas Rumpf2021-04-211-8/+8
| | | | | | | | * CIs: attempt to use csources_v1 * also updated the BSDs * also updated azure pipelines * std modules should not itself use the 'std/' import dir... * compiler has to be careful with std/ for v1 booting
* Add `hasClosure` to `std/typetraits` (#17501)flywind2021-03-291-0/+4
| | | | | | | | | | | | | | | | * fix nim js cmp fails at CT * Add `hasClosure` to `std/effecttraits` * type * Update changelog.md Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> * Update lib/std/effecttraits.nim Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Revert "make system random work in VM" (#17378)flywind2021-03-151-33/+0
|
* fix #17118 (#17119) [backport:1.2]flywind2021-02-221-1/+10
| | | | | * fix js unsigned integer * Use `std` prefix for standard library modules * fix #17118
* make system random work in VM (#17059)flywind2021-02-171-9/+45
| | | | * make system random work in VM
* compilesettings: add libpath (#16997)Timothee Cour2021-02-121-0/+1
| | | | | | | | | | | * compilesettings: add libpath * add test * changelog * fixup Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* fix #16815 round(x,places) works again in vm (#16825)Timothee Cour2021-01-281-1/+8
| | | | | | | * fix #16815 round+places works again in vm * improve tests; fix for linux 32bit * fix test for windows
* add math.signbit (#16592)flywind2021-01-071-0/+6
|
* Add math.copySign (#16406)flywind2020-12-301-0/+6
| | | | | * add math.copySign * fix + tests
* explicit ID generation for easier IC (#15559)Andreas Rumpf2020-10-251-1/+1
| | | | | | | | | | | | | | | | | * refactoring: idents don't need inheritance * refactoring: adding an IdGenerator (part 1) * refactoring: adding an IdGenerator (part 2) * refactoring: adding an IdGenerator (part 3) * refactoring: adding an IdGenerator (part 4) * refactoring: adding an IdGenerator (part 5) * refactoring: adding an IdGenerator (part 5) * IdGenerator must be a ref type; hello world works again * make bootstrapping work again * progress: add back the 'exactReplica' ideas * added back the missing exactReplica hacks * make tcompilerapi work again * make important packages green * attempt to fix the build for 32 bit machines (probably need a better solution here)
* implements https://github.com/nim-lang/RFCs/issues/258 (#15503)Andreas Rumpf2020-10-061-3/+17
| | | | | | | | | * implements https://github.com/nim-lang/RFCs/issues/258 * don't be too strict with custom pragma blocks * cast pragmas: documentation * added most missing inference query procs to effecttraits.nim
* Added std/effecttraits.nim (#15462)Andreas Rumpf2020-10-021-0/+9
|
* Remove little lies :)Clyybber2020-08-081-5/+6
|
* Fix bootstrappingClyybber2020-08-081-3/+4
|
* implement (#15153)cooldome2020-08-041-1/+1
|
* `nim doc --backend:js`, `nim doc --doccmd:-d:foo`, `nim r --backend:js`, ↵Timothee Cour2020-05-111-2/+3
| | | | | | | | | | `--doccmd:skip` + other improvements (#14278) * `nim doc --backend:js|cpp...` `nim doc --doccmd:'-d:foo --threads:on'` `nim r --backend:cpp...` (implies --run --usenimcache) * --usenimcache works with all targets * --docCmd:skip now skips compiling snippets; 50X speedup for doc/manual.rst
* fix https://github.com/nim-lang/Nim/issues/14275 querySetting(nimcacheDir) ↵Timothee Cour2020-05-081-1/+1
| | | | works even if implicitly set (#14277)
* add `--experimental:vmopsDanger`; add generic conversion for vmops (#13813)Timothee Cour2020-04-201-9/+24
| | | * add --experimental:vmopsDanger; vmops cleanups
* make bootstrapping more robust for people who have Nim inside /usr/bin (#13855)Andreas Rumpf2020-04-031-32/+34
|