e006_version_0_9_0.rst 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. Version 0.9.0 released
  2. ======================
  3. .. container:: metadata
  4. Posted by Andreas Rumpf on 23/09/2012
  5. Summary
  6. -------
  7. * Unsigned integers have been added.
  8. * The integer type promotion rules changed.
  9. * The template and macro system evolved.
  10. * Closures have been implemented.
  11. * Term rewriting macros have been implemented.
  12. * First steps to unify expressions and statements have been taken.
  13. * Symbol lookup rules in generics have become stricter to catch more errors.
  14. Bugfixes
  15. --------
  16. - Fixed a bug where the compiler would "optimize away" valid constant parts of
  17. a string concatenation.
  18. - Fixed a bug concerning implicit type conversions in ``case`` statements.
  19. - Fixed a serious code generation bug that caused ``algorithm.sort`` to
  20. produce segmentation faults.
  21. - Fixed ambiguity in recvLine which meant that receiving ``\r\L`` was
  22. indistinguishable from disconnections.
  23. - Many more bugfixes, too many to list them all.
  24. Library Additions
  25. -----------------
  26. - Added the (already existing) module ``htmlgen`` to the documentation.
  27. - Added the (already existing) module ``cookies`` to the documentation.
  28. - Added ``system.shallow`` that can be used to speed up string and sequence
  29. assignments.
  30. - Added ``system.eval`` that can execute an anonymous block of code at
  31. compile time as if was a macro.
  32. - Added ``system.staticExec`` and ``system.gorge`` for compile-time execution
  33. of external programs.
  34. - Added ``system.staticRead`` as a synonym for ``system.slurp``.
  35. - Added ``macros.emit`` that can emit an arbitrary computed string as nimrod
  36. code during compilation.
  37. - Added ``strutils.parseEnum``.
  38. - Added ``json.%`` constructor operator.
  39. - The stdlib can now be avoided to a point where C code generation for 16bit
  40. micro controllers is feasible.
  41. - Added module ``oids``.
  42. - Added module ``endians``.
  43. - Added a new OpenGL wrapper that supports OpenGL up to version 4.2.
  44. - Added a wrapper for ``libsvm``.
  45. - Added a wrapper for ``mongodb``.
  46. - Added ``terminal.isatty``.
  47. - Added an overload for ``system.items`` that can be used to iterate over the
  48. values of an enum.
  49. - Added ``system.TInteger`` and ``system.TNumber`` type classes matching
  50. any of the corresponding types available in Nimrod.
  51. - Added ``system.clamp`` to limit a value within an interval ``[a, b]``.
  52. - Added ``strutils.continuesWith``.
  53. - Added ``system.getStackTrace``.
  54. - Added ``system.||`` for parallel ``for`` loop support.
  55. - The GC supports (soft) realtime systems via ``GC_setMaxPause``
  56. and ``GC_step`` procs.
  57. - The sockets module now supports ssl through the OpenSSL library, ``recvLine``
  58. is now much more efficient thanks to the newly implemented sockets buffering.
  59. - The httpclient module now supports ssl/tls.
  60. - Added ``times.format`` as well as many other utility functions
  61. for managing time.
  62. - Added ``system.@`` for converting an ``openarray`` to a ``seq`` (it used to
  63. only support fixed length arrays).
  64. - Added ``system.compiles`` which can be used to check whether a type supports
  65. some operation.
  66. - Added ``strutils.format``, ``subexes.format`` which use the
  67. new ``varargs`` type.
  68. - Added module ``fsmonitor``.
  69. Changes affecting backwards compatibility
  70. -----------------------------------------
  71. - On Windows filenames and paths are supposed to be in UTF-8.
  72. The ``system``, ``os``, ``osproc`` and ``memfiles`` modules use the wide
  73. string versions of the WinAPI. Use the ``-d:useWinAnsi`` switch to revert
  74. back to the old behaviour which uses the Ansi string versions.
  75. - ``static``, ``do``, ``interface`` and ``mixin`` are now keywords.
  76. - Templates now participate in overloading resolution which can break code that
  77. uses templates in subtle ways. Use the new ``immediate`` pragma for templates
  78. to get a template of old behaviour.
  79. - There is now a proper distinction in the type system between ``expr`` and
  80. ``PNimrodNode`` which unfortunately breaks the old macro system.
  81. - ``pegs.@`` has been renamed to ``pegs.!*`` and ``pegs.@@`` has been renamed
  82. to ``pegs.!*\`` as ``@`` operators now have different precedence.
  83. - The type ``proc`` (without any params or return type) is now considered a
  84. type class matching all proc types. Use ``proc ()`` to get the old meaning
  85. denoting a proc expecing no arguments and returing no value.
  86. - Deprecated ``system.GC_setStrategy``.
  87. - ``re.findAll`` and ``pegs.findAll`` don't return *captures* anymore but
  88. matching *substrings*.
  89. - RTTI and thus the ``marshall`` module don't contain the proper field names
  90. of tuples anymore. This had to be changed as the old behaviour never
  91. produced consistent results.
  92. - Deprecated the ``ssl`` module.
  93. - Deprecated ``nimrod pretty`` as it never worked good enough and has some
  94. inherent problems.
  95. - The integer promotion rules changed; the compiler is now less picky in some
  96. situations and more picky in other situations: In particular implicit
  97. conversions from ``int`` to ``int32`` are now forbidden.
  98. - ``system.byte`` is now an alias for ``uint8``; it used to be an alias
  99. to ``int8``.
  100. - ``bind`` expressions in templates are not properly supported anymore. Use
  101. the declarative ``bind`` statement instead.
  102. - The default calling convention for a procedural **type** is now ``closure``,
  103. for procs it remains ``nimcall`` (which is compatible to ``closure``).
  104. Activate the warning ``ImplicitClosure`` to make the compiler list the
  105. occurrences of proc types which are affected.
  106. - The Nimrod type system now distinguishes ``openarray`` from ``varargs``.
  107. - Templates are now ``hygienic``. Use the ``dirty`` pragma to get the old
  108. behaviour.
  109. - Objects that have no ancestor are now implicitly ``final``. Use
  110. the ``inheritable`` pragma to introduce new object roots apart
  111. from ``TObject``.
  112. - Macros now receive parameters like templates do; use the ``callsite`` builtin
  113. to gain access to the invocation AST.
  114. - Symbol lookup rules in generics have become stricter to catch more errors.
  115. Compiler Additions
  116. ------------------
  117. - Win64 is now an officially supported target.
  118. - The Nimrod compiler works on BSD again, but has some issues
  119. as ``os.getAppFilename`` and ``os.getAppDir`` cannot work reliably on BSD.
  120. - The compiler can detect and evaluate calls that can be evaluated at compile
  121. time for optimization purposes with the ``--implicitStatic`` command line
  122. option or pragma.
  123. - The compiler now generates marker procs that the GC can use instead of RTTI.
  124. This speeds up the GC quite a bit.
  125. - The compiler now includes a new advanced documentation generator
  126. via the ``doc2`` command. This new generator uses all of the semantic passes
  127. of the compiler and can thus generate documentation for symbols hiding in
  128. macros.
  129. - The compiler now supports the ``dynlib`` pragma for variables.
  130. - The compiler now supports ``bycopy`` and ``byref`` pragmas that affect how
  131. objects/tuples are passed.
  132. - The embedded profiler became a stack trace profiler and has been documented.
  133. Language Additions
  134. ------------------
  135. - Added explicit ``static`` sections for enforced compile time evaluation.
  136. - Added an alternative notation for lambdas with ``do``.
  137. - ``addr`` is now treated like a prefix operator syntactically.
  138. - Added ``global`` pragma that can be used to introduce new global variables
  139. from within procs.
  140. - ``when`` expressions are now allowed just like ``if`` expressions.
  141. - The precedence for operators starting with ``@`` is different now
  142. allowing for *sigil-like* operators.
  143. - Stand-alone ``finally`` and ``except`` blocks are now supported.
  144. - Macros and templates can now be invoked as pragmas.
  145. - The apostrophe in type suffixes for numerical literals is now optional.
  146. - Unsigned integer types have been added.
  147. - The integer promotion rules changed.
  148. - Nimrod now tracks proper intervals for ``range`` over some built-in operators.
  149. - In parameter lists a semicolon instead of a comma can be used to improve
  150. readability: ``proc divmod(a, b: int; resA, resB: var int)``.
  151. - A semicolon can now be used to have multiple simple statements on a single
  152. line: ``inc i; inc j``.
  153. - ``bind`` supports overloaded symbols and operators.
  154. - A ``distinct`` type can now borrow from generic procs.
  155. - Added the pragmas ``gensym``, ``inject`` and ``dirty`` for hygiene
  156. in templates.
  157. - Comments can be continued with a backslash continuation character so that
  158. comment pieces don't have to align on the same column.
  159. - Enums can be annotated with ``pure`` so that their field names do not pollute
  160. the current scope.
  161. - A proc body can consist of an expression that has a type. This is rewritten
  162. to ``result = expression`` then.
  163. - Term rewriting macros (see `trmacros <http://nimrod-code.org/trmacros.html>`_)
  164. have been implemented but are still in alpha.