• squaresinger@lemmy.world
    link
    fedilink
    arrow-up
    18
    arrow-down
    1
    ·
    9 hours ago

    Why do programs written in Haskell not have side effects?

    To have side effects someone would have to run the programs.

  • Redkey@programming.dev
    link
    fedilink
    arrow-up
    7
    arrow-down
    1
    ·
    8 hours ago

    I started programming in a time when the idea that the computer could keep track of your variable types for you automatically was a fever dream, so it’s wild for me to see some programmers now throwing shade at particular langages for “not implementing proper variable typing functionality”.

    It feels like someone saying that low-fat milk producers are too cheap or lazy to put enough fat in their milk.

    Fashion really does go in cycles.

    • CanadaPlus@futurology.today
      link
      fedilink
      English
      arrow-up
      3
      ·
      edit-2
      4 hours ago

      I don’t even think it’s fashion. Some ideas sound good but are bad. Or, overlappingly, are convenient to use but actually turn into nightmarish spaghetti code. I don’t know how many people are still pushing MongoDB and BASE, for example.

      Meanwhile SQL hasn’t changed, and C didn’t until someone figured out memory safety in Rust.

      • Redkey@programming.dev
        link
        fedilink
        arrow-up
        3
        arrow-down
        1
        ·
        6 hours ago

        Sorry for not being clear; when I said “keep track automatically” I meant dynamic typing. Of course you’re right that “keeping track of your variables” could also be interpreted to refer to static typing.

  • onlinepersona@programming.dev
    link
    fedilink
    English
    arrow-up
    12
    arrow-down
    4
    ·
    11 hours ago

    The same reaction whenever I look at haskell. A “pure” language with an escape hatch that has a fancy name. Once you open the escape hatch, you can write entirely impure code in Haskell and never see a pure function in your life. So much for “pure”.

    • chaos@beehaw.org
      link
      fedilink
      arrow-up
      9
      ·
      7 hours ago

      You say your house is clean, yet nothing’s stopping me from dumping out this bucket of mud on your floor, curious!

      • Redkey@programming.dev
        link
        fedilink
        arrow-up
        3
        arrow-down
        2
        ·
        5 hours ago

        Reading current discussion, it seems more like “You say that it’s impossible to dirty your house, yet nothing’s stopping anyone from dumping out this bucket of mud on your floor, curious!”

  • marcos@lemmy.world
    link
    fedilink
    arrow-up
    5
    arrow-down
    1
    ·
    13 hours ago

    Are extensible records usable already?

    Not that I would pick TS because of that, but the disdain is undeserved when it has some very useful features that Haskell has been trying to copy for years.

    • ultimate_worrier@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      5
      ·
      edit-2
      5 hours ago

      The features Haskell has been “trying to copy” from TypeScript are, without exception, features TypeScript copied from type theory research that predates TypeScript by decades – row polymorphism from Didier Rémy’s 1989 work, untagged unions from the intersection type literature of the 1980s, type-level computation from Martin-Löf’s 1975 intuitionistic type theory – and what you are observing is not Haskell enviously watching TypeScript and taking notes, but rather two languages drinking from the same well of ideas, one of which is doing so with a formal semantics and a proof of soundness, and the other of which is doing so while standing in a JavaScript runtime and hoping no one looks down.​​​​​​​​​​​​​​​​

      Purescript > Typescript