hn.today

Nimony: A New Compiler for Nim

nimony.org177 points93 comments
Screenshot of Nimony: A New Compiler for Nim

Nimony is a new compiler for Nim and the planned home of the Nim 3 language, aimed at making development fast, expressive, and safer across a wide range of targets. It offers incremental and parallel builds, native code generation for several processor families, and compilation to C, JavaScript, and WebAssembly. The toolchain is presented as useful for embedded systems, games, and full-stack applications, with a standard library that includes networking, TLS, HTTP, JSON, regular expressions, and math. For embedded work, it emphasizes handling memory exhaustion, structured inline assembly, and contracts that can prove array, sequence, and string accesses stay within bounds.

The language’s main safety and type-system changes include sum types with exhaustive pattern matching, borrow checking that prevents mutation while data is actively borrowed, and generics checked when they are defined. Concepts specify the operations generic code requires, while an explicit option preserves untyped, duck-typed behavior. The compiler pipeline uses NIF, a shared format that lets developers inspect, compare, and transform intermediate stages and supports incremental and parallel compilation. A plugin system is intended to enable custom checks for risks such as deadlocks and recursion, as well as code generators for GPUs and FPGAs and tools for building domain-specific languages. The project reports a 0.6.2 release and highlights users porting practical projects, including a Vulkan visualizer, a web framework, and an embedded server.

Read on nimony.org93 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

Solid 2.0

Solid 2.0

Solid 2.0 is now stable, five years after version 1.0, with a smaller API and diagnostics designed for AI agents. Its reactive graph now handles asynchronous computations, while built-in server functions support RPC calls and persistent Server-Sent Events connections. (solidjs.com)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.