News

Nim 0.19, a statically typed and compiled language, is out with Nimble 0.9.0 support

2 min read

Earlier this week, the Nim team announced the release of Nim 0.19 with many language changes, async improvements, and support for the latest Nimble 0.9.0.

Nim is a systems and applications programming language, which aims for better performance, portability, and expressiveness. It is a statically typed and compiled language which comes with unparalleled performance in an elegant package. Its common features include:

  • High-performance garbage-collection
  • Compiles to C, C++ or JavaScript
  • Runs on Windows, macOS, Linux

What’s new in Nim 0.19?

Language changes and additions

  • The nil state for strings/seqs is no more supported and their default value is changed to “” / @[]. In the transition period you can use –nilseqs:on.
  • It is now invalid to access the binary zero terminator in Nim’s native strings, but internally it can still have the trailing zero to support zero-copy interoperability with cstring. In the transition period you can compile your code using the new –laxStrings:on switch.
  • Instead of being an all-or-nothing switch, experimental is now a pragma and a command line switch that can allow specific language extensions.
  • You can make dot calls combined with explicit generic instantiations using the syntax x.y[:z], which is converted as y[z](x) by the parser.
  • You can use func as an alias for proc {.noSideEffect.}.
  • Nim now supports for-loop macros to make for loops and iterators more flexible to use. This feature enables a Python-like generic enumerate implementation.
  • In order to implement pattern matching for certain types, case statements can be rewritten via macros.
  • Keyword arguments after the comma are supported in the command syntax.
  • Declaration of thread-local variables inside procs is now supported. This implies all the effects of the global pragma.
  • Nim supports the except clause in the export statement.

Async improvements

Nim’s async macro now works completely with exception handling. The use of await in a try statement is also supported.

Supports Nimble 0.9.0

This release comes with Nimble 0.9.0, which was released recently in August. This version contains a large number of fixes spread across 57 commits. One breaking change that you need to keep in mind is that any package that specifies a bin value in its .nimble file will no longer install any Nim source code files.

Breaking changes

  • The deprecated symbols in the standard library such as system.expr or the old type aliases starting with a T or P prefix have been removed.
  • SystemError is now renamed to CatchableError and is the new base class for any exception that is guaranteed to be catchable.

Read the full announcement on Nim’s official website.

Read Next

Rust as Game Programming Language: Is it any good?

Java 11 is here with TLS 1.3, Unicode 11, and more updates

The 5 most popular programming languages in 2018

Bhagyashree R

Share
Published by
Bhagyashree R

Recent Posts

Top life hacks for prepping for your IT certification exam

I remember deciding to pursue my first IT certification, the CompTIA A+. I had signed…

3 years ago

Learn Transformers for Natural Language Processing with Denis Rothman

Key takeaways The transformer architecture has proved to be revolutionary in outperforming the classical RNN…

3 years ago

Learning Essential Linux Commands for Navigating the Shell Effectively

Once we learn how to deploy an Ubuntu server, how to manage users, and how…

3 years ago

Clean Coding in Python with Mariano Anaya

Key-takeaways:   Clean code isn’t just a nice thing to have or a luxury in software projects; it's a necessity. If we…

3 years ago

Exploring Forms in Angular – types, benefits and differences   

While developing a web application, or setting dynamic pages and meta tags we need to deal with…

3 years ago

Gain Practical Expertise with the Latest Edition of Software Architecture with C# 9 and .NET 5

Software architecture is one of the most discussed topics in the software industry today, and…

3 years ago