Hacker Newsnew | past | comments | ask | show | jobs | submit | TobinCavanaugh's commentslogin

Zena looks super cool! I was wondering if you could walk me through this syntax thats part of the example loops:

``` let iterator = items.[Iterable.iterator](); // <--- this part in particular is confusing me while (let (true, item) = iterator.next()) { console.log(`next: ${item}`); } ```

Dimensional types and formal verification make me super excited to see more of this language. You also probably mention this somewhere and I'm missing it, but any thoughts on adding pure functions / more general mutability enforcements?


Thanks!

So `items.[Iterable.iterator]()` is invoking a symbol-keyed method.

It's declared like:

    export interface Iterable<T> {
      static symbol iterator;

      [iterator](): Iterator<T>;
    }

    export MyArray<T> implements Iterable<T> {
      [Iterable.iterator]() { ... }
    }
This is similar to JS, where you can access properties of an object dynamically with [] notation, but Zena is static and doesn't have any reflection (yet) so the symbol has to be declared and statically resolvable, and Zena has operator overloading an a [] operator so we need a way to differentiate between symbol-keyed access from indexed access ([]), thus the o.[] syntax.

I do want to add pure functions, especially for compile time constants. I want to add a macro system that can either run pure functions (on the AST or IR, not sure yet) at compile time, or run arbitrary code sandboxed in a Wasm module.


I don't want to use a full AI IDE, I've been using Gemini CLI a lot and it works better for my workflows to bring my own IDE and use Gemini CLI alongside it. My assumption is others are having annoyances for the same reason.


Very interesting, explains why video games CAN be so much fun.


Nvidia broadcast does a pretty good job of deepfaking your eyes to look cat the camera... then again thats not as fun


Bummer, this place was a bunch of fun


Maybe Fediverse is great, but i'm not using a technology who's logo is a rainbow pentagram that has fed in the name.


We programmers clearly seem to think we have nothing better to do than create edge case programming languages that solve incredibly niche problems in esoteric ways.


This is really, really significant imo. The idea of system wide tabs has been in the back of my head for a while, as well as moving away from the linux kernel. I've messed around with it a bit and I'm very impressed.

Starting from scratch is awesome, and I'm firmly in the group that we should not strive for backwards compatibility at this stage, and instead aim to maximize intuitiveness for both developers and users.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: