Arguments are passed by ref, not by val. Good luck with recursion!
marckerbiquet 1 hours ago [-]
Author here. The language has still many inconsistencies but not these ones.
Import functions is done the same way:
func foo(a: Int): Int
import func foo(Int): Int
May be the doc is outdated.
The multiple declaration is consistent with assignment:
var w, h = 640, 480
w, h = 640, 680
w, h = getBoundingBox(obj)
The syntax
var a = Int: 32
is unusual compared to many other languages because it just use a simple syntax:
var id = expr
The type is prefixed only to resolve literals:
var a = Int32: 42
var b = Uint8: 42
It can be useful in generic functions:
println("The answer is \a", Float32: 42)
But to create uninitialized variables I had to keep the syntax:
var id: Type
yxhuvud 5 hours ago [-]
The parallel assignment just work mostly like it does in ruby so that doesn't look weird to me (except the need for 'var' in the first place).
Agreed on the rest, though I don't understand what the problem would be with recursion. Is it using reference passing also for primitives like integers?
teo_zero 3 hours ago [-]
> Is it using reference passing also for primitives like integers?
That's what I assumed, but honestly I might have misunderstood the docs. This passage is not very clear:
> Copper manipulates only references to objects. Simple data types such as integers must be seen as references to stateless objects (i.e. objects that have no state in memory).
yxhuvud 2 hours ago [-]
Sounds like they store the integer in the reference itself in that case. Which also is how Ruby does things (though Ruby has to decide what is what at runtime and thus steal a couple of bits off every integer).
metadat 7 hours ago [-]
Agreed.. and what is going on with the `!` syntax? The docs are not exactly clear on the purpose in all cases.
I think it's the opposite of & in C++, that is T! is an object, while T is a reference to an object.
Joker_vD 12 hours ago [-]
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...
vopi 11 hours ago [-]
Unfortunately for Copper in particular, .cu is associated with CUDA (so perhaps that’s why).
mixmastamyk 3 hours ago [-]
And don’t ask what it means in Portuguese.
mxkopy 11 hours ago [-]
My first thought
dapperhn 11 hours ago [-]
Not a programming language, but Jane Street has (had?) a code review tool called Iron, abbreviated "fe".
And they’re not alone — mercurial is hg and the silver searcher is ag.
anonymous908213 12 hours ago [-]
I like the way you think.
mikkelam 11 hours ago [-]
You're appreciated
gorgoiler 13 hours ago [-]
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”.
owlstuffing 11 hours ago [-]
> Polymorphism (“generics”) and interfaces (“OOP”) would have been even better to see
Yep. Interface-based (true) delegation between objects would be my go-to if it existed.
sproutini 9 hours ago [-]
Subtyping and generics raise the question of whether containers are covariant or contravariant.
joe_the_user 12 hours ago [-]
Yes,
The example definitely shines. Doing something barely non-trivial is great since it gives a feeling for the language. I wish other language introduction pages would take note.
jrumbut 6 hours ago [-]
I really like this language introduction.
It does feel like you need some shared understanding with the author about what the interesting parts of a programming language are and what can be left implicit.
Perhaps the author and I have similar intuitions? I guess I also like that isn't pure LLM output style. It was refreshing to see some human work.
ricardobeat 15 hours ago [-]
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?
15 hours ago [-]
bogdanoff_2 3 days ago [-]
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.
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!
Re "c)": No, self-hosting is the biggest temptation, and the worst mistake, for any programming language. It's death to bootstrapping. However, if you do succumb to the temptation to self-host, having a C backend, as Copper does, is probably the best way to handle it.
p1necone 12 hours ago [-]
I've never really understood the opposition to self-hosting.
As long as:
* Your language is the kind of language that suits compiler development.
and
* You support compiling to C or something so that bootstrapping doesn't involve an opaque binary or compiling 30 different git commits in a row.
What are the downsides exactly?
simonask 9 hours ago [-]
The usual argument is that it is a distraction when you’re designing a language, and it leads to programming languages that are all excellent for writing compilers and parsers, but not particularly good for other things.
Since the majority of programs are not compilers, it might make more sense to focus on interesting things that aren’t relevant to compilers.
Some ideas from the top of my head: async I/O, a great SIMD story, effect systems, robustness systems for long-running processes (I’m only aware of Erlang/Elixir), and many others.
Compilers do exercise some things, like error handling and memory management, but they’re not particularly difficult or interesting in general.
ktimespi 15 hours ago [-]
What's the problem with self-hosting? I do imagine it's easier to write a compiler in something like Haskell.
Conscat 14 hours ago [-]
The problems with bootstrapping a self hosted compiler are often greatly overstated.
ivan_gammel 13 hours ago [-]
Self-hosting is a trivial matter if you can roughly map a subset of features of an existing language to your language. Write bootstrap compiler in that language and translator in parallel (as long as you have good AST/LST), run conformance tests on both.
Zak 13 hours ago [-]
As long as one of the backends is something widely available, I don't see a problem. C is a decent option. LLVM IR is another.
jibalt 11 hours ago [-]
This isn't at all true, as proven especially by Zig.
Conscat 8 hours ago [-]
I would go so far as to say Zig even tries too hard to solve it (although they reused existing technology they already wanted, so it was almost free). You can bootstrap a self-hosted compiler to new environments by porting the source, cross-compiling it, and scp'ing or otherwise downloading it over to the target. And that's if you don't want to just use QEMU to develop it. We already do this exact thing when developing for embedded devices or often any type of aarch64 programs.
dnautics 8 hours ago [-]
As someone who has monkeyed around with the zig compiler, having the bootstrap done made monkeying around way, way more straightforward than when it wasn't around. I will admit I don't know the details and it's possible the QOL improvements that affected me only depended on other things that got solved along the way. But I have been building the stage0 and stage1 compilers to get my first artifact when I bump to the latest.
throwaway894345 11 hours ago [-]
Why is it harder to bootstrap a self-hosted language than it is to bootstrap a language implemented in C, which itself must be bootstrapped?
Bootstrapping is a one-time cost, but implementing the toolchain in C is a cost everyone has to pay every single time they touch the toolchain source.
uecker 2 hours ago [-]
What additional cost does it have to implement the toolchain in C? I would say there is some benefit in terms of implicit testing to have a compiler self-hosting. But having a toolchain in C also has real benefits.
throwaway894345 11 hours ago [-]
OOP is one of the weirdest topics in computer science in that no one can agree on what it
means. Even proponents of “OOP” have wildly different ideas about what it means. For some it’s “encapsulation”, for others it’s “inheritance”, for others it’s “message passing”. It seems the glue that binds OOP proponents together is little more than the sequence of letters: O-O-P.
pull_my_finger 6 hours ago [-]
I drank the Elegant Objects[1] koolaid, and recommend the two books (Elegant Objects vol 1 and 2) whole-heartedly to anyone interested in OOP. Pony lang lets you write 95% of the kind of OOP described in the books idiomatically, without any kind of crazy shenanigans.
I think most people today would say encapsulation and message passing are pretty core to the definition of OO and inheritance is largely seen as an anti-pattern.
One thing I really like about Elegant Objects is that it is very palatable to FP enjoyers. Objects must encapsulate state, but they must also be immutable. Good OOP is declarative like good FP. It looks a lot like lisp imo. You're encouraged to code against interfaces instead of using inheritance etc.
Since we’re nitpicking: you used a double negative, which is a confusing way of communicating an idea.
soperj 15 hours ago [-]
The bike shedders have entered the chat.
There's a difference between nitpicking the topic of the article and nitpicking someone's grammar.
dumpsterdiver 15 hours ago [-]
To be fair, it really is a confusing way of communicating, and it’s useful feedback when taken to heart.
Conscat 14 hours ago [-]
It's not confusing.
Someone 13 hours ago [-]
> 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.
IMO, that text is confusing.
“Not nothing” is saying it has some OO features.
“I don't think it's incorrect to say has any more OOP than general purpose languages like Lua or JavaScript in that sense” = I think this language has more OOP than languages like Lua or JavaScript”
So, that more or less says “A, but A”. If so, what’s the “but” about?
pull_my_finger 13 hours ago [-]
I think it needs more negatives. "I don't think it's incorrect to say [it does not have] any more OOP than general purpose languages like Lua or JavaScript in that sense".
I had retyped it a few times trying not to come off as overly negative or a jerk.
F3nd0 12 hours ago [-]
> 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.
The comment is saying that the language has more OOP than Lua or JavaScript, but it seems like it might have been meant to say the opposite. That, and it appears to be missing a subject (which I assume to be ‘it’ or ‘the language in question’, based on context). So personally I do find it somewhat confusing.
The problem is not the double negative itself, though; it’s more how it’s being used in context here.
lukan 12 hours ago [-]
It was also to me. I also prefer simple clear language, so much for my feedback. Can we now move on?
anonymous908213 12 hours ago [-]
Lampshading that you're doing something wrong doesn't make doing the thing less wrong. Hijacking a language post, of all things, to tell people some other completely unrelated project is better is ridiculously uncouth.
fithisux 15 minutes ago [-]
I'm excited to see this language. The author has a good track record with Codebrowser/Clade. What I would like to see is the C interoperability story.
mshockwave 3 hours ago [-]
if every `=` is always a copy of reference, are we losing some "rvalue" optimizations? (I think Stateful Objects / Stateless Objects are basically lvalue / rvalue, respectively) For example, if a struct is small enough, even smaller than a pointer, and we know its address is never taken, wouldn't it be more profitable to just copy by values to avoid another pointer dereference? Furthermore, if only a single struct field (or attribute) is used, wouldn't it be more profitable to just pass that field value instead of passing around the reference to that struct, assuming there is no ABI issue? (the classic scalar replace of aggregate)
nirei 15 hours ago [-]
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?
christophilus 15 hours ago [-]
In the standard library, there are some allocators with free, so it looks like you’re expected to call those. It is strange that none of the examples seem to cover this, though.
sinuhe69 15 hours ago [-]
I wish the author has written about the motives behind the language and why someone should choose Copper. We have in fact more programming languages than we actually can use.
marckerbiquet 2 hours ago [-]
Author here. I have written this language for many reasons but I won't detail here, I'll just say it's a lot of fun for me to design a language and write a compiler.
This language is a playground where I constantly add and remove features or try various experiments, so I have no intention to promote it. The only reason I have published it is that I publish an open source text editor written with this language.
After twenty years of evolution, it starts to become stable but not yet, I had recently added some basic option types.
vrotaru 14 hours ago [-]
It is a personal project, which the author uses for some other personal projects.
Clade - a programming editor with elastic tabstobs and Smalltalk like navigation
Maybe, there is more. Looks to me like an illustration of the "It is a quiet life" meme
7 hours ago [-]
DenisM 17 hours ago [-]
Garbage collected? Couldn’t tell from the docs.
iguessthislldo 16 hours ago [-]
I thought it would be because it looks so Python/Ruby-like, but in the source I don't see anything related to a GC at a glance and it has an allocator interface: https://tibleiz.net/browser.html?path=std&title=Standard%20L... (click on "memory" then "memory-allocator.co")
skybrian 17 hours ago [-]
It seems pretty tasteful, but I don't see anything about character sets. How does it support Unicode? What does a string of 16-bit characters represent?
There do seem to be some Unicode constants in the standard library:
This might be my new favorite language. Deeply sane.
pmkary 15 hours ago [-]
Exactly
jdw64 18 hours ago [-]
It’s similar to Python syntax.
abound 18 hours ago [-]
From the website itself:
> Ruby-style syntax
Also, Python has significant whitespace, which this language does not appear to have.
zelphirkalt 13 hours ago [-]
Glad they chose the more sane way of Ruby, regarding whitespace.
jdw64 17 hours ago [-]
The end syntax is definitely Ruby-style, but I guess I felt that way just from looking at syntax like var, func, and for x in. It does seem like a mix of the two, but maybe it’s because I’m so used to Python that I noticed the Python-like syntax first. Thanks for pointing that out.
Panzerschrek 5 hours ago [-]
Is it memory safe? Or is it yet another "better C"?
blenser4 2 hours ago [-]
[dead]
railmaniac 5 hours ago [-]
[dead]
ihateaislop 3 hours ago [-]
AI slop
Fervicus 14 hours ago [-]
This seems to have a lot of potential, but there are important details missing. Hopefully the feedback from this thread will result in those questions getting answered by the author soon.
small_model 15 hours ago [-]
I think the days of releasing new programming languages is gone, it's like releasing a new punch card format. Humans don't code anymore and so programming language is really a choice LLM's make for you.
jenniferhooley 15 hours ago [-]
What leads you to think that? All the engineers I know always choose the language depending on the project details, scope, their own or team preferences, etc.
small_model 14 hours ago [-]
They ask Claude or some other model, this is the correct thing to do though, given it has the whole internet of software engineering history trained into its model and can read thousands of articles docs in seconds.
ninalanyon 15 hours ago [-]
> Humans don't code anymore
I find that difficult to believe. Is there some objective evidence?
DenisM 13 hours ago [-]
I can supply anecdotal evidence - of all the people I stay in touch with only one person occasionally opens IDE to write code. This transcends from interactive client apps through novel database engines.
AI is undergoing cosmic inflation, we get further apart faster.
mllev15 14 hours ago [-]
I guess I’m not human
small_model 14 hours ago [-]
The ones that do are at a massive disadvantage, like someone writing out machine code by hand vs using a compiler back in the day.
mllev15 14 hours ago [-]
Someone who can write assembly will always be at an advantage over someone who can’t. Yes even in the agentic era.
alpaca128 12 hours ago [-]
This feels like a photographer telling a painter that they're at a massive disadvantage and that no human paints by hand anymore. Meanwhile painters still exist and are probably not particularly upset by how many pictures per second a DSLR can do.
> like someone writing out machine code by hand vs using a compiler back in the day
Programming using a compiler is still the same kind of thing, just in a different language.
jibalt 11 hours ago [-]
I was a programmer back in the day. That statement is simply misinformed.
catlifeonmars 5 hours ago [-]
This is a silly take. I think you underestimate how talented some programmers can be. I think you also overestimate how far being good at coding will get you. Pre-LLM, the job was maybe 30% coding. So at worst someone who codes by hand is only disadvantaged by a manageable amount.
RetroTechie 13 hours ago [-]
Quite the contrary: the barrier to rolling your own <anything> was never lower.
As others have proclaimed: what matters is taste. And (perhaps?) a deep understanding of the subject matter. Which may or may not be encoded in formal specifications. But may also include 'fuzzy' domain-specific knowledge that can't be scraped from the web.
> Humans don't code anymore
I do, and I'm far from alone. Whether 'product' gains traction, that's another matter. But you know what? It doesn't matter. If it works for [author], that's enough.
Rochus 13 hours ago [-]
Why? Did mathematics end when pocket calculators became popular? As today, the world initially overreacted (as usual): calculator opponents did warn about dependence, loss of arithmetic skills, and erosion of mathematical understanding. Making an existing exercise easier does not establish that the underlying discipline is in jeopardy.
jibalt 11 hours ago [-]
"The days of the very thing happening here are gone."
For example, variable declarations use the pattern <colon> <type>, as in
But literals follow the opposite syntax, as in The return type of a function is introduced by : in func definitions, but by -> in imported func declarations: Other construct that I find far from my habits: instead of the more obvious (for me): Arguments are passed by ref, not by val. Good luck with recursion!Import functions is done the same way:
May be the doc is outdated.The multiple declaration is consistent with assignment:
The syntax is unusual compared to many other languages because it just use a simple syntax: The type is prefixed only to resolve literals: It can be useful in generic functions: But to create uninitialized variables I had to keep the syntax:Agreed on the rest, though I don't understand what the problem would be with recursion. Is it using reference passing also for primitives like integers?
That's what I assumed, but honestly I might have misunderstood the docs. This passage is not very clear:
> Copper manipulates only references to objects. Simple data types such as integers must be seen as references to stateless objects (i.e. objects that have no state in memory).
https://tibleiz.net/copper/documentation.html#basic-syntax
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...
https://blog.janestreet.com/code-review-that-isnt-boring/
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”.
Yep. Interface-based (true) delegation between objects would be my go-to if it existed.
The example definitely shines. Doing something barely non-trivial is great since it gives a feeling for the language. I wish other language introduction pages would take note.
It does feel like you need some shared understanding with the author about what the interesting parts of a programming language are and what can be left implicit.
Perhaps the author and I have similar intuitions? I guess I also like that isn't pure LLM output style. It was refreshing to see some human work.
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?
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
> 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/
As long as:
* Your language is the kind of language that suits compiler development.
and
* You support compiling to C or something so that bootstrapping doesn't involve an opaque binary or compiling 30 different git commits in a row.
What are the downsides exactly?
Since the majority of programs are not compilers, it might make more sense to focus on interesting things that aren’t relevant to compilers.
Some ideas from the top of my head: async I/O, a great SIMD story, effect systems, robustness systems for long-running processes (I’m only aware of Erlang/Elixir), and many others.
Compilers do exercise some things, like error handling and memory management, but they’re not particularly difficult or interesting in general.
Bootstrapping is a one-time cost, but implementing the toolchain in C is a cost everyone has to pay every single time they touch the toolchain source.
I think most people today would say encapsulation and message passing are pretty core to the definition of OO and inheritance is largely seen as an anti-pattern.
One thing I really like about Elegant Objects is that it is very palatable to FP enjoyers. Objects must encapsulate state, but they must also be immutable. Good OOP is declarative like good FP. It looks a lot like lisp imo. You're encouraged to code against interfaces instead of using inheritance etc.
[1]: https://www.elegantobjects.org/
There's a difference between nitpicking the topic of the article and nitpicking someone's grammar.
IMO, that text is confusing.
“Not nothing” is saying it has some OO features.
“I don't think it's incorrect to say has any more OOP than general purpose languages like Lua or JavaScript in that sense” = I think this language has more OOP than languages like Lua or JavaScript”
So, that more or less says “A, but A”. If so, what’s the “but” about?
I had retyped it a few times trying not to come off as overly negative or a jerk.
The comment is saying that the language has more OOP than Lua or JavaScript, but it seems like it might have been meant to say the opposite. That, and it appears to be missing a subject (which I assume to be ‘it’ or ‘the language in question’, based on context). So personally I do find it somewhat confusing.
The problem is not the double negative itself, though; it’s more how it’s being used in context here.
This language is a playground where I constantly add and remove features or try various experiments, so I have no intention to promote it. The only reason I have published it is that I publish an open source text editor written with this language.
After twenty years of evolution, it starts to become stable but not yet, I had recently added some basic option types.
Clade - a programming editor with elastic tabstobs and Smalltalk like navigation
Maybe, there is more. Looks to me like an illustration of the "It is a quiet life" meme
There do seem to be some Unicode constants in the standard library:
https://tibleiz.net/browser.html?path=std&title=Standard%20L...
https://crystal-lang.org
Neat little language...
Definitely more explicit by default though.
But yes, very neat. I'd miss Enumerable though, if they manage to get that to play with manual allocation that would be even neater.
Here's my current stab at a small compiled language: <https://codeberg.org/stevefolta/lx-2025>.
Multiple return values are kind of weird, but maybe it is just me. Overall this is something I will give a try.
That's used... to make what?
> Ruby-style syntax
Also, Python has significant whitespace, which this language does not appear to have.
I find that difficult to believe. Is there some objective evidence?
AI is undergoing cosmic inflation, we get further apart faster.
> like someone writing out machine code by hand vs using a compiler back in the day
Programming using a compiler is still the same kind of thing, just in a different language.
As others have proclaimed: what matters is taste. And (perhaps?) a deep understanding of the subject matter. Which may or may not be encoded in formal specifications. But may also include 'fuzzy' domain-specific knowledge that can't be scraped from the web.
> Humans don't code anymore
I do, and I'm far from alone. Whether 'product' gains traction, that's another matter. But you know what? It doesn't matter. If it works for [author], that's enough.
Uh, no.