e013_version_0_10_2.rst 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. Version 0.10.2 released
  2. =======================
  3. .. container:: metadata
  4. Posted by Dominik Picheta on 29/12/2014
  5. This release marks the completion of a very important change to the project:
  6. the official renaming from Nimrod to Nim. Version 0.10.2 contains many language
  7. changes, some of which may break your existing code. For your convenience, we
  8. added a new tool called `nimfix <nimfix.html>`_ that will help you convert your
  9. existing projects so that it works with the latest version of the compiler.
  10. Progress towards version 1.0
  11. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  12. Although Nim is still pre-1.0, we were able to keep the number of breaking
  13. changes to a minimum so far. Starting with version 1.0, we will not introduce
  14. any breaking changes between major release versions.
  15. One of Nim's goals is to ensure that the compiler is as efficient as possible.
  16. Take a look at the
  17. `latest benchmarks <https://github.com/logicchains/LPATHBench/blob/master/writeup.md>`_,
  18. which show that Nim is consistently near
  19. the top and already nearly as fast as C and C++. Recent developments, such as
  20. the new ``asyncdispatch`` module will allow you to write efficient web server
  21. applications using non-blocking code. Nim now also has a built-in thread pool
  22. for lightweight threading through the use of ``spawn``.
  23. The unpopular "T" and "P" prefixes on types have been deprecated. Nim also
  24. became more expressive by weakening the distinction between statements and
  25. expressions. We also added a new and searchable forum, a new website, and our
  26. documentation generator ``docgen`` has seen major improvements. Many thanks to
  27. Nick Greenfield for the much more beautiful documentation!
  28. What's left to be done
  29. ~~~~~~~~~~~~~~~~~~~~~~
  30. The 1.0 release is actually very close. Apart from bug fixes, there are
  31. two major features missing or incomplete:
  32. * ``static[T]`` needs to be defined precisely and the bugs in the
  33. implementation need to be fixed.
  34. * Overloading of the assignment operator is required for some generic
  35. containers and needs to be implemented.
  36. This means that fancy matrix libraries will finally start to work, which used
  37. to be a major point of pain in the language.
  38. Nimble and other Nim tools
  39. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  40. Outside of the language and the compiler itself many Nim tools have seen
  41. considerable improvements.
  42. Babel the Nim package manager has been renamed to Nimble. Nimble's purpose
  43. is the installation of packages containing libraries and/or applications
  44. written in Nim.
  45. Even though Nimble is still very young it already is very
  46. functional. It can install packages by name, it does so by accessing a
  47. packages repository which is hosted on a GitHub repo. Packages can also be
  48. installed via a Git repo URL or Mercurial repo URL. The package repository
  49. is searchable through Nimble. Anyone is free to add their own packages to
  50. the package repository by forking the
  51. `nim-lang/packages <https://github.com/nim-lang/packages>`_ repo and creating
  52. a pull request. Nimble is fully cross-platform and should be fully functional
  53. on all major operating systems.
  54. It is of course completely written in Nim.
  55. Changelog
  56. ~~~~~~~~~
  57. Changes affecting backwards compatibility
  58. -----------------------------------------
  59. - **The language has been renamed from Nimrod to Nim.** The name of the
  60. compiler changed from ``nimrod`` to ``nim`` too.
  61. - ``system.fileHandle`` has been renamed to ``system.getFileHandle`` to
  62. prevent name conflicts with the new type ``FileHandle``.
  63. - Comments are now not part of the AST anymore, as such you cannot use them
  64. in place of ``discard``.
  65. - Large parts of the stdlib got rid of the T/P type prefixes. Instead most
  66. types now simply start with an uppercased letter. The
  67. so called "partial case sensitivity" rule is now active allowing for code
  68. like ``var foo: Foo`` in more contexts.
  69. - String case (or any non-ordinal case) statements
  70. without 'else' are deprecated.
  71. - Recursive tuple types are not allowed anymore. Use ``object`` instead.
  72. - The PEGS module returns ``nil`` instead of ``""`` when an optional capture
  73. fails to match.
  74. - The re module returns ``nil`` instead of ``""`` when an optional capture
  75. fails to match.
  76. - The "symmetric set difference" operator (``-+-``) never worked and has been
  77. removed.
  78. - ``defer`` is a keyword now.
  79. - ``func`` is a keyword now.
  80. - The ``using`` language feature now needs to be activated via the new
  81. ``{.experimental.}`` pragma that enables experimental language features.
  82. - Destructors are now officially *experimental*.
  83. - Standalone ``except`` and ``finally`` statements are deprecated now.
  84. The standalone ``finally`` can be replaced with ``defer``,
  85. standalone ``except`` requires an explicit ``try``.
  86. - Operators ending in ``>`` are considered as "arrow like" and have their
  87. own priority level and are right associative. This means that
  88. the ``=>`` and ``->`` operators from the `future <future.html>`_ module
  89. work better.
  90. - Field names in tuples are now ignored for type comparisons. This allows
  91. for greater interoperability between different modules.
  92. - Statement lists are not converted to an implicit ``do`` block anymore. This
  93. means the confusing ``nnkDo`` nodes when working with macros are gone for
  94. good.
  95. Language Additions
  96. ------------------
  97. - The new concurrency model has been implemented including ``locks`` sections,
  98. lock levels and object field ``guards``.
  99. - The ``parallel`` statement has been implemented.
  100. - ``deepCopy`` has been added to the language.
  101. - The builtin ``procCall`` can be used to get ``super``-like functionality
  102. for multi methods.
  103. - There is a new pragma ``{.experimental.}`` that enables experimental
  104. language features per module, or you can enable these features on a global
  105. level with the ``--experimental`` command line option.
  106. Compiler Additions
  107. ------------------
  108. - The compiler now supports *mixed* Objective C / C++ / C code generation:
  109. The modules that use ``importCpp`` or ``importObjc`` are compiled to C++
  110. or Objective C code, any other module is compiled to C code. This
  111. improves interoperability.
  112. - There is a new ``parallel`` statement for safe fork&join parallel computing.
  113. - ``guard`` and ``lock`` pragmas have been implemented to support safer
  114. concurrent programming.
  115. - The following procs are now available at compile-time::
  116. math.sqrt, math.ln, math.log10, math.log2, math.exp, math.round,
  117. math.arccos, math.arcsin, math.arctan, math.arctan2, math.cos,
  118. math.cosh, math.hypot, math.sinh, math.sin, math.tan, math.tanh,
  119. math.pow, math.trunc, math.floor, math.ceil, math.fmod,
  120. os.getEnv, os.existsEnv, os.dirExists, os.fileExists,
  121. system.writeFile
  122. - Two backticks now produce a single backtick within an ``emit`` or ``asm``
  123. statement.
  124. - There is a new tool, `nimfix <nimfix.html>`_ to help you in updating your
  125. code from Nimrod to Nim.
  126. - The compiler's output has been prettified.
  127. Library Additions
  128. -----------------
  129. - Added module ``fenv`` to control the handling of floating-point rounding and
  130. exceptions (overflow, division by zero, etc.).
  131. - ``system.setupForeignThreadGc`` can be used for better interaction with
  132. foreign libraries that create threads and run a Nim callback from these
  133. foreign threads.
  134. - List comprehensions have been implemented as a macro in the ``future``
  135. module.
  136. - The new Async module (``asyncnet``) now supports SSL.
  137. - The ``smtp`` module now has an async implementation.
  138. - Added module ``asyncfile`` which implements asynchronous file reading
  139. and writing.
  140. - ``osproc.kill`` has been added.
  141. - ``asyncnet`` and ``asynchttpserver`` now support ``SO_REUSEADDR``.
  142. Bugfixes
  143. --------
  144. - ``nil`` and ``NULL`` are now preserved between Nim and databases in the
  145. ``db_*`` modules.
  146. - Fixed issue with OS module in non-unicode mode on Windows.
  147. - Fixed issue with ``x.low``
  148. (`#1366 <https://github.com/Araq/Nim/issues/1366>`_).
  149. - Fixed tuple unpacking issue inside closure iterators
  150. (`#1067 <https://github.com/Araq/Nim/issues/1067>`_).
  151. - Fixed ENDB compilation issues.
  152. - Many ``asynchttpserver`` fixes.
  153. - Macros can now keep global state across macro calls
  154. (`#903 <https://github.com/Araq/Nim/issues/903>`_).
  155. - ``osproc`` fixes on Windows.
  156. - ``osproc.terminate`` fixed.
  157. - Improvements to exception handling in async procedures.
  158. (`#1487 <https://github.com/Araq/Nim/issues/1487>`_).
  159. - ``try`` now works at compile-time.
  160. - Fixes ``T = ref T`` to be an illegal recursive type.
  161. - Self imports are now disallowed.
  162. - Improved effect inference.
  163. - Fixes for the ``math`` module on Windows.
  164. - User defined pragmas will now work for generics that have
  165. been instantiated in different modules.
  166. - Fixed queue exhaustion bug.
  167. - Many, many more.