• 2 Posts
  • 9 Comments
Joined 1 year ago
cake
Cake day: June 16th, 2023

help-circle
  • mrh@mander.xyztoProgramming@programming.dev...
    link
    fedilink
    English
    arrow-up
    2
    ·
    7 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.



  • mrh@mander.xyztoProgramming@programming.dev...
    link
    fedilink
    English
    arrow-up
    7
    ·
    7 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.






  • I have never used nix or nixos. I liked their shared idea (functional, atomic, reproducible systems), and so when I looked at their differences they seemed to all be pros for guix:

    1. Clearer, more robust, more centralized documentation
    2. GNU Project
    3. Guile Scheme (Lisp) as opposed to Nix DSL
    4. Unparalleled emacs integration

    The only bittersweet aspect of guix compared to nix was the foss only stuff, as I do need some proprietary drivers, but nonguix is so easy it hasn’t been a practical issue. And of course I am big advocate of free software so I like that guix is pushing that forward.

    There’s also a theoretical issue that guix has less packages, but the standard channel + nonguix has had everyhing I use.



  • I quite enjoy it!

    Being able to rollback any change I make to the system, either package changes or system configuration, makes it completely unbreakable and provides great peace of mind. It means I can fully enjoy its rolling-release nature without worrying.

    Having my entire system configuration declared in a single, robust programming language (Guile) across a small number of files makes it very easy to understand and just stick into source control to reproduce.

    Being able to hack on it in a lisp (scheme) is the cherry on top, along with the great emacs integration. I would highly recommend it to any lisp/emacs/gnu enthusiasts.