Copper – A minimal low-level programming language with OOP and generics
https://tibleiz.net/copper/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!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...
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”.
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.
> 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!
There do seem to be some Unicode constants in the standard library:
https://tibleiz.net/browser.html?path=std&title=Standard%20L...
Neat little language...
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?