Nature Programming Language Sparks Debate Over Systems Programming Claims Despite Garbage Collection

BigGo Editorial Team
Nature Programming Language Sparks Debate Over Systems Programming Claims Despite Garbage Collection

A new programming language called Nature has emerged, positioning itself as a Go-inspired alternative that aims to address some of Go's limitations while maintaining its strengths. The language has reached an early usable version with stable syntax APIs, but its marketing claims have sparked significant community discussion about what truly constitutes a systems programming language.

Nature was created by a developer who uses Go daily but felt frustrated by its overly simplistic syntax, insufficient type system, and cumbersome error handling. The language incorporates many of Go's successful features including goroutines, garbage collection, channels, and cross-compilation capabilities, while adding improvements like union types, generics, pattern matching, and try/catch error handling.

Language Improvements Over Go:

  • Union types and comprehensive type system
  • Generics support from the beginning
  • Try/catch error handling instead of explicit error checking
  • Pattern matching with match keyword
  • Null-value safety with nullable types (string?)
  • Better C interoperability

The Systems Programming Language Controversy

The most heated discussion centers around Nature's classification as a systems programming language despite using garbage collection. Community members have raised concerns that this terminology is being used too loosely, potentially eroding the meaning of the term. Critics argue that any language with garbage collection cannot truly be considered suitable for systems programming, particularly for operating system kernels where stop-the-world pauses could be problematic.

Who would use an operating system that suddenly stops the entire world because some random language's runtime wants to collect its memory garbage?

The Nature author has acknowledged these concerns and agreed to adjust the language's marketing materials. However, they defend the practical use of garbage-collected languages in certain system contexts, citing their own experience using Go for IoT devices like routers and TV boxes running on various architectures including RISC-V, MIPS, and ARM variants.

Technical Architecture and Performance Claims

Nature distinguishes itself by avoiding LLVM dependency, instead compiling directly to target platform machine code. This design choice promises faster compilation speeds and more customized error handling, following a path similar to Zig. The language currently supports Linux and macOS on both AMD64 and ARM64 architectures, with plans to add WebAssembly and RISC-V support.

The runtime incorporates several performance-focused features borrowed from Go's proven architecture, including a high-performance garbage collector with short stop-the-world times, a memory allocator similar to Google's tcmalloc, and support for millions of coroutine switches per second. The language also includes built-in libuv for handling IO event loops and follows system ABI conventions for direct C library integration.

Key Technical Features:

  • No LLVM dependency - compiles directly to machine code
  • High-performance garbage collector with short STW times
  • Memory allocator similar to Google's tcmalloc
  • Built-in libuv for IO event loops
  • Support for millions of coroutine switches per second
  • Cross-compilation and static linking support

Language Design and Future Development

Nature's syntax differs from Go while maintaining familiar concepts. The language supports nullable types with a question mark syntax, tuple types, and aims to provide better C interoperability than Go. Notably, the language currently uses ASCII encoding for strings rather than UTF-8, which has drawn criticism from developers who consider Unicode support essential for modern programming languages.

The author admits to being relatively inexperienced in programming language design and has been receptive to community feedback. Plans include adding enum support, improving Unicode handling, and potentially changing the language name due to search engine optimization concerns. The project also faces practical challenges, such as implementing a macOS cross-platform linker to enable full cross-compilation support.

While Nature shows promise as a Go alternative with enhanced features, its early stage and ongoing debates about positioning suggest it will need time to mature before gaining broader adoption. The community discussion highlights the ongoing evolution of programming language categories and the challenges faced by new languages trying to carve out their niche in an increasingly crowded field.

Reference: Nature Programming Language