Copper: a minimal C replacement its author can fully understand

Copper – A minimal low-level programming language with OOP and generics

Copper is a small, low-level programming language built as a replacement for C, with object-oriented classes, generics, and a deliberately simple syntax where almost everything is explicit. The author's guiding goal is minimalism: keeping the language small enough that someone with limited brain power, as he puts it, can grasp all of it. It ships under the BSD license.

Minimalism is the most important feature, the language is intended to be simple so that someone with limited brain power such as me could fully understand it.
  1. teo_zero

    I'd like to come up with some constructive comments, but I find everything so inconsistent and alien to me...

    For example, variable declarations use the pattern <colon> <type>, as in

    var a: Int32

    But literals follow the opposite syntax, as in

    a = Int32: 42

    The return type of a function is introduced by : in func definitions, but by -> in imported func declarations:

    func foo(a:Int):Int

    import func bar(a:Int) -> (Int)

    Other construct that I find far from my habits:

    var w, h, d = 640, 480, 2

    instead of the more obvious (for me):

    var w=640, h=480, d=2

    Arguments are passed by ref, not by val. Good luck with recursion!

  2. Joker_vD

    Surprisingly, the most irritating nitpick for me is the choice of the file extension — surely that should've been ".cu", not ".co"? If I were developing an e.g. Iron programming language (hypothetically — although perhaps so named a language already exists), I'd pick ".fe" in a heartbeat.

    Then again, I'm the kind of person who've chosen $'.\U0001F9CC' (that is, $'.\xF0\x9F\xA7\x8C') for a file extension of my own toy language so...

  3. gorgoiler

    It’s nice they tried with a more fleshed out exemplar. Polymorphism (“generics”) and interfaces (“OOP”) would have been even better to see, especially across any kind of visibility boundary enforced by the language (packages, and the like.)

    Programming to an abstract interface — and in large codebases, enforced visibility controls — represent the middle ground everyone wants, in my experience, between “OOP” and “sir, this is C”.

  4. ricardobeat

    As a Crystal fan, really nice syntax. The documentation leaves open several questions:

    What is the memory model here? What does it compile to? What makes it 'low level'? Is there a GC? Does it have ABI compatibility with C or a FFI?

  5. bogdanoff_2

    Not mine, but I found this to be really interesting as a language created by one person for their own use.

    Also really interesting are the author's blog with articles on language design (for example his thoughts on exceptions, and how he added them to his language, then decided against them), and the change log for the language, showing its evolution.

    https://tibleiz.net/

    https://tibleiz.net/copper/changes.html

  6. pull_my_finger

    I need to put a disclaimer to say that I hate when people hijack a post about foo to talk about bar, but:

    > The language is not object oriented but it provides some features to facilitate object oriented designs.

    It has classes and implicit `self`. Not nothing, but I don't think it's incorrect to say has any more OOP than general purpose languages like Lua or JavaScript in that sense.

    Something like Pony[1] is a more mature and feature rich entry and has a much better OOP story.

    All that said:

    a) I'm sorry for doing the thing I hate when other people do

    b) Creating a language is a big undertaking, and it's super cool that they did it

    c) I see it seems to already be written in Copper too, which is also very neat!

    [1]: https://www.ponylang.io/

  7. clbrmbr

    Is anyone doing more with assembler language lately?

    I have this crazy idea to do a hail mary codex ralphing session to convert an IoT product to assembler so as to aggressively reduce the flash and ram usage. probably a pipe dream, but if my old mentor could build a diet planner on an 80-byte RAM PIC, galaxy-brained GPT should be able to fit my bloated product down from 1MB flash to 256kB, amiright?

  8. nirei

    How does it free memory? I don't get it. I browsed the docs a bit but didn't find a single reference to deallocation. There's alloc for heap allocation but no free?

More from this day

2026-11-01