• cryptonector 33 minutes ago

    ASN.1 is structurally typed too.

    • vrotaru 2 hours ago

      I guess Modula-3 was doing it as well.

      Records were structurally typed. But you can "braid"(?) a record and that will make it nominal type.

      • PaulHoule 4 hours ago

        I think is forgotten here that one of the benefits of nominal typing is that the compiler can know that data layout at run time so performance benefits.

        There has been so much ink spilled on the question of what kind of type systems help programmers be productive but there is not such controversy on the performance side.

        • agentultra 3 hours ago

          Do you mean at compile time?

          I’m mostly familiar with Haskell which does type erasure. I think the means that there is no type checking at run time.

          I think dependently typed languages would the benefit of knowing structure at compile time enough to detect things like dead branches and impossible cases which can optimize by removing code. I’m not sure that all types are erased in such languages though.

        • molikto 3 hours ago

          convertTree doesn't work because Tree uses Tree type recursively.

          • readthenotes1 3 hours ago

            An odd to see Java thrown in there without methods...