Release of Nim 1.2.0

A new version of the system programming language Nim has been released. It has partial incompatibility with version 1.0, for example, due to stricter type conversions. However, there is a flag for this —useVersion:1.0.

The main innovation is a new garbage collector, enabled by the option —gc:arc. The language author, Andreas Rumpf, plans to write a detailed article on the advantages of ARC, but for now, he suggests checking out his presentation at FOSDEM, which shows the benchmark results.

  • The compiler now supports the —asm option for more convenient exploration of the generated assembler code.
  • The align pragma can be used for variables and object fields, similar to alignas in C/C++.
  • =sink operator is now optional. The compiler can now use a combination of =destroy and copyMem for efficient object relocation.
  • Conversions to unsigned integers are not checked at runtime. Details can be found in https://github.com/nim-lang/RFCs/issues/175
  • The new syntax for lvalue: var b {.byaddr.} = expr, included via import std/decls
  • The compiler supports the new key —panics:on, which turns runtime errors such as IndexError or OverflowError into fatal errors that cannot be caught via try. This can improve runtime efficiency and program size.
  • The generated JS code uses only spaces instead of a mix of spaces and tabs.
  • The compiler has added support for the .localPassc pragma, which allows handling special C(++) backend options for the C(++) file generated from the current Nim module.
  • Nimpretty no longer accepts a negative argument for setting indentation, as it broke files.
  • New macros (collect, dup, capture) have been added, included via import sugar.

In addition, many changes have been made to the standard library and numerous bug fixes.

Source: linux.org.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster