Nim 1.0 release, imperative programming language

Just today, Nim team is pleased to announce the long-awaited 1.0 version of the language.

Nim has focused on providing efficient, readable and flexible class statically compiled language.

Version 1.0 logo can be used in future versions of Nim next few years will not undermine the current version of the code, began to have a stable foundation.

Nim build a warm and welcoming community , ready to greet the arrival of novices.

If you are a novice, take a look at our learning resources , in our Trials field trial Nim.

Ensure stability

Version 1.0 is a stable long-term support release, accepting only bug fixes and new features in the future, provided that they do not break backwards compatibility.

1.0.x branch will receive the needed bug fixes. Does not affect backward compatible with the new features will continue steadily into the 1.x branch.

Our goal is to ensure sustainable Nim1.0 compiled code in the future any stable Nim1.x version of the compiler.

What is included to ensure stability?

Backward compatibility covers only stable part of the language, which is defined in part manual on.

The compiler will achieve the characteristics described in the experimental laboratory manual . These characteristics may exist backward incompatible; includes concepts, do marks and other features. There are also standard library modules still unstable - these have been labeled as "unstable API" in the document.

You can use the experimental characteristics, even if the product, but pay attention to these as full as we expected.

Standard libraries are also covered, as long as the issues in the document module clearly marked v1.0 label.

Exceptions

Of course, we must also admit that there are exceptions. In some serious cases, such as the standard library security vulnerability, we reserve the right to use it backwards incompatibilities.

Installation Nim1.0

New hand

Look at your operating system package manager is not already built version 1.0 or by this installation.

Users stock

If a user installed before using choosenim version of Nim, simple as follows:

$choosenim update stable

Devotees

Long years, more than 500 people had contributed to the code of Nim, implement new features, bug fixes and problems, write documents, and more. Nim team thanks to all who helped us build Nim become today's contributors.

We would also like to thank all building Nimble package, extended Nim ecological contributors. Nimble package growth and stability, in August 2019 we broke the 1000 mark in the history of the package. We are optimistic for the 1.0 release will contribute to longer-term development ecology.

Father Nim language for version 1.0 of Personal reflections

Hard work pays off, we finally did it! The much-anticipated version 1.0 came.

When I started to develop Nim, I think is a compiled C does not exceed simple language 20,000 lines of code. The core guidelines are Nim is a macro language to extend the system lightweight micro-kernel missing all properties.

The current compiler plus it uses part of the standard library has about 140,000 lines of code to run on the operating system and sufficient CPU architecture, can be compiled into C ++ and JavaScript, and meta-programming capabilities Nim is one of the best. When the language is no longer a lightweight, meta-programming proved no substitute for building all aspects of modern languages ​​needed.

For example, when using the macro Nim implemented async system, the system needs to be able to macro code into the state machine. The state machine needs to obtain and goto the way the environment. So Nim kernel need to increase the "closure iterator" to achieve.

In addition, we do not really know how to use a macro type of system provides system-level scalability, so Nim kernel needs generics and generic constraints.

About development progress

Said before, I am satisfied with the progress of the development of language, version 1.0 means that we now have different development progress: before Nim was too much, "the principle of least surprise" to promote the cause everybody can say "Well, I think it should have been work ... "and then realize attendant also added a special case. Special circumstances may fire and make the system more difficult to understand, and ultimately produced a surprise. From the beginning we used version 1.0 "specification first" development: the first to write RFC, discuss, write specifications, and then realized, to get insight into the norms in the implementation process.

Yes, I know specification / manual there are some omissions and bug, which is improving, the new "destructor" language features is to use "standard first" approach developed in the specification even if there is defective, the result of a lot of Ye Hao .

Nim's future

We want to focus on tools Nim, including Nimsuggest (Nim variety Code Editor completion engine), Nimble (Nim's package manager) and Nimpretty (Nim source code formatting tools). Personally I think that "incremental compilation" (IC) is the next milestone Nim compiler. IC will further accelerate Nim has been compiled quickly, caching the results of macro expansion and other construction.

About concepts and owned: I was told that these two characteristics must be released because they changed the actual Nim write code together with version 1.0. I do not agree, there is no concept of language work well, have some concepts are also available, although their syntax and semantics need improvement. It is not certain whether it will use owned in the language, I think there are other Nim improved memory management.

The aim is to deliver version 1.0 we have, not what we want. The future is bright, version 1.0 is just the beginning. Like a marriage, the wedding is just the beginning.

v1.0 - 2019-09-23

The impact of changes in backward compatibility

- -d: nimBinaryStdFiles no switch. stdin / stdout / stderr once again become a binary file. Only affects Windows.

- In the Windows console application, code-page set when the program begins UTF-8. Use -d: nimDontSetUtf8CodePage switch to turn off.

- language definition and compiler symbols on gensym more stringent hygiene template. See manual . For more details, the use of compiler switches --oldgensym: on a transition period.

Destructive changes in the standard library

- We removed unicde.Rune16, because the name is wrong, they can not find a place to use it. If you need to add the following code to the project:

type
  Rune16* = distinct int16

- exportc in nim cpp now use C instead of C ++ naming smash smash named, matching importc. Exportcpp C ++ using the new crushing nim cpp time.

Disruptive change the compiler

- int Allow converted implicitly to a small size range type (rang [0'i8..10'i8]) has a bug fixes.

Library Add

- encoding.getCurrentEncoding now distinguish between coding and console operating system code. Only meaningful in Windows.

- Add system.getOsFileHandle usually more common than system.getFileHandle. Only meaningful in Windows.

- Add json.parseJsonFragments iterator JSON accelerate processing, when JSON segments separated by spaces.

Libraries change

- Add os.delEnv and nimscript.delEnv.

- Open the Oid in hashtables in usage.

- Add unsafeColumnAt process, return to unsafe cstring from InstantRow.

- Open sha1 module Sha1Digest, Sha1State type and newSha1State, update and finalize process.

- Add std / monotimes monotone module timestamp.

- two overloaded exec consistency error handling.

- The following modules are now official instability API:

  - std/varints
  - core/allocators
  - core/hotcodereloading
  - asyncstreams
  - base64
  - browsers
  - collections/rtarrays
  - collections/sharedlist
  - collections/sharedtable
  - concurrency/atomics
  - concurrency/cpuload
  - concurrency/threadpool
  - coro
  - endians
  - httpcore
  - parsesql
  - pathnorm
  - reservedmem
  - typetraits
Other standard library modules is stable version 1.0 of the API.

Add language

- inline iterator now supports return lent T type, similar to the iterator returned var T:

iterator myitems[T](x: openarray[T]): lent T
iterator mypairs[T](x: openarray[T]): tuple[idx: int, val: lent T]

- Add importjs pragma may be used alternatively to import importcpp importc JavaScript and symbols. importjs routine type mode with maximum flexibility.

Language change

- unit64 is now conventional ordinal type. This means closing high (uint64) may compile and produce the correct value.

Tool change

- Nim compiler now can not nim c -r Nim recompile the project if dependency files have not changed. Line options can be overridden by --forceBuild command.

- Nim compiler now warns unused import module, you can use the top of the module you want to import the compiler does not indicate a warning {.used.}.

- testament test tools from the tester name was changed testament, can be used as a tool to automatically run Nim tests.

The compiler change

- VM can now be strong turn any integer type.

Guess you like

Origin www.oschina.net/news/110079/nim-1-0-released