mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
follow up https://github.com/nim-lang/Nim/pull/22991 - [x] turning it into an experimental feature --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2.3 KiB
2.3 KiB
v2.2.0 - yyyy-mm-dd
Changes affecting backward compatibility
-d:nimStrictDeletebecomes the default. An index error is produced when the index passed tosystem.deletewas out of bounds. Use-d:nimAuditDeleteto mimic the old behavior for backwards compatibility.- The default user-agent in
std/httpclienthas been changed toNim-httpclient/<version>instead ofNim httpclient/<version>which was incorrect according to the HTTP spec. - Methods now support implementations based on a VTable by using
--experimental:vtables. Methods are then confined to be in the same module where their type has been defined. - With
-d:nimPreviewNonVarDestructor, non-var destructors become the default.
Standard library additions and changes
- Changed
std/osfiles.copyFileto allow to specifybufferSizeinstead of a hardcoded one. - Changed
std/osfiles.copyFileto usePOSIX_FADV_SEQUENTIALhints for kernel-level aggressive sequential read-aheads. std/htmlparserhas been moved to a nimble package, usenimbleoratlasto install it.
- Added
newStringUninitto system, which creates a new string of lengthlenlikenewStringbut with uninitialized content. - Added
setLenUninitto system, which doesn't initalize slots when enlarging a sequence. - Added
hasDefaultValuetostd/typetraitsto check if a type has a valid default value. - Added Viewport API for the JavaScript targets in the
dommodule.
- Deprecates
system.newSeqUninitialized, which is replaced bynewSeqUninit.
Language changes
noInitcan be used in types and fields to disable member initializers in the C++ backend.- C++ custom constructors initializers see https://nim-lang.org/docs/manual_experimental.htm#constructor-initializer
membercan be used to attach a procedure to a C++ type.- C++
constructornow reusesresultinstead creatingthis.
Compiler changes
--nimcacheusing a relative path as the argument in a config file is now relative to the config file instead of the current directory.
Tool changes
- koch now allows bootstrapping with
-d:nimHasLibFFI, replacing the older option of building the compiler directly w/ thelibffinimble package in tow.