summary refs log tree commit diff stats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* added extended msg for failed library loads w/ incorrect DLL formats (#13950)awr12020-04-162-12/+30
| | | | | | | | | | | | | | | * added extended msg for failed library loads w/ incorrect DLL formats * missing colon * fix GetLastError() * make GetLastError() available for windows console apps * remove premature nullchar if outputting extra message * if-protect nullchar detection * better fix for message box code
* fix newDomParser (#13981)Timothee Cour2020-04-161-1/+1
|
* added a .since annotation to hashIdentityAndreas Rumpf2020-04-151-2/+4
|
* Add `hashWangYi1` (#13823)c-blake2020-04-153-8/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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. * This is an alternate resolution to https://github.com/nim-lang/Nim/issues/13393 (which arguably could be resolved outside the stdlib). Add version1 of Wang Yi's hash specialized to 8 byte integers. This gives simple help to users having trouble with overly colliding hash(key)s. I.e., A) `import hashes; proc hash(x: myInt): Hash = hashWangYi1(int(x))` in the instantiation context of a `HashSet` or `Table` or B) more globally, compile with `nim c -d:hashWangYi1`. No hash can be all things to all use cases, but this one is A) vetted to scramble well by the SMHasher test suite (a necessarily limited but far more thorough test than prior proposals here), B) only a few ALU ops on many common CPUs, and C) possesses an easy via "grade school multi-digit multiplication" fall back for weaker deployment contexts. Some people might want to stampede ahead unbridled, but my view is that a good plan is to A) include this in the stdlib for a release or three to let people try it on various key sets nim-core could realistically never access/test (maybe mentioning it in the changelog so people actually try it out), B) have them report problems (if any), C) if all seems good, make the stdlib more novice friendly by adding `hashIdentity(x)=x` and changing the default `hash() = hashWangYi1` with some `when defined` rearranging so users can `-d:hashIdentity` if they want the old behavior back. This plan is compatible with any number of competing integer hashes if people want to add them. I would strongly recommend they all *at least* pass the SMHasher suite since the idea here is to become more friendly to novices who do not generally understand hashing failure modes. * Re-organize to work around `when nimvm` limitations; Add some tests; Add a changelog.md entry. * Add less than 64-bit CPU when fork. * Fix decl instead of call typo. * First attempt at fixing range error on 32-bit platforms; Still do the arithmetic in doubled up 64-bit, but truncate the hash to the lower 32-bits, but then still return `uint64` to be the same. So, type correct but truncated hash value. Update `thashes.nim` as well. * A second try at making 32-bit mode CI work. * Use a more systematic identifier convention than Wang Yi's code. * Fix test that was wrong for as long as `toHashSet` used `rightSize` (a very long time, I think). `$a`/`$b` depend on iteration order which varies with table range reduced hash order which varies with range for some `hash()`. With 3 elements, 3!=6 is small and we've just gotten lucky with past experimental `hash()` changes. An alternate fix here would be to not stringify but use the HashSet operators, but it is not clear that doesn't alter the "spirit" of the test. * Fix another stringified test depending upon hash order. * Oops - revert the string-keyed test. * Fix another stringify test depending on hash order. * Add a better than always zero `defined(js)` branch. * It turns out to be easy to just work all in `BigInt` inside JS and thus guarantee the same low order bits of output hashes (for `isSafeInteger` input numbers). Since `hashWangYi1` output bits are equally random in all their bits, this means that tables will be safely scrambled for table sizes up to 2**32 or 4 gigaentries which is probably fine, as long as the integer keys are all < 2**53 (also likely fine). (I'm unsure why the infidelity with C/C++ back ends cut off is 32, not 53 bits.) Since HashSet & Table only use the low order bits, a quick corollary of this is that `$` on most int-keyed sets/tables will be the same in all the various back ends which seems a nice-to-have trait. * These string hash tests fail for me locally. Maybe this is what causes the CI hang for testament pcat collections? * Oops. That failure was from me manually patching string hash in hashes. Revert. * Import more test improvements from https://github.com/nim-lang/Nim/pull/13410 * Fix bug where I swapped order when reverting the test. Ack. * Oh, just accept either order like more and more hash tests. * Iterate in the same order. * `return` inside `emit` made us skip `popFrame` causing weird troubles. * Oops - do Windows branch also. * `nimV1hash` -> multiply-mnemonic, type-scoped `nimIntHash1` (mnemonic resolutions are "1 == identity", 1 for Nim Version 1, 1 for first/simplest/fastest in a series of possibilities. Should be very easy to remember.) * Re-organize `when nimvm` logic to be a strict `when`-`else`. * Merge other changes. * Lift constants to a common area. * Fall back to identity hash when `BigInt` is unavailable. * Increase timeout slightly (probably just real-time perturbation of CI system performance).
* fix #12864 static params were mutating arg types during sigmatch; fix #12713 ↵Timothee Cour2020-04-141-5/+4
| | | | | | | | | | | ; refs #13529 (#13976) * fix #12864 static params were mutating arg types during sigmatch * fix test * fix StaticParam * also fixes #12713; added test case
* Add Data URI Base64, implements RFC-2397 (#13759)Juan Carlos2020-04-131-1/+35
| | | | | | | | | | | | | | | | | * Add Data URI Base64, implements RFC-2397 * Add Data URI Base64, implements RFC-2397 * Add Data URI Base64, implements RFC-2397 * https://github.com/nim-lang/Nim/pull/13759#issuecomment-611498420 * https://github.com/nim-lang/Nim/pull/13759#issuecomment-611498420 * ReSync changelog * https://github.com/nim-lang/Nim/pull/13759#issuecomment-611498420 Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
* Add jsdomparser (#13920)Juan Carlos2020-04-131-1/+18
| | | | | | | | | | | | | | | | | * Add jsdomparser * Add jsdomparser * Add jsdomparser * https://github.com/nim-lang/Nim/pull/13920#issuecomment-610727142 * https://github.com/nim-lang/Nim/pull/13920#issuecomment-610727142 * https://github.com/nim-lang/Nim/pull/13920#issuecomment-610727142 * https://github.com/nim-lang/Nim/pull/13920#discussion_r405932909 * https://github.com/nim-lang/Nim/pull/13920#discussion_r406502592
* Add runnableExamples to bitops module (#13951)jiro2020-04-131-15/+143
| | | | | | | | | | | | | | | | | * doc: bitops: add runnableExamples * doc: bitops: add notes to documentation comments of macros * doc: bitops: add periods to documentation comments * doc: bitops: add static * Revert "doc: bitops: add static" This reverts commit 595ee134abcd451e73ddde963c1b3e49a275f2e5. * doc: bitops: add `var` to arguments of macros * doc: bitops: remove examples of testBit
* Make unused code into actual test, replace echo with doassert (#13952)Juan Carlos2020-04-111-33/+0
|
* osproc: added a better version of waitForExit for Haiku (#13938)alaviss2020-04-101-0/+61
| | | Also modified tosprocterminate to verify waitForExit implementations.
* posix: add full Haiku support (#13931)alaviss2020-04-092-2/+608
| | | | | | | | | | * posix: add full Haiku support This commit provides a posix_haiku derived from posix_other, with types following Haiku's definition. This fixes cases where the compiler generates type check for the wrong types (ie. checks where generated for an int-derived type but it's actually implemented as an uint instead). * tools/kochdocs: welcome posix_haiku to the blacklist
* fixes #13863 (#13929)cooldome2020-04-081-0/+5
| | | Co-authored-by: cooldome <ariabushenko@bk.ru>
* Fixes issues with dynamic loading OpenSSL. Fixes #13903. (#13919) [backport]Dominik Picheta2020-04-081-19/+39
| | | | | | | | This fixes at least a couple of issues: * Procs loaded from the DLL being used even when the pointer is nil. * The actual issue (#13903) which appeared to cause stack corruption on Android 7.1.1 with OpenSSL 1.1.1f. The change that fixed this was the move to loading the procs in `sslSym`.
* fix #13894, httpclient hang on Http204narimiran2020-04-071-1/+1
|
* fix #13910 (#13917)cooldome2020-04-071-1/+1
| | | Co-authored-by: cooldome <ariabushenko@bk.ru>
* fix some codegen bugs: NIM_BOOL, NIM_STATIC_ASSERT, --passc:-std=... (etc) ↵Timothee Cour2020-04-071-23/+42
| | | | | | | | (#13798) * fix cgen bool D20200328T203812 * --passc:std=c++17 (etc) now works instead of silently ignored * document caveats for NIM_NIL
* json doc: Note about Option and reserved keywords (#13895)Nicolai Søborg2020-04-071-0/+7
|
* Fix #13889 with testcase (#13896) [backport]Clyybber2020-04-061-1/+1
| | | | | | | | | * Fix https://github.com/nim-lang/Nim/issues/13889 * Add testcase * Reduce test time Co-authored-by: Elie Zedeck RANDRIAMIANDRIRAY <elie.zedeck@gmail.com>
* Fix #13872 (#13898)Clyybber2020-04-061-0/+5
|
* openDefaultBrowser now works on OSX (#13892) [backport]Timothee Cour2020-04-061-2/+2
|
* doc: fix comment for repr*(x: char): string (#13873)Hiroki Noda2020-04-051-1/+1
| | | replace `$` with `repr`.
* Add isNil check to custom Content-Length. (#13867) [backport:1.2]supakeen2020-04-051-2/+3
| | | Related to #13866.
* asyncdispatch: get rid of erroneous set constructions (#13877)alaviss2020-04-051-5/+9
| | | Ref #13764
* bump devel version to 1.3.1narimiran2020-04-031-1/+1
|
* fix #7241 (#13779)itsumura-h2020-04-031-0/+5
| | | finalize() should run in insert()
* fix asynchttpserver content-length header (#13846)flywind2020-04-031-3/+6
|
* std/byaddr => std/decls (#13847)Timothee Cour2020-04-031-0/+0
|
* return types must not be Natural for reasons I won't outline hereAraq2020-04-021-1/+1
|
* feature/count (#13837)Dean Eigenmann2020-04-021-0/+19
|
* renamed new std/pragmas.nim to std/byaddr.nim (#13844)Andreas Rumpf2020-04-021-5/+5
| | | | | * renamed new std/pragmas.nim to std/byaddr.nim * minor code cleanup
* Deprecate PHP (#13838)Juan Carlos2020-04-021-16/+1
|
* Jsconsole update (#12448)Juan Carlos2020-04-021-35/+36
| | | | | | * Improve jsconsole adding the rest of the stable api as documented on the standard at https://developer.mozilla.org/docs/Web/API/Console * Improve jsconsole, add runnableexamples * Simplify jsconsole
* Deprecate DCE:on (#13839)Juan Carlos2020-04-0224-43/+0
|
* Deprecate when declared(echo):echo (#13840)Juan Carlos2020-04-021-1/+1
|
* Documentation and Code Style inotify (#13836)Juan Carlos2020-04-021-52/+53
|
* Add browsers.openDefaultBrowser without URL, implements IETF RFC-6694 ↵Juan Carlos2020-04-011-14/+38
| | | | Section-3 (#13835)
* Documentation, add more examples (#13825)Juan Carlos2020-04-015-12/+26
|
* revert stdlib changes which are not required anymoreAndreas Rumpf2020-04-016-21/+20
|
* Hrm, the new errors highlighted some code that seems to be brokenZahary Karadjov2020-04-016-20/+21
| | | | | | New issue: since `Table[A, B]` allocates its backing storage with `newSeq[KeyValuePair[A, B]]`, it's no longer legal to create a table with `not nil` types used as either keys or values.
* encodeMIME should be encodeMime by our coding guidelinesAraq2020-04-011-3/+3
|
* fix #13829 (#13831)Timothee Cour2020-04-011-1/+1
|
* 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