This is another Friday social topic. You are aimlessly wandering around a beautiful hilltop by a sea when an angel approaches you from the opposite direction. She is no ordinary angel. She is a Lisp angel! She will grant one Lisp wish to you. Before she can fulfill your wish, she needs this information from you:

  1. Your favorite Lisp dialect.
  2. Your favorite non-Lisp programming language.
  3. Your favorite standard library function/macro/feature from your favorite Lisp dialect that you want to see in your favorite non-Lisp programming language.

Once you tell these 3 things to the angel, she will magically add your chosen feature to your chosen non-Lisp programming language.

What are your answers going to be?

  • Litanys@lem.cochrun.xyz
    link
    fedilink
    English
    arrow-up
    5
    ·
    11 months ago

    Favorite lisp is common lisp. Favorite other is rust. S expression syntax. If rust had the simple syntax and s expressions of lisp… I’d be so happy.

  • charje
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    11 months ago
    1. Common Lisp
    2. Haskell I guess
    3. defmacro. This would probably involve changing the syntax to list form like axel does.
  • Ramin Honary
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    11 months ago
    1. “favorite Lisp dialect”: Scheme (Guile, Gambit, and MIT/GNU)
    2. “favorite non-Lisp programming language”: Haskell
    3. “favorite standard library function/macro/feature”: homoiconicity, i.e. both code syntax and data structures built from S-expression, which makes features like syntax-case feature possible, and the ability to implement declarative domain specific languages with Haskell-like type checking on large parts of your program at compile time. If every language would like this, my life would be soooo much easier and less stressful.

    One thing I hate about other languages is complicated syntax that makes it difficult or impossible to do macro-programming. S-expressions are a minimalist syntax that allows lisp to be well-adapted to most any use case, and features like defmacro or syntax-case are very well designed mechanisms for doing exactly that. Other languages like Python and JavaScript have macro-programming implementations but they are so hacky and not very well designed compared to most Lisps, which have the feature built right into the language.

  • ☆ Yσɠƚԋσʂ ☆M
    link
    fedilink
    English
    arrow-up
    2
    arrow-down
    1
    ·
    11 months ago
    1. Clojure
    2. F#
    3. destructuring syntax, e.g. (let [{[{:keys [foo bar]}] :baz} {:baz [{:foo 1 :bar 2}]}] ...)
  • tetris11
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    11 months ago

    A please macro, that converts rational statements from other languages into lisp:

     (please 1 + 1)
     > 2
    

    or

     (please "hello" + " there")
     > "hello there"
    

    and best of all

    (please "1" + "1")
    > "2"
    
  • tentaclius@lemm.ee
    link
    fedilink
    English
    arrow-up
    1
    ·
    11 months ago
    1. Scheme
    2. Zig
    3. (let loop ((…)) (cond …))

    I love how recursive looping reads and unfortunately there aren’t many languages implementing this approach.