Copper – A minimal low-level programming language with OOP and generics
Copper, a new minimalist low-level programming language, emerges as a personal C replacement, designed for utmost simplicity and clarity. Its explicit syntax and focus on core features spark detailed technical discussions on OOP, memory management, and language design. Hacker News is captivated by the elegant example code and the philosophical debate surrounding new language creation in the age of AI.
The Lowdown
Copper is presented as a minimalist, low-level programming language intended as a personal replacement for C. The author emphasizes simplicity, aiming for a language that's easy to understand and use, with explicit syntax and common constructs. It features object-oriented programming (OOP) and generics, though the implementation of these aspects is a point of discussion among commentators.
- Core Philosophy: Designed for minimalism and simplicity, making it fully understandable even for those with 'limited brain power'.
- Syntax: Explicit and common constructs, with a Ruby-like appearance.
- Key Features: Includes classes for OOP, generics, and attributes for defining properties.
- Low-Level Nature: Intends to replace C, implying direct memory control, though specific details like memory model and garbage collection are not immediately obvious.
- Licensing: Released under the BSD license.
- Self-Hosting: The language's compiler is reportedly written in Copper itself, targeting a C backend.
The language's creation by one person for their own use, alongside blog posts on language design, highlights a personal and iterative approach to development, offering insights into its evolution and design choices.
The Gossip
Syntax & Semantics Scrutiny
Commenters dive deep into Copper's technical specifics, particularly its claimed OOP and generics, and memory management. Many seek clarification on how polymorphism, interfaces, and visibility boundaries are handled, comparing its OOP aspects to languages like Lua, JavaScript, or Pony. The absence of explicit deallocation in examples prompts questions about its memory model, garbage collection, and C ABI compatibility, while others praise its Ruby-like syntax and appreciate its simplicity.
File Extension Frivolity
A lighthearted, yet surprisingly detailed, tangent emerges around Copper's `.co` file extension. The top commenter provocatively suggests `.cu` (for Copper), leading to a discussion about chemical element abbreviations for language extensions (`.fe` for Iron, `.hg` for Mercurial, `.ag` for Silver). It's quickly noted that `.cu` is already claimed by CUDA, adding a touch of humor and practical constraint to the naming debate.
The 'Is Coding Dead?' Debate
A highly contentious discussion erupts when one commenter boldly claims that "the days of releasing new programming languages is gone" and that "Humans don't code anymore," with LLMs now making language choices. This perspective is met with vigorous pushback from many who defend the ongoing human role in coding, the joy of creating new tools, and the importance of understanding underlying principles, likening the AI argument to early fears about calculators eroding mathematical understanding.
Self-Hosting & Bootstrapping Blues
The fact that Copper is self-hosted (written in Copper itself) sparks a classic debate among language enthusiasts. One side argues that self-hosting is a "worst mistake" and a "death to bootstrapping," while others strongly defend it, particularly when a stable C backend is provided. They highlight that bootstrapping challenges are often overstated and that self-hosting can lead to a more robust and self-reliant language ecosystem, questioning why it's considered harder than writing toolchains in C.