Closed timotheecour closed 3 years ago
I think the only solution is to hurry up Nim 2.0
.
so all Deprecated can be removed, all Experimental can be default,
all breaking Fixes can be implemented...
I think the only solution is to hurry up Nim 2.0.
this won't solve the underlying problem, if a bug is discovered in 2.0, I don't want to wait 10 years until 3.0 comes out. Hence the position I'm articulating in the "stdlib policy" PR in favor of fixing bugs, not working around it.
I agree, but I think about the way that fixes/improvements gets actually accepted and merged... 🤷
Hence the position I'm articulating in the "stdlib policy" PR in favor of fixing bugs, not working around it.
Make sense. Alas, I wish no PR would be reverted(Or at least providing the alternative way right after reverting) even if the new policy were to be merged.
This only shows people using the language wrong, they are never asserting inputs, nor outputs, thats basic primitive type assertiong checking, with or without a revert of any fix their code is still very fragile, but the language currently has nothing to offer to improve on that.
DrNim would be perfect, but it wont work currently, and no one knows when it will work realistically.
Testament/unittest is awesome, but tests the whole thing, so maybe test pass even with wrong inputs and outputs, and very often input is hardcoded in the test itself.
DBC module on stdlib can catch that, theres no way it dont, if this were Ada the DBC would catch it, theres literally an ISO standard and books about this, this has been fixed decades ago.
If you dont add DBC people keep inventing random "aliases" into unittesting tools,
like err
, oks
, fail
, skip
, ignore
, pass
, disallow
, falsify
, checkNot
, etc.
Documentation then strongly recommends using DBC for all core/serious/mission critical code.
DBC can be enabled/disabled with a define flag -d:nimNoDbc
or -d:nimDbc
or similar, to get performance back.
The DBC module can be Deprecated when DrNim works out-of-the-box for all OS/Arch.
See
Not needed anymore IMO :)
example PRs that were needed despite being breaking changes, demonstrating that the "no breaking change promise" made in 1.0 was broken many times, will continue to be broken, and is untenable in the current state of nim compiler and stdlib maturity level.
unify tuple expressions by krux02 · Pull Request #13793 · nim-lang/Nim
Replace enum fields idents with syms by cooldome · Pull Request #14048 · nim-lang/Nim
fix #13558: toDateTime was buggy on 29th, 30th and 31th of each month (and had other quirks) by timotheecour · Pull Request #13565 · nim-lang/Nim
https://github.com/nim-lang/Nim/pull/18431 std/dom
https://github.com/nim-lang/Nim/pull/18065 mimedb
https://github.com/nim-lang/Nim/issues/18423
Consider proc as a pointer type in options by hlaaftana · Pull Request #13460 · nim-lang/Nim
Fixes classify function to detect subnormal floating points by KeepCoolWithCoolidge · Pull Request #12836 · nim-lang/Nim
Fix sequtils.delete bug with out of bounds indexes by GULPF · Pull Request #12506 · nim-lang/Nim
Make sequtils.zip return seq of anonymous tuples by kaushalmodi · Pull Request #12575 · nim-lang/Nim
splitPath() behavior synchronized with splitFile() by luav · Pull Request #12481 · nim-lang/Nim
https://github.com/nim-lang/Nim/pull/18028 std/re findBounds
https://github.com/nim-lang/Nim/pull/17730 (unitset in errmsgs broke nim dump; i fixed it)
https://github.com/nim-lang/Nim/pull/16351
system.nim cleanup some exported constants which should never have be… by Araq · Pull Request #17909 · nim-lang/Nim
Remove confusing <//> by xflywind · Pull Request #17830 · nim-lang/Nim
https://github.com/nim-lang/Nim/pull/17312
fix #17383: json.%,to and jsonutils.formJson,toJson now works with uint|uint64 by timotheecour · Pull Request #17389 · nim-lang/Nim => let's deprecate json.%
\r now renders as \r, not \c which was very non-standard by timotheecour · Pull Request #17244 · nim-lang/Nim
Improve uri.parseQuery to never raise an error by mildred · Pull Request #16647 · nim-lang/Nim
fix #8821 by xflywind · Pull Request #15809 · nim-lang/Nim
https://github.com/nim-lang/Nim/pull/14799
https://github.com/nim-lang/Nim/pull/14197
https://github.com/nim-lang/Nim/pull/14565
https://github.com/nim-lang/Nim/pull/12860
fixes #14001 by Araq · Pull Request #14004 · nim-lang/Nim
fix #11537, correctly parse inline code without surrounding spaces by narimiran · Pull Request #15399 · nim-lang/Nim
rev
abi
field in importc type by timotheecour · Pull Request #17944 · nim-lang/Nimsee also:
hashes for refs should be an opt-in feature by narimiran · Pull Request #18098 · nim-lang/Nim
Revert "fix #14873 properly by skipping
abi
field in importc type" by Araq · Pull Request #17992 · nim-lang/Nimoption optimization by krux02 · Pull Request #6253 · nim-lang/Nim
Fix buffer-overrun bug in net by shirleyquirk · Pull Request #17728 · nim-lang/Nim
Deprecate any by juancarlospaco · Pull Request #16920 · nim-lang/Nim
Great, so if there's a bug (performance, logic, etc) in
hash
, we just need to deprecatehash
and introducehash2
orstd/hashes2
which produces different runtime values to avoid collisions. Since we can't silently change behavior of tables in stdlib by using the new std/hashes because someone might depend on old behavior tied to the old hash, we need to introduce std/tables2, std/sets2, and in turn std/json2 since it depends ontables
, and transitively every module needs to be duplicated. Any client of any of those dependencies will have to be updated to use the new modules and in the process cut support for prior nim versions, creating a mess of incompatible duplicate modules that need to be maintained and break nimble ecosystem beyond repair.This problem is pervasive, with your logic we have to deprecate and find a new symbol name for sugar.
=>
, os./
, we have to deprecate std/json, std/macrosI also recommend you should avoid
std/[json, tables, strutils, sequtils, os, macros]
and indeed, just about any stdlib module because of the same cowboy attitude which views bugs as things that should be fixed, not worked around, if nim is to be taken seriously.nim 1.0 release made a promise to offer stability guarantee (with an exception for "security vulnerability" and experimental features to a good approximation); I was against making that promise because the immaturity of the language and standard library would require breaking that promise in many occasions in order to allow evolving the language and free stdlib from design bugs. The reality is that the stability guarantee has been broken on many occasions, for good reasons (unrelated to security or experimental features or modules).
Here's a tiny sample of silently changed runtime behavior (aka what your call "cowboy attitude") that would require introducing duplicate modules, renaming
$
,/
,=>
etc:and what good does it do when you have no control over it and your dependencies generate thousands of warnings due to this policy which would cause most of stdlib APIs/modules to be deprecated?
The fallacy here is because of transitive dependencies, anything can be considered a "security related issue". Mission critical projects should have proper tests in place when updating dependencies including upgrading to a new compiler release.