• barsoap@lemm.ee
    link
    fedilink
    arrow-up
    81
    ·
    edit-2
    1 year ago

    For the curious, this is about as easy as it gets for proper type inference. You could leave out the one or other thing (most prominently, polymorphism), but that kind of stuff would hardly qualify as even a toy example.

    I won’t claim that J. Random Hacker will have issues understanding it – it’s a neatly tied bundle of necessary complexity without any distracting parts (like efficiency), if you sit down with the thing (ideally starting the whole series from the beginning) you’ll be able to grok it (and have learned a lot). However, understanding HM isn’t the same as being able to extend it, which includes proving soundness of the system, that kind of stuff is a specialised field within a specialised field within academia with more open questions than answered ones. The reason Rust doesn’t have HKTs? Because their interaction with lifetimes is insufficiently understood. Those kinds of questions can easily start 20+ years of research only to be answered with “yep that’s inherently unsound/uncomputable/whatever”.

    Oh, EDIT, forgot: AI-enabled typing is obviously a completely braindead idea. I don’t need a second lazy, impatient, hubristic idiot looking at my code, I need something to catch mistakes. Something deterministic, rule-based, pure unerring logic. Which is exactly what type systems are and do.

    • dejected_warp_core@lemmy.world
      link
      fedilink
      arrow-up
      7
      arrow-down
      1
      ·
      1 year ago

      AI-enabled typing is obviously a completely braindead idea.

      I agree. However, and I know I’m practically reading tea leaves here, but I read that last line as a suggestion that AI would replace programming outright.