--- - branch: MAIN date: Sun Nov 21 16:40:02 UTC 2021 files: - new: '1.23' old: '1.22' path: pkgsrc/lang/nim/Makefile pathrev: pkgsrc/lang/nim/Makefile@1.23 type: modified - new: '1.14' old: '1.13' path: pkgsrc/lang/nim/PLIST pathrev: pkgsrc/lang/nim/PLIST@1.14 type: modified - new: '1.20' old: '1.19' path: pkgsrc/lang/nim/distinfo pathrev: pkgsrc/lang/nim/distinfo@1.20 type: modified id: 20211121T164002Z.91fec1f133f4f3e926f2b404cf4666dea43c0f07 log: | nim: Update to 1.6.0 Changelog: Nim version 1.6 is now officially released! A year in the making, 1.6 is the latest stable release and by far the largest yet. We're proud of what we --- the core team and dedicated volunteers --- have accomplished with this milestone: * 1667 PRs merged (1760 commits) * 893 issues closed * 15 new stdlib modules * new features in more than 40 stdlib modules, including major improvements to 10 commonly used modules * documentation and minor improvements to 170 modules, including 312 new runnable examples * 280 new nimble packages Nim made its first entry in TIOBE index in 2017 at position 129, last year it entered the top-100, and for 2 months the top-50 (link). We hope this release will reinforce this trend, building on Nim's core strengths: a practical, compiled systems programming language offering C++-like performance and portability, Python-like syntax, Lisp-like flexibility, strong C, C++, JS, Python interop, and best-in-class metaprogramming. This release includes improvements in the following areas: * new language features (iterable[T], user-defined literals, private imports, strict effects, dot-like operators, block arguments with optional parameters) * new compiler features (nim --eval:cmd, custom nimscript extensions, customizable compiler messages) * major improvements to --gc:arc and --gc:orc * correctness and performance of integer and float parsing and rendering in all backends * significant improvements in error messages, showing useful context * documentation generation logic and documentation, in particular runnableExamples now works in more contexts * JS, VM and nimscript backend are more consistent with the C backend, allowing more modules to work with those backends, including the imports from std/prelude; the test suite now standardizes on testing stdlib modules on each major backend (C, JS, VM) * support for Apple silicon/M1, 32-bit RISC-V, armv8l, CROSSOS, improved support for NodeJS backend * major improvements to the following modules: system, math, random, json, jsonutils, os, typetraits, wrapnils, lists, hashes including performance improvements * deprecated a number of error prone or redundant features Why use Nim? * One language to rule them all: from shell scripting to web frontend and backend, scientific computing, deep learning, blockchain client, gamedev, embedded, see also some companies using Nim. * Concise, readable and convenient: echo "hello world" is a 1-liner. * Small binaries: echo "hello world" generates a 73K binary (or 5K with further options), optimized for embedded devices (Go: 2MB, Rust: 377K, C++: 56K) [1]. * Fast compile times: a full compiler rebuild takes ~12s (Rust: 15min, gcc: 30min+, clang: 1hr+, Go: 90s) [2]. * Native performance: see Web Frameworks Benchmark, ray tracing, primes. * No need for makefiles, cmake, configure or other build scripts, thanks to compile-time function evaluation (CTFE) and dependency tracking [3]. * Target any platform with a C compiler: Android and iOS, embedded systems, micro-controllers, WASM, Nintendo Switch, Game Boy Advance. * Zero-overhead interop lets you reuse code in C, C++ (including templates, C++ STL), JS, Objective-C, Python (via nimpy). * Built-in documentation generator that understands Nim code and runnable examples that stay in sync. Last but not least, macros let you manipulate/generate code at compile time instead of relying on code generators, enabling writing DSLs and language extensions in user code. Typical examples include implementing Python-like f-strings, optional chaining, command line generators, React-like Single Page Apps, protobuf serialization and binding generators. Installing Nim 1.6 We recommend everyone to upgrade to 1.6: New users Check out if your package manager already ships version 1.6 or install it as described here. Note: earlier this year researchers spotted malware written in Nim programming language which supposedly led to antivirus vendors falsely tagging all software written in Nim as a potential threat, including the Nim compiler, nimble (Nim' s package manager) and so on (core Nim tooling is written entirely in Nim). This has been an ongoing issue ever since - if you have any issues related to this, please report the Nim compiler and associated tooling as false detection to the respective antivirus vendors. Existing users If you have installed a previous version of Nim using choosenim, getting Nim 1.6 is as easy as: choosenim update self choosenim update stable If you don't have choosenim, you can follow the same install link as above. Building from source git clone https://github.com/nim-lang/Nim cd Nim sh build_all.sh The last command can be re-run after pulling new commits. Note that the csources repo used was changed to csources_v1, the new setup is designed to be forward and backward compatible. Building from a CI setup We now have bash APIs to (re-)build Nim from source which hide implementation details, for example: . ci/funs.sh && nimBuildCsourcesIfNeeded. This can be useful for CI when alternatives (using nightly builds or a Docker image) are not suitable; in fact all the existing CI pipelines have been refactored to use this, see #17815. Contributors to Nim 1.6 Many thanks to our recurring and new contributors. Nim is a community driven collaborative effort that welcomes all contributions, big or small. Backward compatibility and preview flags Starting with this release, we've introduced preview flags of the form -d:nimPreviewX (e.g. -d:nimPreviewFloatRoundtrip), which allow users to opt-in to new stdlib/compiler behavior that will likely become the default in the next or a future release. These staging flags aim to minimize backward compatibility issues. We also introduced opt-out flags of the form -d:nimLegacyX, e.g. -d:nimLegacyCopyFile, for cases where the default was changed to the new behavior. For a transition period, these flags can be used to get the old behavior. Here's the list of these flags introduced in this release, refer to the text below for explanations: * -d:nimLegacyCopyFile * -d:nimLegacyJsRound * -d:nimLegacyMacrosCollapseSymChoice * -d:nimLegacyParseQueryStrict * -d:nimLegacyRandomInitRand * -d:nimLegacyReprWithNewline * -d:nimLegacySigpipeHandler * -d:nimLegacyTypeMismatch * -d:nimPreviewDotLikeOps * -d:nimPreviewFloatRoundtrip * -d:nimPreviewHashRef * -d:nimPreviewJsonutilsHoleyEnum Major new features With so many new features, pinpointing the most salient ones is a subjective exercise, but here are a select few: iterable[T] The iterable[T] type class was added to match called iterators, which solves a number of long-standing issues related to iterators. Example: iterator iota(n: int): int = for i in 0..