Commit Graph

195 Commits

Author SHA1 Message Date
Timothee Cour
d1447fe25d major improvements to std/wrapnils: optimal codegen, case objects, lvalue semantics (#18435)
* wrapnils now generates optimal code; also handles case objects
* changelog
* unsafeAddr => addr
2021-07-07 06:04:36 +02:00
Timothee Cour
36d24846b6 typo: enmRange => enumElementsAsSet (#18394) 2021-06-29 18:08:50 -07:00
Clyybber
6e74fecb42 Simplify addInt, remove digits10 (#18356)
* Simplify addInt, remove digits10

Co-authored-by: Charles Blake <charlechaud@gmail.com>

* Fix bootstrapping

* Add noInit to tmp array

* noInit -> noinit

Co-authored-by: Charles Blake <charlechaud@gmail.com>
2021-06-28 15:00:14 +02:00
Timothee Cour
8535b26a75 docs now show nimExperimentalX APIs (#18345)
* docs now show nimExperimentalX APIs

* fix for windows
2021-06-25 16:47:10 +02:00
Timothee Cour
565e07a993 enable VM tracing in user code via {.define(nimVmTrace).} (#18244)
* enable VM tracing in user code via  `{.define(nimVmTrace).}`

* add vmutils.vmTrace

* add vmTrace
2021-06-24 11:55:31 +02:00
flywind
9a81e91fa5 merge similar procs regarding digits (#18318) 2021-06-22 17:02:32 +02:00
Timothee Cour
7714ab468a make privateAccess work with generic types and generic instantiations; fix a SIGSEGV (#18260)
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-06-19 11:24:46 -07:00
Timothee Cour
e1e8af535e merge BuildMode into SuccessX, remove code duplication w drnim, add useful info to successx, add gc to compilesettings (#18252)
* merge BuildMode into SuccessX, add more info

* refactor duplicated with drnim

* fixup

* address comment
2021-06-14 08:51:40 +02:00
Timothee Cour
79ded694d7 avoid re-exporting options from std/wrapnils (#18222) 2021-06-10 07:00:34 +02:00
Timothee Cour
9c6259e557 up to 20x faster jsonutils deserialization (#18183)
* up to 20x faster jsonutils deserialization

* noinline
2021-06-05 09:45:37 +02:00
Timothee Cour
654a20166e simplify extccomp.nim json logic via jsonutils; fix #18084 (#18100)
* simplify extccomp.nim json logic via jsonutils
* fix #18084
* simplify further
* workaround for bootstrap that can be removed after updating csources_v1 >= 1.2
2021-06-03 22:29:45 +02:00
Andreas Rumpf
0aa8b793a5 clarify what a 'monotonic' timestamp is (#18163) 2021-06-03 16:27:34 +02:00
Timothee Cour
369a7d1246 jsonutils.toJson now serializes JsonNode as is by default (#18097)
* jsonutils.toJson now serializes JsonNode as is (without deep copy nor treating it as a regular ref object)

* JsonNodeMode
2021-05-31 22:17:52 +02:00
Timothee Cour
7f077a76fe jsonutils: add customization for toJson via ToJsonOptions; generalize symbolName; add symbolRank (#18029)
* jsonutils: add customization for toJson via `ToJsonOptions`

* add enumutils.symbolRank

* lookup table implementation for HoleyEnum

* cleanup

* changelog

* fixup

* Update lib/std/jsonutils.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-05-18 15:10:19 +02:00
Timothee Cour
d83b25db1e fix #18007: std/json now serializes nan,inf,-inf as strings instead of invalid json (#18026)
* fix #18007: std/json now serializes nan,inf,-inf as raw strings instead of invalid json

* fix roundtrip

* fix tests

* fix changelog

* simplify

* add runnableExamples

* fix typo [skip ci]
2021-05-16 23:54:10 +02:00
Andreas Rumpf
3bc625aff1 ORC: progress (#18000)
* ORC: progress

* ORC: bugfix; don't follow acyclic data even if only at runtime the subtype is marked as acyclic

* progress

* minor style changes
2021-05-12 22:00:37 +02:00
Timothee Cour
1e080eb9b4 jsonutils: handle holey enum as regular enum, via ord (#17995) 2021-05-11 22:49:47 +02:00
Timothee Cour
a770c98e27 jsonutils: support set (#17994) 2021-05-11 21:09:17 +02:00
Timothee Cour
e60672141a improve std/tempfiles (#17920)
* improve std/tempfiles
* fixup
* fix windows
* improve test
* improve runnableExamples and tests
* address comment
2021-05-11 16:35:43 +02:00
Timothee Cour
82996aee3f misc fixes: remove forceConst (obsolete by static), add more runnableExamples to system (#17896)
* misc fixes

* add runnableExamples for compileOption

* add runnableExamples for runnableExamples

* move tconsteval => tconst

* cleanup
2021-05-01 07:26:52 +02:00
Timothee Cour
20248a68fd gitutils: add diffStrings, diffFiles, and use it in testament to compare expected vs gotten (#17892)
* gitutils: add diffStrings, diffFiles, and use it in testament to compare expected vs gotten
* refactor with createTempDir
* cleanup
* refacotr
* PRTEMP fake test spec changes to show effect of diffStrings
* add runnableExamples for experimental/diff + cross-reference with gitutils
* Revert "PRTEMP fake test spec changes to show effect of diffStrings"

This reverts commit 57dc8d642d.
2021-04-30 11:00:33 +02:00
Timothee Cour
e4db733d80 fix #17888: remove undefined behavior for posix.open; fix tempfiles.createTempFile (#17889)
* fix #17888: remove undefined behavior for posix.open; fix tempfiles.createTempFile

* fix for tests/async/tasyncfile.nim

* hide mode for now

* add notice regarding stability
2021-04-29 13:42:56 +02:00
Timothee Cour
dce0b3b002 refactor all code that builds csources (#17815)
* refactor all code that builds csources
* fixup
* nim_csourcesDir_v0 + nim_csourcesDir
* remove deprecated, unused scripts from ci/
* reuse nimCsourcesHash in ci
* simplify CI pipelines by reusing nimBuildCsourcesIfNeeded
* simplify ci_docs.yml by reusing nimBuildCsourcesIfNeeded
* cleanup
* use csources_v1 as destination dir
* fixup
* remove pushCsources
* address comment: remove build.sh support for now
* fixup
2021-04-23 11:28:42 +02:00
flywind
c631648cb3 close #9372 add std/tempfiles (#17361)
* close #9372 add std/tempfile
2021-04-21 15:07:36 +02:00
Andreas Rumpf
a9b62de895 CIs: attempt to use csources_v1 (#16282)
* 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
2021-04-21 07:41:33 +02:00
flywind
603af22b7c [std/tasks]add gcsafe pragmas (#17799)
* [std/tasks]add gcsafe pragmas

* Update tasks.nim
2021-04-21 11:05:16 +08:00
Clyybber
24abe10aa8 Small privateAccess improvement (#17786) 2021-04-19 17:51:00 +02:00
Clyybber
6de5aa1971 Rename = to =copy in stdlib (#17781) 2021-04-19 13:16:10 +02:00
Timothee Cour
0a10af5a2c privateAccess now works with ref | ptr (#17760) 2021-04-19 00:15:58 +02:00
Timothee Cour
8161b02897 import foo {.all.} reboot (#17706) 2021-04-16 09:16:39 +02:00
flywind
44657b78c4 callback cannot be nil (#17718)
`Task.callback` cannot be nil, we need to raise it at debug and release mode

Situations:
- if users create a Task object without using `toTask` and invoke the Task
- if users already move the Task and invoke the Task
2021-04-14 19:14:14 +02:00
flywind
58f44c8b4e Update channels.nim (#17717) 2021-04-14 16:45:22 +02:00
Timothee Cour
e92c78a9ac add number literal jsbigints.big (#17707) 2021-04-13 09:33:28 +02:00
flywind
f25243140b add std/tasks (#17447) 2021-04-09 11:51:51 +02:00
konsumlamm
9f0f477552 Update sysrand documentation (#17676)
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-04-08 12:41:43 -05:00
flywind
a807233aeb fix #17615(runnableExamples silently ignored if placed after some code) (#17619)
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-04-02 18:26:30 -07:00
Timothee Cour
9abd383a2a new genAst as replacement for quote do (#17426)
* new `macros.genAst`: fixes all issues with `quote do`
* add changelog entry
* add workaround for https://github.com/nim-lang/Nim/issues/2465#issuecomment-511076669
* add test for #9607
* add kNoExposeLocalInjects option
* add test case for nested application of genAst
* genAst: automatically call newLit when needed
* allow skipping `{}`: genAst: foo
* add test that shows this fixes #11986
* add examples showing mixin; add examples showing passing types, macros, templates
* move to std/genasts
* improve docs
2021-04-02 13:11:03 +02:00
Timothee Cour
9b67e5c61b jsonutils: support cstring (including as Table key); improve docs (#16062)
* jsonutils: support cstring (including as Table key); improve docs
* changelog
* un-disable a test now that #16061 was fixed
2021-03-31 18:24:39 +02:00
Timothee Cour
04520c0ce4 remove std/ prefix from doc/lib.rst now that canonical import is shown in module docs (#17543)
* remove std/ prefix from doc/lib.rst now that canonical import is shown in module docs

* cleanup top docs for std/sha1
2021-03-29 13:07:14 +02:00
konsumlamm
9e3960e83d Small doc improvements for std/with (#17556) 2021-03-29 12:44:31 +02:00
Timothee Cour
a65189a739 nnkArglist => nnkArgList + special case stylecheck:error (#17529)
* nnkArglist => nnkArgList

* special case stylecheck:error
2021-03-27 10:28:11 +01:00
flywind
c8dda867f2 close #11330 sets uses optimized countSetBits (#17334)
* Update lib/pure/bitops.nim
* Update lib/system/sets.nim
* Apply suggestions from code review

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-03-22 00:36:48 +01:00
Timothee Cour
05743bc9f7 improve jsutils docs (#17421)
* improve jsutils docs

* address comments
2021-03-21 10:35:00 +01:00
konsumlamm
9997b42c35 Use importjs (#17422) 2021-03-19 14:22:48 -07:00
flywind
e332c20ba7 follow up #17276 (#17355)
* improve test coverage for isolation

* a bit better

* rename channels to channels_builtin

* follow up #17276

* fix

* Update lib/std/private/jsutils.nim
2021-03-19 16:54:10 +01:00
flywind
60fc7e986b fix a typo (#17417)
* Revert "make system random work in VM"

* fix #17380

* attempt to fix bug

* fix

* better

* fix

* a bit

* fix the leaks

* revert

* fix

* better

* follow up #17391

* fix

* Update tchannels.nim

* Update tests/stdlib/tchannels.nim

* Update tchannels.nim

* fix a typo
2021-03-19 21:44:13 +08:00
flywind
e9b5543bd5 [std/channels]fix recv leaks(Part One) (#17394) 2021-03-17 10:08:54 +01:00
Timothee Cour
895a40d1ac fix #17383: json.%,to and jsonutils.formJson,toJson now works with uint|uint64 (#17389) [backport:1.2]
* fix #17383: json.%,to and jsonutils.formJson,toJson now works with uint|uint64
* fixup
* fix for js
2021-03-16 21:44:54 +01:00
flywind
d5eb658034 fix #17380 (#17391) 2021-03-16 07:14:56 +01:00
flywind
51a04a3674 make std/sysrand better (#17360) 2021-03-15 14:07:27 +01:00