e029_version_0_16_0.rst 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. Version 0.16.0 released
  2. =======================
  3. .. container:: metadata
  4. Posted by The Nim Team on 08/01/2017
  5. We're happy to announce that the latest release of Nim, version 0.16.0, is now
  6. available!
  7. As always, you can grab the latest version from the
  8. `downloads page <http://nim-lang.org/download.html>`_.
  9. This release includes over 80 bug fixes and improvements. To see a full list
  10. of changes, take a look at the detailed changelog
  11. `below <#changelog>`_.
  12. Some of the most significant changes in this release include: a major new
  13. Nimble release, an improved import syntax, and the stabilisation of
  14. name mangling rules enabling faster compile times.
  15. The new Nimble release that is included with Nim 0.16.0 includes a variety of
  16. new features and bug fixes. The most prominent of which is the improved output
  17. system, as shown in the figure below.
  18. .. raw::html
  19. <a href="../assets/news/images/0.16.0/nimble.png">
  20. <img src="../assets/news/images/0.16.0/nimble.png" alt="Nimble 0.8.0" style="width:100%"/>
  21. </a>
  22. For a full list of changes in Nimble, see its
  23. `changelog <https://github.com/nim-lang/nimble/blob/master/changelog.markdown#080---05012017>`_.
  24. The new import syntax makes it easier to import multiple modules from the same
  25. package or directory. For example:
  26. .. code-block:: nim
  27. import compiler/ast, compiler/parser, compiler/lexer
  28. import compiler / [ast, parser, lexer]
  29. The two are equivalent, but the new latter syntax is less redundant.
  30. Finally, the code responsible for name mangling in the generated C and C++ code
  31. has been improved to reduce compile times. In particular, compile-time for
  32. the common edit-compile-run cycles have been reduced.
  33. Changelog
  34. ~~~~~~~~~
  35. Changes affecting backwards compatibility
  36. -----------------------------------------
  37. - ``staticExec`` now uses the directory of the nim file that contains the
  38. ``staticExec`` call as the current working directory.
  39. - ``TimeInfo.tzname`` has been removed from ``times`` module because it was
  40. broken. Because of this, the option ``"ZZZ"`` will no longer work in format
  41. strings for formatting and parsing.
  42. Library Additions
  43. -----------------
  44. - Added new parameter to ``error`` proc of ``macro`` module to provide better
  45. error message
  46. - Added new ``deques`` module intended to replace ``queues``.
  47. ``deques`` provides a superset of ``queues`` API with clear naming.
  48. ``queues`` module is now deprecated and will be removed in the future.
  49. - Added ``hideCursor``, ``showCursor``, ``terminalWidth``,
  50. ``terminalWidthIoctl`` and ``terminalSize`` to the ``terminal``
  51. `(doc) <http://nim-lang.org/docs/terminal.html>`_ module.
  52. - Added new module ``distros``
  53. `(doc) <http://nim-lang.org/docs/distros.html>`_ that can be used in Nimble
  54. packages to aid in supporting the OS's native package managers.
  55. Tool Additions
  56. --------------
  57. Compiler Additions
  58. ------------------
  59. - The C/C++ code generator has been rewritten to use stable
  60. name mangling rules. This means that compile times for
  61. edit-compile-run cycles are much reduced.
  62. Language Additions
  63. ------------------
  64. - The ``emit`` pragma now takes a list of Nim expressions instead
  65. of a single string literal. This list can easily contain non-strings
  66. like template parameters. This means ``emit`` works out of the
  67. box with templates and no new quoting rules needed to be introduced.
  68. The old way with backtick quoting is still supported but will be
  69. deprecated.
  70. .. code-block:: nim
  71. type Vector* {.importcpp: "std::vector", header: "<vector>".}[T] = object
  72. template `[]=`*[T](v: var Vector[T], key: int, val: T) =
  73. {.emit: [v, "[", key, "] = ", val, ";"].}
  74. proc setLen*[T](v: var Vector[T]; size: int) {.importcpp: "resize", nodecl.}
  75. proc `[]`*[T](v: var Vector[T], key: int): T {.importcpp: "(#[#])", nodecl.}
  76. proc main =
  77. var v: Vector[float]
  78. v.setLen 1
  79. v[0] = 6.0
  80. echo v[0]
  81. - The ``import`` statement now supports importing multiple modules from
  82. the same directory:
  83. .. code-block:: nim
  84. import compiler / [ast, parser, lexer]
  85. Is a shortcut for:
  86. .. code-block:: nim
  87. import compiler / ast, compiler / parser, compiler / lexer
  88. Bugfixes
  89. --------
  90. The list below has been generated based on the commits in Nim's git
  91. repository. As such it lists only the issues which have been closed
  92. via a commit, for a full list see
  93. `this link on Github <https://github.com/nim-lang/Nim/issues?utf8=%E2%9C%93&q=is%3Aissue+closed%3A%222016-10-23+..+2017-01-07%22+>`_.
  94. - Fixed "staticRead and staticExec have different working directories"
  95. (`#4871 <https://github.com/nim-lang/Nim/issues/4871>`_)
  96. - Fixed "CountTable doesn't support the '==' operator"
  97. (`#4901 <https://github.com/nim-lang/Nim/issues/4901>`_)
  98. - Fixed "documentation for module sequtls apply proc"
  99. (`#4386 <https://github.com/nim-lang/Nim/issues/4386>`_)
  100. - Fixed "Operator `==` for CountTable does not work."
  101. (`#4946 <https://github.com/nim-lang/Nim/issues/4946>`_)
  102. - Fixed "sysFatal (IndexError) with parseUri and the / operator"
  103. (`#4959 <https://github.com/nim-lang/Nim/issues/4959>`_)
  104. - Fixed "initialSize parameter does not work in OrderedTableRef"
  105. (`#4940 <https://github.com/nim-lang/Nim/issues/4940>`_)
  106. - Fixed "error proc from macro library could have a node parameter"
  107. (`#4915 <https://github.com/nim-lang/Nim/issues/4915>`_)
  108. - Fixed "Segfault when comparing OrderedTableRef with nil"
  109. (`#4974 <https://github.com/nim-lang/Nim/issues/4974>`_)
  110. - Fixed "Bad codegen when comparing isNil results"
  111. (`#4975 <https://github.com/nim-lang/Nim/issues/4975>`_)
  112. - Fixed "OrderedTable cannot delete entry with empty string or 0 key"
  113. (`#5035 <https://github.com/nim-lang/Nim/issues/5035>`_)
  114. - Fixed "Deleting specific keys from ordered table leaves it in invalid state."
  115. (`#5057 <https://github.com/nim-lang/Nim/issues/5057>`_)
  116. - Fixed "Paths are converted to lowercase on Windows"
  117. (`#5076 <https://github.com/nim-lang/Nim/issues/5076>`_)
  118. - Fixed "toTime(getGMTime(...)) doesn't work correctly when local timezone is not UTC"
  119. (`#5065 <https://github.com/nim-lang/Nim/issues/5065>`_)
  120. - Fixed "out of memory error from `test=` type proc call when parameter is a call to a table's `[]` proc"
  121. (`#5079 <https://github.com/nim-lang/Nim/issues/5079>`_)
  122. - Fixed "Incorrect field order in object construction"
  123. (`#5055 <https://github.com/nim-lang/Nim/issues/5055>`_)
  124. - Fixed "Incorrect codegen when importing nre with C++ backend (commit 8494338)"
  125. (`#5081 <https://github.com/nim-lang/Nim/issues/5081>`_)
  126. - Fixed "Templates, {.emit.}, and backtick interpolation do not work together"
  127. (`#4730 <https://github.com/nim-lang/Nim/issues/4730>`_)
  128. - Fixed "Regression: getType fails in certain cases"
  129. (`#5129 <https://github.com/nim-lang/Nim/issues/5129>`_)
  130. - Fixed "CreateThread doesn't accept functions with generics"
  131. (`#43 <https://github.com/nim-lang/Nim/issues/43>`_)
  132. - Fixed "No instantiation information when template has error"
  133. (`#4308 <https://github.com/nim-lang/Nim/issues/4308>`_)
  134. - Fixed "realloc leaks"
  135. (`#4818 <https://github.com/nim-lang/Nim/issues/4818>`_)
  136. - Fixed "Regression: getType"
  137. (`#5131 <https://github.com/nim-lang/Nim/issues/5131>`_)
  138. - Fixed "Code generation for generics broken by sighashes"
  139. (`#5135 <https://github.com/nim-lang/Nim/issues/5135>`_)
  140. - Fixed "Regression: importc functions are not declared in generated C code"
  141. (`#5136 <https://github.com/nim-lang/Nim/issues/5136>`_)
  142. - Fixed "Calling split("") on string hangs program"
  143. (`#5119 <https://github.com/nim-lang/Nim/issues/5119>`_)
  144. - Fixed "Building dynamic library: undefined references (Linux)"
  145. (`#4775 <https://github.com/nim-lang/Nim/issues/4775>`_)
  146. - Fixed "Bad codegen for distinct + importc - sighashes regression"
  147. (`#5137 <https://github.com/nim-lang/Nim/issues/5137>`_)
  148. - Fixed "C++ codegen regression: memset called on a result variable of `importcpp` type"
  149. (`#5140 <https://github.com/nim-lang/Nim/issues/5140>`_)
  150. - Fixed "C++ codegen regression: using channels leads to broken C++ code"
  151. (`#5142 <https://github.com/nim-lang/Nim/issues/5142>`_)
  152. - Fixed "Ambiguous call when overloading var and non-var with generic type"
  153. (`#4519 <https://github.com/nim-lang/Nim/issues/4519>`_)
  154. - Fixed "[Debian]: build.sh error: unknown processor: aarch64"
  155. (`#2147 <https://github.com/nim-lang/Nim/issues/2147>`_)
  156. - Fixed "RFC: asyncdispatch.poll behaviour"
  157. (`#5155 <https://github.com/nim-lang/Nim/issues/5155>`_)
  158. - Fixed "Can't access enum members through alias (possible sighashes regression)"
  159. (`#5148 <https://github.com/nim-lang/Nim/issues/5148>`_)
  160. - Fixed "Type, declared in generic proc body, leads to incorrect codegen (sighashes regression)"
  161. (`#5147 <https://github.com/nim-lang/Nim/issues/5147>`_)
  162. - Fixed "Compiler SIGSEGV when mixing method and proc"
  163. (`#5161 <https://github.com/nim-lang/Nim/issues/5161>`_)
  164. - Fixed "Compile-time SIGSEGV when declaring .importcpp method with return value "
  165. (`#3848 <https://github.com/nim-lang/Nim/issues/3848>`_)
  166. - Fixed "Variable declaration incorrectly parsed"
  167. (`#2050 <https://github.com/nim-lang/Nim/issues/2050>`_)
  168. - Fixed "Invalid C code when naming a object member "linux""
  169. (`#5171 <https://github.com/nim-lang/Nim/issues/5171>`_)
  170. - Fixed "[Windows] MinGW within Nim install is missing libraries"
  171. (`#2723 <https://github.com/nim-lang/Nim/issues/2723>`_)
  172. - Fixed "async: annoying warning for future.finished"
  173. (`#4948 <https://github.com/nim-lang/Nim/issues/4948>`_)
  174. - Fixed "new import syntax doesn't work?"
  175. (`#5185 <https://github.com/nim-lang/Nim/issues/5185>`_)
  176. - Fixed "Fixes #1994"
  177. (`#4874 <https://github.com/nim-lang/Nim/issues/4874>`_)
  178. - Fixed "Can't tell return value of programs with staticExec"
  179. (`#1994 <https://github.com/nim-lang/Nim/issues/1994>`_)
  180. - Fixed "startProcess() on Windows with poInteractive: Second call fails ("Alle Pipeinstanzen sind ausgelastet")"
  181. (`#5179 <https://github.com/nim-lang/Nim/issues/5179>`_)