• patatahooligan@lemmy.world
    link
    fedilink
    English
    arrow-up
    6
    ·
    2 days ago

    I agree with you that the one liner isn’t a good example, but I do prefer the “left to right” syntax shown in the article. My brain just really likes getting the information in this order: “Iterate over Collection, and for each object do Operation(object)”.

    The cost of writing member functions for each class is a valid concern. I’m really interested in the concept of uniform function call syntax for this reason, though I haven’t played around with a language that has it to get a feeling of what its downsides might be.

    • speq@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      1
      ·
      7 hours ago

      I think Nim is the frontrunner here. Close to Python to write because it is so expressive, close to C speed because it is compiled properly.

    • FishFace@lemmy.world
      link
      fedilink
      English
      arrow-up
      3
      ·
      2 days ago

      I was also thinking about UFCS. I do like it for its flexibility, but I did try it in Nim one time and was left feeling unsure. Unfortunately I now can’t remember what exactly I didn’t like about it.