News for hackers. Stuff that matters.

marckerbiquet

It is not possible since you can create new integer types by sub-classing the primitive ones:

  class UserId: Int64
    ...
  end
  var user = UserId: 42
I also plan to replace predefined Int64, Int32, ... by generic types Int(64), Int(32), ... LLVM allows any integer size and Copper allows this kind of generic types.
This one is up to date and it's definitely inconsistent, but I could not use ':' in place of '->' without creating an ambiguous grammar. Same for parenthesis in the return type since you can have a comma separated list:

  & (Type) -> (RetType1, RetType2)
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
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.

Re:Composite objects and C++26 the std:polymorphic type on Wednesday October 21, 2026 @04:42AM (#50177727)
It does not work if two independent libraries depend on your library and create the same user EventType.
Re:Writing my own text editor, and daily-driving it on Wednesday March 11, 2026 @05:07AM (#47333276)
I use my own text editor too, written using my own programming language. Fortunately Operating Systems suit my needs and I won't have to write my own OS ;-)
Compilers have a huge advantage over other programs: they are fully deterministic since they depend only on input files, command line arguments and few environment variables. It makes bugs easier to reproduce and fix compared to interactive applications, programs with networking, multi-threading...
Re:Ask HN: Going low-level – what to learn next? on Tuesday June 04, 2024 @04:43AM (#40572111)
Agner Fog's optimization manuals https://agner.org/optimize/ are x64 oriented but are a very valuable resource for C++ and assembly programming.
Re:Niklaus Wirth, or the Importance of Being Simple on Wednesday January 17, 2024 @08:33AM (#39027409)
A possible reason is the use of Static Single Assignment (SSA). While it makes many optimizations easier, it has to translate its IR out-of-SSA to generate code. This is very expensive as it needs computation of dominance on the Control Flow Graph, insert copies and much more. But it's just a guess.