Copper is a minimal, low-level programming language designed by its creator as a replacement for C. Its central aim is to keep the language small and understandable, with simple, explicit syntax built largely from familiar constructs. It adds features often absent from C, including inheritance for any type, generics, multiple return values, option types, deferred statements, and simple iterators. Definitions can appear out of order, imports avoid header files, and the language limits what must live in the global namespace. Ruby-style syntax and fast compilation are also among its stated design characteristics.
The example demonstrates object-oriented programming with a Point class whose integer attributes are set by an initializer and updated by a method. A main function creates a point, changes its coordinates, prints the results, and returns an integer, illustrating typed variables and method calls. The site offers documentation, a cheat sheet, examples, and access to the standard-library and compiler source code. Copper is distributed under the BSD license. Its design favors a selected set of abstractions beyond C while aiming to remain straightforward enough for one person to understand in full.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.