• mrh@mander.xyz
    link
    fedilink
    English
    arrow-up
    0
    ·
    5 months ago

    Lisp

    It solves so many problems new languages have been invented to try and solve, while being simultaneously simpler than most

    • drislands@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      5 months ago

      I dabbled with CLisp a while back, and I loved it – but I’m not sure what problems it solves. Do you mind expanding on that?

      • mrh@mander.xyz
        link
        fedilink
        English
        arrow-up
        0
        ·
        5 months ago

        Common Lisp “solves” most language-level problems by providing metaprogramming capabilities via lisp-style macros. (Almost) any language feature you would want can be implemented with lisp macros, and many such features already have been. So you don’t have to worry whether or not lisp has “for i in…” loops, or pattern matching, or generics, or virtually anything else, because if it doesn’t, you can write it! Plus if it’s really a good feature somebody has probably already made a library for it (if it’s not already part of the standard).

        One of the most extensive examples of this is Coalton, which is an ML-style statically typed EDSL for Common Lisp.

        There are metaprogramming features in a few other languages: template haskell, C pre-processors, even macros in Rust or Julia. But these all fall very short of lisp-style macros because those languages are not (truly) homoiconic, which makes the macros awkward to write and integrate into the language. This kind of metaprogramming is rarely employed, and when it is only for heavy duty tasks, and even then is generally discouraged as a last resort/special circumstance. But lisp macros are very easy to write because it’s the same as writing any other piece of lisp code. This results in macros being used often for smaller lightweight abstractions in the same way you write a small function.

        The other big pro of lisp is image based development. But that’s not so much solving a problem in other languages as it is simply a feature that they don’t (and pretty much can’t) have.

        And all of this is done in a language with less syntactic and semantic primitives than almost any other language, including the other “simple” ones like Python, Ruby, Elixir, etc.

    • RecallMadness@lemmy.nz
      link
      fedilink
      arrow-up
      0
      ·
      5 months ago

      I love lisp. Well, scheme and less so clojure. I don’t know why. Is it macros? Is it the simplicity? Or is it just nostalgia from learning it during a time in my life.

      But I just can’t find a place for it in my life.

      It’s not job material, effectively nobody uses it. It doesn’t solve basic problems with ease like Python does.

      And because of this, anything I do in it is nothing more than a toy. As soon as i put it down, I have no hope of picking it up or maintaining it in 6,12,24 months later.

      A toy I spend 2 weeks in absolute joy, but as soon as life gets in the way it is dead.

      • mrh@mander.xyz
        link
        fedilink
        English
        arrow-up
        0
        ·
        5 months ago

        I understand the general job market, but what about lisp prevents you from pursuing personal ventures with it?

        • RecallMadness@lemmy.nz
          link
          fedilink
          arrow-up
          0
          ·
          edit-2
          5 months ago

          I’m old, I have other shit to do, and I don’t have the time. If I’m writing code, I’m doing it because there is a problem that needs a solution. Either solving someone else’s ‘problems’ for $$$, or an actual problem at home.

          If it’s a short term problem like “reorganising some folders” I’m not going to (re)learn another language. I’m going to smash it out in 30mins with whatever will get the job done the quickest, then get back to doing something more important.

          If it’s an ongoing problem, I’m going to solve it in the most sustainable way possible. I might fix the problem now but 100% someone’s going to drop support or change an API in 2 years time and it’ll break. Sure, doing it in Chicken would be fun. But the odds are, I won’t remember half the shit I learned 2 years later. It’ll be unmaintainable. A forever grind of learning, fixing, forgetting.

          So without a commercial driver to actively invest in Lisps, there’s no point. It’s not profitable and It doesn’t solve any problems other tools can. Without the freedom youth brings, I don’t have the time to do it “for fun”.

    • farcaller@fstab.sh
      link
      fedilink
      arrow-up
      0
      ·
      5 months ago

      I really enjoy writing clojure lately. the only thing that annoys me is the whole “hosted” thing where you either get a bunch of good clojure-native libraries or all the JS’s npm mess (other clojure hosts are very much non-existent).

      • mrh@mander.xyz
        link
        fedilink
        English
        arrow-up
        0
        ·
        5 months ago

        Yeah Clojure is like the monkey’s paw of Lisp weenies. It adds many modern day niceties that are lacking in standard Scheme or Common Lisp, but also changes enough things to make it feel very un-lispy. I go back and forth as to whether or not I even consider it Lisp (Richard Stallman doesn’t).

        But I do know that I’d rather write Clojure than any other non-lisp language.

        I’d also recommend people try ABCL, which is Common Lisp on the JVM , or Parenscript which is Common Lisp that compiles to Javascript.