Nim Changelog

What's new in Nim 0.14.2

Aug 19, 2016
  • Version 0.14.2 is just a bugfix release that fixes the most pressing regressions. In particular, the tar.xz now supports documentation generation, and the Windows installers bundle the latest stable nimble release.

New in Nim 0.14.0 (Aug 19, 2016)

  • Library Additions
  • The rlocks module has been added providing a reentrant lock synchronization primitive.
  • A generic "sink operator" written as &= has been added to the
  • system and the net modules. This operator is similar to the C++

New in Nim 0.13.0 (Aug 19, 2016)

  • Bugfixes
  • The list below has been generated based on the commits in Nim's git repository. As such it lists only the issues which have been closed via a commit, for a full list see this link on Github.
  • Fixed "Generic arguments cannot be used in templates (raising undeclared identifier)" (#3498)
  • Fixed "multimethods: Error: internal error: cgmeth.genConv" (#3550)
  • Fixed "nimscript - SIGSEGV in except block" (#3546)
  • Fixed "Bool literals in macros do not work." (#3541)
  • Fixed "Docs: nativesocket.html - 404" (#3582)
  • Fixed ""not nil" return types never trigger an error or warning" (#2285)
  • Fixed "No warning or error is raised even if not nil is specified " (#3222)
  • Fixed "Incorrect fsmonitor add() filter logic" (#3611)
  • Fixed ""nimble install nimsuggest" failed" (#3622)
  • Fixed "compile time excl ` cause SIGSEGV" (`#3639)
  • Fixed "Unable to echo unsigned ints at compile-time" (#2514)
  • Fixed "Nested closure iterator produces internal error" (#1725)
  • Fixed "C Error on walkDirRec closure" (#3636)
  • Fixed "Error in generated c code" (#3201)
  • Fixed "C Compile-time error with generic proc type." (#2659)
  • Fixed "ICE dereferencing array pointer" (#2240)
  • Fixed "Lambda lifting crash" (#2007)
  • Fixed "Can't reference outer variables from a closure in an iterator" (#2604)
  • Fixed "M&S collector breaks with nested for loops." (#603)
  • Fixed "Regression: bad C codegen" (#3723)
  • Fixed "JS backend - handle bool type in case statement" (#3722)
  • Fixed "linenoise compilation with cpp" (#3720)
  • Fixed "(???,???) duplicate case label" (#3665)
  • Fixed "linenoise compilation with cpp" (#3720)
  • Fixed "Update list of backward incompatibilities for Nim 0.12.0 in the main site" (#3689)
  • Fixed "Can't compile nimble with latest devel - codegen bug" (#3730)

New in Nim 0.12.0 (Aug 19, 2016)

  • Library Additions
  • The nre module has been added, providing a better interface to PCRE than re.
  • The expandSymlink proc has been added to the os module.
  • The tailDir proc has been added to the os module.
  • Define nimPinToCpu to make the threadpool use explicit thread affinities. This can speed up or slow down the thread pool; it's up to you to benchmark it.
  • strutils.formatFloat and formatBiggestFloat do not depend on the C locale anymore and now take an optional decimalSep = '.' parameter.
  • Added unicode.lastRune, unicode.graphemeLen.
  • Compiler Additions
  • The compiler now supports a new configuration system based on NimScript.
  • The compiler finally considers symbol binding rules in templates and generics for overloaded [], []=, {}, {}= operators (issue #2599).
  • The compiler now supports a bitsize pragma for constructing bitfields.
  • Added a new --reportConceptFailures switch for better debugging of concept related type mismatches. This can also be used to debug system.compiles failures.
  • Language Additions
  • system.unsafeAddr can be used to access the address of a let variable or parameter for C interoperability. Since technically this makes parameters and let variables mutable, it is considered even more unsafe than the ordinary addr builtin.
  • Added macros.getImpl that can be used to access the implementation of a routine or a constant. This allows for example for user-defined inlining of function calls.
  • Tuple unpacking finally works in a non-var/let context: (x, y) = f() is allowed. Note that this doesn't declare x and y variables, for this let (x, y) = f() still needs to be used.
  • when nimvm can now be used for compiletime versions of some code sections. Click here for details.
  • Usage of the type NimNode in a proc now implicitly annotates the proc with .compileTime. This means generics work much better for NimNode.
  • Bugfixes
  • Fixed "Compiler internal error on iterator it(T: typedesc[Base]) called with it(Child), where Child = object of Base" (#2662)
  • Fixed "repr() misses base object field in 2nd level derived object" (#2749)
  • Fixed "nimsuggest doesn't work more than once on the non-main file" (#2694)
  • Fixed "JS Codegen. Passing arguments by var in certain cases leads to invalid JS." (#2798)
  • Fixed ""check" proc in unittest.nim prevents the propagation of changes to var parameters." (#964)
  • Fixed "Excessive letters in integer literals are not an error" (#2523)
  • Fixed "Unicode dashes as "lisp'ish" alternative to hump and snake notation" (#2811)
  • Fixed "Bad error message when trying to construct an object incorrectly" (#2584)
  • Fixed "Determination of GC safety of globals is broken " (#2854)
  • Fixed "v2 gc crashes compiler" (#2687)
  • Fixed "Compile error using object in const array" (#2774)
  • Fixed "httpclient async requests with method httpPOST isn't sending Content-Length header" (#2884)
  • Fixed "Streams module not working with JS backend" (#2148)
  • Fixed "Sign of certain short constants is wrong" (#1179)
  • Fixed "Symlinks to directories reported as symlinks to files" (#1985)
  • Fixed "64-bit literals broken on x86" (#2909)
  • Fixed "import broken for certain names" (#2904)
  • Fixed "Invalid UTF-8 strings in JavaScript" (#2917)
  • Fixed "[JS][Codegen] Initialising object doesn't create unmentioned fields."
  • (#2617)
  • Fixed "Table returned from proc computed at compile time is missing keys:" (#2297)
  • Fixed "Clarify copyright status for some files" (#2949)
  • Fixed "math.nim: trigonometry: radians to degrees conversion" (#2881)
  • Fixed "xoring unsigned integers yields RangeError in certain conditions" (#2979)
  • Fixed "Directly checking equality between procs" (#2985)
  • Fixed "Compiler crashed, but there have to be meaningful error message" (#2974)
  • Fixed "repr is broken" (#2992)
  • Fixed "Ipv6 devel - add IPv6 support for asyncsockets, make AF_INET6 a default" (#2976)
  • Fixed "Compilation broken on windows" (#2996)
  • Fixed "'u64 literal conversion compiler error" (#2731)
  • Fixed "Importing 'impure' libraries while using threads causes segfaults" (#2672)
  • Fixed "Uncatched exception in async procedure on raise statement" (#3014)
  • Fixed "nim doc2 fails in Mac OS X due to system.nim (possibly related to #1898)" (#3005)
  • Fixed "IndexError when rebuilding Nim on iteration 2" (#3018)
  • Fixed "Assigning large const set to variable looses some information" (#2880)
  • Fixed "Inconsistent generics behavior" (#3022)
  • Fixed "Compiler breaks on float64 division" (#3028)
  • Fixed "Confusing error message comparing string to nil " (#2935)
  • Fixed "convert 64bit number to float on 32bit" (#1463)
  • Fixed "Type redefinition and construction will break nim check" (#3032)
  • Fixed "XmlParser fails on very large XML files without new lines" (#2429)
  • Fixed "Error parsing arguments with whitespaces" (#2874)
  • Fixed "Crash when missing one arg and used a named arg" (#2993)
  • Fixed "Wrong number of arguments in assert will break nim check" (#3044)
  • Fixed "Wrong const definition will break nim check" (#3041)
  • Fixed "Wrong set declaration will break nim check" (#3040)
  • Fixed "Compiler segfault (type section)" (#2540)
  • Fixed "Segmentation fault when compiling this code" (#3038)
  • Fixed "Kill nim i" (#2633)
  • Fixed "Nim check will break on wrong array declaration" (#3048)
  • Fixed "boolVal seems to be broken" (#3046)
  • Fixed "Nim check crashes on wrong set/array declaration inside ref object" (#3062)
  • Fixed "Nim check crashes on incorrect generic arg definition" (#3051)
  • Fixed "Nim check crashes on iterating nonexistent var" (#3053)
  • Fixed "Nim check crashes on wrong param set declaration + iteration" (#3054)
  • Fixed "Wrong sharing of static_t instantations" (#3112)
  • Fixed "Automatically generated proc conflicts with user-defined proc when .exportc.'ed" (#3134)
  • Fixed "getTypeInfo call crashes nim" (#3099)
  • Fixed "Array ptr dereference" (#2963)
  • Fixed "Internal error when repr-ing a type directly" (#3079)
  • Fixed "unknown type name 'TNimType' after importing typeinfo module" (#2841)
  • Fixed "Can export a template twice and from inside a block" (#1738)
  • Fixed "C Codegen: C Types are defined after their usage in certain cases" (#2823)
  • Fixed "s.high refers to the current seq instead of the old one" (#1832)
  • Fixed "Error while unmarshaling null values" (#3149)
  • Fixed "Inference of static[T] in sequences" (#3144)
  • Fixed "Argument named "closure" to proc inside template interfere with closure pragma" (#3171)
  • Fixed "Internal error with aliasing inside template" (#3158)
  • Fixed "Cardinality of sets prints unexpected value" (#3135)
  • Fixed "Nim crashes on const assignment from function returning var ref object" (#3103)
  • Fixed "repr cstring" (#3080)
  • Fixed "Nim check crashes on wrong enum declaration" (#3052)
  • Fixed "Compiler assertion when evaluating template with static[T]" (#1858)
  • Fixed "Erroneous overflow in iterators when compiler built with overflowChecks enabled" (#3140)
  • Fixed "Unicode dashes as "lisp'ish" alternative to hump and snake notation" (#2811)
  • Fixed "Calling discardable proc from a defer is an error." (#3185)
  • Fixed "Defer statement at the end of a block produces ICE" (#3186)
  • Fixed "Call to createU fails to compile" (#3193)
  • Fixed "VM crash when accessing array's element" (#3192)
  • Fixed "Unexpected proc invoked when different modules add procs to a type from a 3rd module" (#2664)
  • Fixed "Nim crashes on conditional declaration inside a template" (#2670)
  • Fixed "Iterator names conflict within different scopes" (#2752)
  • Fixed "VM: Cannot assign int value to ref variable" (#1329)
  • Fixed "Incorrect code generated for tagged unions with enums not starting at zero" (#3096)
  • Fixed "Compile time procs using forward declarations are silently ignored" (#3066)
  • Fixed "re binding error in generic" (#1965)
  • Fixed "os.getCreationTime is incorrect/impossible on Posix systems" (#1058)
  • Fixed "Improve error message for osproc.startProcess when command does not exist" (#2183)
  • Fixed "gctest segfaults with --gc:markandsweep on x86_64" (#2305)
  • Fixed "Coroutine changes break compilation on unsupported architectures" (#3245)
  • Fixed "Bugfix: Windows 32bit TinyCC support issue fixed" (#3237)
  • Fixed "db_mysql getValue() followed by exec() causing error" (#3220)
  • Fixed "xmltree.newEntity creates xnCData instead of xnEntity" (#3282)
  • Fixed "Methods and modules don't work together" (#2590)
  • Fixed "String slicing not working in the vm" (#3300)
  • Fixed "internal error: evalOp(mTypeOf)" (#3230)
  • Fixed "#! source code prefix collides with Unix Shebang" (#2559)
  • Fixed "wrong codegen for constant object" (#3195)
  • Fixed "Doc comments inside procs with implicit returns don't work" (#1528)

New in Nim 0.11.2 (Aug 19, 2016)

  • This is just a bugfix release that fixes the most pressing regressions we introduced with version 0.11.0. The way types are computed was changed significantly causing all sort of problems. Sorry for the inconvenience; we grew overconfident our large test suite would prevent these things.

New in Nim 0.11.0 (Aug 19, 2016)

  • Library additions
  • reversed proc added to the unicode module.
  • Added multipart param to httpclient's post and postContent together with a newMultipartData proc.
  • Added %* operator for JSON.
  • The compiler is now available as Nimble package for c2nim.
  • Added ..^ and ..< templates to system so that the rather annoying space between .. < and .. ^ is not necessary anymore.
  • Added system.xlen for strings and sequences to get back the old len operation that doesn't check for nil for efficiency.
  • Added sexp.nim to parse and generate sexp.
  • Bugfixes
  • Fixed internal compiler error when using char() in an echo call (#1788).
  • Fixed Windows cross-compilation on Linux.
  • Overload resolution now works for types distinguished only by a static[int] param (#1056).
  • Other fixes relating to generic types and static params.
  • Fixed some compiler crashes with unnamed tuples (#1774).
  • Fixed channels.tryRecv blocking (#1816).
  • Fixed generic instantiation errors with typedesc (#419).
  • Fixed generic regression where the compiler no longer detected constant expressions properly (#544).
  • Fixed internal error with generic proc using static[T] in a specific way (#1049).
  • More fixes relating to generics (#1820, #1050, #1859, #1858).
  • Fixed httpclient to properly encode queries.
  • Many fixes to the uri module.
  • Async sockets are now closed on error.
  • Fixes to httpclient's handling of multipart data.
  • Fixed GC segfaults with asynchronous sockets (#1796).
  • Added more versions to openssl's DLL version list (076f993).
  • Fixed shallow copy in iterators being broken (#1803).
  • nil can now be inserted into tables with the db_sqlite module (#1866).
  • Fixed "Incorrect assembler generated" (#1907)
  • Fixed "Expression templates that define macros are unusable in some contexts" (#1903)
  • Fixed "a second level generic subclass causes the compiler to crash" (#1919)
  • Fixed "nim 0.10.2 generates invalid AsyncHttpClient C code for MSVC " (#1901)
  • Fixed "1 shl n produces wrong C code" (#1928)
  • Fixed "Internal error on tuple yield" (#1838)
  • Fixed "ICE with template" (#1915)
  • Fixed "include the tool directory in the installer as it is required by koch" (#1947)
  • Fixed "Can't compile if file location contains spaces on Windows" (#1955)
  • Fixed "List comprehension macro only supports infix checks as guards" (#1920)
  • Fixed "wrong field names of compatible tuples in generic types" (#1910)
  • Fixed "Macros within templates no longer work as expected" (#1944)
  • Fixed "Compiling for Standalone AVR broken in 0.10.2" (#1964)
  • Fixed "Compiling for Standalone AVR broken in 0.10.2" (#1964)
  • Fixed "Code generation for mitems with tuple elements" (#1833)
  • Fixed "httpclient.HttpMethod should not be an enum" (#1962)
  • Fixed "terminal / eraseScreen() throws an OverflowError" (#1906)
  • Fixed "setControlCHook(nil) disables registered quit procs" (#1546)
  • Fixed "Unexpected idetools behaviour" (#325)
  • Fixed "Unused lifted lambda does not compile" (#1642)
  • Fixed "'low' and 'high' don't work with cstring asguments" (#2030)
  • Fixed "Converting to int does not round in JS backend" (#1959)
  • Fixed "Internal error genRecordField 2 when adding region to pointer." (#2039)
  • Fixed "Macros fail to compile when compiled with --os:standalone" (#2041)
  • Fixed "Reading from {.compileTime.} variables can cause code generation to fail" (#2022)
  • Fixed "Passing overloaded symbols to templates fails inside generic procedures" (#1988)
  • Fixed "Compiling iterator with object assignment in release mode causes "var not init"" (#2023)
  • Fixed "calling a large number of macros doing some computation fails" (#1989)
  • Fixed "Can't get Koch to install nim under Windows" (#2061)
  • Fixed "Template with two stmt parameters segfaults compiler" (#2057)
  • Fixed "noSideEffect not affected by echo" (#2011)
  • Fixed "Compiling with the cpp backend ignores --passc" (#1601)
  • Fixed "Put untyped procedure parameters behind the experimental pragma" (#1956)
  • Fixed "generic regression" (#2073)
  • Fixed "generic regression" (#2073)
  • Fixed "Regression in template lookup with generics" (#2004)
  • Fixed "GC's growObj is wrong for edge cases" (#2070)
  • Fixed "Compiler internal error when creating an array out of a typeclass" (#1131)
  • Fixed "GC's growObj is wrong for edge cases" (#2070)
  • Fixed "Invalid Objective-C code generated when calling class method" (#2068)
  • Fixed "walkDirRec Error" (#2116)
  • Fixed "Typo in code causes compiler SIGSEGV in evalAtCompileTime" (#2113)
  • Fixed "Regression on exportc" (#2118)
  • Fixed "Error message" (#2102)
  • Fixed "hint[path] = off not working in nim.cfg" (#2103)
  • Fixed "compiler crashes when getting a tuple from a sequence of generic tuples" (#2121)
  • Fixed "nim check hangs with when" (#2123)
  • Fixed "static[T] param in nested type resolve/caching issue" (#2125)
  • Fixed "repr should display " (#2124)
  • Fixed "'nim check' never ends in case of recursive dependency " (#2051)
  • Fixed "From macros: Error: unhandled exception: sons is not accessible" (#2167)
  • Fixed "fieldPairs doesn't work inside templates" (#1902)
  • Fixed "fields iterator misbehavior on break statement" (#2134)
  • Fixed "Fix for compiler not building anymore since #c3244ef1ff" (#2193)
  • Fixed "JSON parser fails in cpp output mode" (#2199)
  • Fixed "macros.getType mishandles void return" (#2211)
  • Fixed "Regression involving templates instantiated within generics" (#2215)
  • Fixed ""Error: invalid type" for 'not nil' on generic type." (#2216)
  • Fixed "--threads:on breaks async" (#2074)
  • Fixed "Type mismatch not always caught, can generate bad code for C backend." (#2169)
  • Fixed "Failed C compilation when storing proc to own type in object" (#2233)
  • Fixed "Unknown line/column number in constant declaration type conversion error" (#2252)
  • Fixed "Adding {.compile.} fails if nimcache already exists." (#2247)
  • Fixed "Two different type names generated for a single type (C backend)" (#2250)
  • Fixed "Ambigous call when it should not be" (#2229)
  • Fixed "Make sure we can load root urls" (#2227)
  • Fixed "Failure to slice a string with an int subrange type" (#794)
  • Fixed "documentation error" (#2205)
  • Fixed "Code growth when using const" (#1940)
  • Fixed "Instances of generic types confuse overload resolution" (#2220)
  • Fixed "Compiler error when initializing sdl2's EventType" (#2316)
  • Fixed "Parallel disjoint checking can't handle