1. 7

  2. 3

    When I see a new language like this, that’s high-level-ish but doesn’t have safety guarantees, I think to myself, “When would I use this and not Zig?”

    Explanation: In my opinion, Zig’s design does an excellent job at ensuring its features are orthogonal, and it stays really simple—heck, even generics are written similar to how functions are! Another niche language meeting those criteria would have to do a lot to compete with Zig’s excellently designed C interop and bit-twiddling creature comforts.

    The only thing I can think of is method calling syntax, which is necessary for the object-oriented style of dispatching on the first argument’s type. But who knows, maybe there are other aspects of polymorphism that Zig is missing. Or… maybe even Zig is too low-level for some people. Maybe what people really want is Java without the JVM; or to look at it another way, the monolith that is C++, but without the leftover cruft from C.

    1. 3

      Alumina author here - the C++ comparison is spot on. C++ used to be my favourite language by far and I used to wish for a language that would be as elegant and powerful but without all the arcane syntax from C and the header files approach.

      Then Rust came along which scratched that itch almost perfectly and had additional things that I didn’t even know I wanted (e.g. memory safety and enums), but gung-ho bit fiddling can be fun. Rust is far more restrictive in what you can do in unsafe blocks and many things are UB that would be perfectly legal in C.

      1. 1

        Ah, got it. Zero-cost abstractions as a singular focus. Very cool!

        1. 3

          Yeah, this was definitely a big focus.

          A random bit of trivia: I was actually surprised at how much of zero-costness I was able to get for free by targeting C as the backend. For example this function uses iterators and closures and results in ~900 lines of generated C code with a ton of small helper functions.

          fn sum_of_mod_n(upper: u64, modulo: u64) -> u64 {
                  .filter(|=modulo, n: u64| -> bool { n % modulo == 0 })
                  .map(|n: u64| -> u64 { n * n })

          But the C compiler is still able to optimize this into a very straightforward loop with no overhead.


    2. 3

      “Rust + manual memory management - memory safety” sounds a bit like Hare, although I think I see from the standard library docs that it includes some other Rust features like generics and traits (as “protocols”). Are there any other notable distinguishing characteristics between Alumina and Hare?

      1. 3

        I think generics is a pretty big difference.

        1. 2

          Definitely, I didn’t mean to minimize! Just wanted to see if there were any other big differences, practically or ideologically. But even just generics and bounded types/protocols are a welcome entry to the “Rust without the borrow checker” arena

      2. 1

        Is it Aluminia outside of the US?