summary refs log tree commit diff stats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* DrNim (Nim compiler with Z3 integration) (#13743)Andreas Rumpf2020-03-312-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | * code cleanups and feature additions * added basic test and koch/CI integration * make it build on Unix * DrNim: now buildable on Unix, only takes 10 minutes, enjoy * added basic documentation for DrNim which can also be seen as the RFC we're following * drnim: change the build setup so that drnim.exe ends up in bin/ * makes simple floating point ranges work * added basic float range check * drnim: teach Z3 about Nim's range types plus code refactoring * drnim: make unsigned numbers work * added and fixed index checking under setLen * first implementation of .ensures, .invariant and .assume (.requires still missing and so is proc type compatibility checking * drnim: .requires checking implemented * drnim: implemented .ensures properly * more impressive test involving min() * drnim: check for proc type compatibility and base method compatibility wrt .requires and .ensures * testament: support for 'pattern <directory> * koch: uses new <directory> feature of testament * drnim: added tiny musings about 'old' * Make testament work with old SSL versions * koch: add support for 'koch drnim -d:release' * drnim: preparations for the param.old notation
* Tiny fix on browsers.openDefaultBrowser (#13818)Juan Carlos2020-03-311-1/+3
|
* Fix a 'See XXX' on documentation, clean out (#13820)Juan Carlos2020-03-311-2/+1
|
* macros for proc types, macros for types (#13778)Andreas Rumpf2020-03-311-0/+6
| | | | | | | | | * new minor feature: macros for proc types, to be documented * Finished the implementation and added tests * [skip ci] Describe the new custom pragmas in the manual and the changelog Co-authored-by: Zahary Karadjov <zahary@gmail.com>
* Unwind just the "pseudorandom probing" part of recent sets,tables changes ↵c-blake2020-03-317-174/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#13816) * Unwind just the "pseudorandom probing" (whole hash-code-keyed variable stride double hashing) part of recent sets & tables changes (which has still been causing bugs over a month later (e.g., two days ago https://github.com/nim-lang/Nim/issues/13794) as well as still having several "figure this out" implementation question comments in them (see just diffs of this PR). This topic has been discussed in many places: https://github.com/nim-lang/Nim/issues/13393 https://github.com/nim-lang/Nim/pull/13418 https://github.com/nim-lang/Nim/pull/13440 https://github.com/nim-lang/Nim/issues/13794 Alternative/non-mandatory stronger integer hashes (or vice-versa opt-in identity hashes) are a better solution that is more general (no illusion of one hard-coded sequence solving all problems) while retaining the virtues of linear probing such as cache obliviousness and age-less tables under delete-heavy workloads (still untested after a month of this change). The only real solution for truly adversarial keys is a hash keyed off of data unobservable to attackers. That all fits better with a few families of user-pluggable/define-switchable hashes which can be provided in a separate PR more about `hashes.nim`. This PR carefully preserves the better (but still hard coded!) probing of the `intsets` and other recent fixes like `move` annotations, hash order invariant tests, `intsets.missingOrExcl` fixing, and the move of `rightSize` into `hashcommon.nim`. * Fix `data.len` -> `dataLen` problem.
* #13806 - getApplFreebsd might lose data (#13807)Euan2020-03-311-16/+16
| | | | | | | | | * #13806 - first call sysctl with a null buffer to get the length, then alloc buffer and call again * Use csize_t rather than csize * Suggestions from @Clyybber Co-authored-by: Euan Torano <euan.torano@bluesky-wireless.co.uk>
* Add Documentation (#13811)Juan Carlos2020-03-3112-19/+135
| | | | * Add more Docs and runnableExamples
* refs #13797 (#13812)Timothee Cour2020-03-311-1/+1
|
* stacktraces can now show custom runtime msgs per frame (#13351)Timothee Cour2020-03-305-18/+82
| | | | | | | | * stacktraces can now show custom runtime msgs * improve tests/stdlib/tstackframes.nim * fix test for --gc:arc * test --stacktraceMsgs:on and --stacktraceMsgs:off * --stacktracemsgs:off by default
* fix #13794 HashSet leak (#13800)Timothee Cour2020-03-291-1/+2
|
* Fix #13631 (#13789)Juan Carlos2020-03-291-2/+2
|
* More fixes for Haiku (#13774)alaviss2020-03-272-47/+50
| | | | | | | | | | | * osproc: move fork-based code path under the when conditional * osproc: avoid using the environ global on Haiku * osenv: import environ from stdlib.h on Haiku Haiku's environ is declared in `<stdlib.h>` by default, differing from POSIX and/or Linux. Import it from there to avoid collision with anyone importing `<stdlib.h>` from Nim.
* ssl_certs: add Haiku support (#13761)alaviss2020-03-261-7/+32
|
* asyncdispatch: fix erroneous set construction (#13765)alaviss2020-03-261-1/+3
| | | | | | | These constants were defined as `cint`. They can be huge on certain systems, such as Haiku, and trigger out-of-bounds errors in asyncdispatch. Ref #13764.
* `import macros` rather than `import std/macros`. (#13762)Euan2020-03-261-1/+2
|
* distinctBase overload for values (#13746)Timothee Cour2020-03-251-0/+7
|
* fix deprecations and other warnings (#13748)Miran2020-03-254-12/+10
|
* __stderrp and friends are only on FreeBSD & DragonFlyBSD. (#13735)Euan2020-03-232-2/+2
|
* fix #13731, ambiguous repr of pointers (#13732)Miran2020-03-231-6/+2
|
* fixes #13722 (#13729)Andreas Rumpf2020-03-231-8/+20
| | | | | * fixes #13722 * better fix
* hotfix: make 'nim doc nimhcr' work on all platformsAraq2020-03-231-33/+33
|
* new syntax for lvalue references: `var b {.byaddr.} = expr` (#13508)Timothee Cour2020-03-231-0/+19
| | | | | | | | * new syntax for lvalue references: `var b {.byaddr.} = expr` * on type mismatch, `???(0, 0)` not shown anymore * * compiler now lowers `var a: {.foo.}: MyType = expr` to foo(a, MyType, expr) * new pragmas.byaddr defined in pure library code exploiting this lowering * skip `template foo() {.pragma.}`
* add error for missing commandLineParams (#13719)Andy Davidoff2020-03-231-0/+4
| | | | | | | * add error for missing commandLineParams * fixup * rewrite
* introduce getPeerCertificates, fixes #13299 (#13650)Christian Ulrich2020-03-223-22/+79
| | | | | | | | | | | | * make i2d_X509 and d2i_X509 always available i2d_X509 and d2i_X509 have been available in all versions of OpenSSL, so make them available even if nimDisableCertificateValidation is set. * introduce getPeerCertificates, fixes #13299 getPeerCertificates retrieves the verified certificate chain of the peer we are connected to through an SSL-wrapped Socket/AsyncSocket. This introduces the new type Certificate which stores a DER-encoded X509 certificate.
* Windows API callbacks cannot raise exceptionsAraq2020-03-221-3/+3
|
* Add EPOLLEXCLUSIVE (#13718)Hiroki Noda2020-03-211-0/+1
|
* [ci skip] add back unintentionally removed linenarimiran2020-03-201-0/+1
|
* SSL certificate verify GitHub action (#13697)Federico Ceratto2020-03-204-12/+253
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement SSL/TLS certificate checking #782 * SSL: Add nimDisableCertificateValidation Remove NIM_SSL_CERT_VALIDATION env var tests/untestable/thttpclient_ssl.nim ran successfully on Linux with libssl 1.1.1d * SSL: update integ test to skip flapping tests * Revert .travis.yml change * nimDisableCertificateValidation disable imports Prevent loading symbols that are not defined on older SSL libs * SSL: disable verification in net.nim ..when nimDisableCertificateValidation is set * Update changelog * Fix peername type * Add define check for windows * Disable test on windows * Add exprimental GitHub action CI for SSL * Test nimDisableCertificateValidation
* [RFC] 'walkDir' now has a new 'checkDir' flag, to mimic behaviour of other ↵Timothee Cour2020-03-202-14/+28
| | | | | languages (#13642) Co-authored-by: narimiran
* threadpool.nim: allow control over MaxThreadPoolSize and ↵Araq2020-03-201-3/+3
| | | | MaxDistinguishedThread; refs #10584
* Detect Ubuntu by checking release() and uname() (#13704)Hayden2020-03-201-1/+3
| | | This will improve detection of Ubuntu when running on Ubuntu on WSL. #13703
* fight the code bloat in base64.nimAraq2020-03-201-7/+16
|
* Add Base64 safe (#13672)Juan Carlos2020-03-201-9/+28
| | | | * Implement RFC-4648 Section-7 * https://github.com/nim-lang/Nim/pull/13672#issuecomment-600993466
* Remove 2 old deprecated files (#13702)Juan Carlos2020-03-202-20/+0
|
* cycle breaker (#13593)Andreas Rumpf2020-03-194-12/+244
| | | | * cycle breaking as an alternative to cycle detection
* Attempt to finish off araq cpp exceptions (#13695)cooldome2020-03-192-32/+6
| | | | | | | | | | | | | | | * config update * disable a questionable test * remove c++ exception handling IDs, new impl doesn't require it anymore * C++ based exceptions finally work * fixes bootstrapping problem in C++ mode * teach GCC it's 2020 now * more bugfixes for C++ based exception handling * apply cooldome's patch * another attempt to enable C++11 * bug fix Co-authored-by: Araq <rumpf_a@web.de> Co-authored-by: cooldome <ariabushenko@bk.ru>
* fix #11458 oswalkdir (#13689)Timothee Cour2020-03-191-27/+4
| | | | | * fix #11458 oswalkdir * changelog
* added a switch -d:nimEmulateOverflowChecks for broken or old GCC versions ↵Andreas Rumpf2020-03-192-2/+2
| | | | (#13692)
* add `move` to `tables` to prevent warnings when compiled with `--gc:arc` ↵Miran2020-03-191-4/+4
| | | | (#13684)
* httpcore: deprecate `==`(string, HttpCode) (#13682)alaviss2020-03-191-1/+8
| | | | | | | | | | According to [RFC7230], the reason phrase attached to the status line is optional and clients should not rely on it. This in turn causes the proc to be practically useless, as clients should only inspect the return code. Ref #13680. [RFC7230]: https://tools.ietf.org/html/rfc7230#section-3.1.2
* enable --tlsEmulation:on for --gc:arc (#13685)Andreas Rumpf2020-03-183-7/+4
| | | | * enable --tlsEmulation:on for --gc:arc * make -d:useMalloc work with --gc:arc --threads:on
* arc optimizations (#13325)Andreas Rumpf2020-03-181-8/+1
| | | | | * scope based destructors * handle 'or' and 'and' expressions properly, see the new test arc/tcontrolflow.nim * make this branch mergable, logic is disabled for now
* fixes hash(HashSet) which was wrong as it didn't respect tombstones; refs #13649Araq2020-03-181-1/+2
|
* add nnkMacroDef to RoutineNodes (#13676)Jasper Jenkins2020-03-171-1/+1
|
* rewritten goto based exception handling; much cleaner implementation;… ↵Andreas Rumpf2020-03-171-3/+3
| | | | | | (#13677) * rewritten goto based exception handling; much cleaner implementation; fixes #13668
* fixes a bug for 'dup' and 'with'; they can now handle nested statement lists ↵Araq2020-03-173-25/+22
| | | | that can result from macros
* fixes #13654Andreas Rumpf2020-03-161-1/+1
|
* fixes #13645Araq2020-03-161-16/+18
|
* fix #13218: avoid some irrelevant warnings for nim doc,rst2html,--app:lib, + ↵Timothee Cour2020-03-137-9/+7
| | | | | | | | other fixes (#13550) * fix #13218: avoid some irrelevant warnings for nim doc,rst2html * suppress warnRedefinitionOfLabel for nim doc * lots of fixes for UnusedImport warnings
* catchable defects (#13626)Andreas Rumpf2020-03-1213-33/+204
| | | | | | | | | | * allow defects to be caught even for --exceptions:goto (WIP) * implemented the new --panics:on|off switch; refs https://github.com/nim-lang/RFCs/issues/180 * new implementation for integer overflow checking * produce a warning if a user-defined exception type inherits from Exception directly * applied Timothee's suggestions; improved the documentation and replace the term 'checked runtime check' by 'panic' * fixes #13627 * don't inherit from Exception directly