• dan@upvote.au
    link
    fedilink
    arrow-up
    4
    ·
    edit-2
    2 months ago

    Use TypeScript, and nonsensical things like adding arrays to objects will be compile-time errors.

    • Schadrach@lemmy.sdf.org
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 months ago

      By that logic what we really need is a modernization of Ada, where there are no compiler warnings and anything that would generate one in another language is instead a compiler error, everything is strongly typed, etc, etc.

      If you aren’t familiar with Ada, just imagine Pascal went to military school.

    • CanadaPlus@lemmy.sdf.org
      link
      fedilink
      arrow-up
      0
      ·
      edit-2
      2 months ago

      Yup. The libraries underneath will still allow nonsense at runtime, though, and it will now be harder to see, so it’s a partial solution as done in standard practice.

      An all-TypeScript stack, if you could pull it off, would be the way to go.

        • thevoidzero@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          2 months ago

          If there was an easy way to use rust or something on webassemly and use that instead of JS. I’d be so happy, but I can’t find how to do it without npm.