Hasty Briefsbeta

Nimony (eventually Nim 3.0) Design Principles

9 days ago
  • #programming
  • #Nim
  • #compiler
  • Nimony is a new compiler for a variant of Nim, aiming to become Nim 3.0.
  • It focuses on hard real-time and embedded systems, ensuring predictable execution time (WCET).
  • Memory management is scope-based with destructors and move semantics, simplifying safety.
  • Error handling avoids traditional exceptions, using object states or thread-local error variables.
  • ErrorCode enum provides a unified way to handle errors across libraries and systems.
  • Out-of-memory (OOM) handling is unique, with customizable handlers and graceful error propagation.
  • Generics are fully type-checked, improving IDE support and early error detection.
  • Concurrency and parallelism are unified under a single `spawn` construct, simplifying async and multi-threaded programming.
  • Parallel for loops offer structured parallelism without flow variables.
  • Meta-programming is enhanced with compiler plugins, allowing deep code transformations.
  • Module plugins enable whole-module transformations, replacing macros in many cases.
  • Target release is set for autumn 2025, with active development ongoing.