Seriously. There’s so many floating around. It feels like there’s a cycle of

Random programmer thinks xyz language sucks -> she/he makes a slightly different, slightly faster, slightly more secure version -> by luck this gains mass adoption-> random programmer thinks new xyz language sucks

I propose when the revolution comes and the last guillotine falls we decide a general-purpose programming language that coders should stick to. I vote Lisp or any of the dialects (scheme, clojure, racket), but i also feel something about the Julia language for scientific research. Maybe we can decriminalize using C. Absolutely ban and hunt down the use of any of the hipster languages teenagers are into these days.

Nim? Zig? Crystal?? I am absolutely losing my damn mind. It compiles to bytecode people. Make up ur damn minds. To jail with all of u

    • space_comrade [he/him]@hexbear.net
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      6 months ago

      Be quiet parentheses diddler, (((((()((((((())((do-thing (())(())))))0((( who the fuck wants to look at that all day.

      But seriously tho how do you get used to the syntax? I’ve read some moderately complex Lisp code and it was very hard to read for me, do you just kinda get used to it over time or is there extra tooling involved?

      • aldalire@lemmy.dbzer0.comOP
        link
        fedilink
        English
        arrow-up
        0
        ·
        edit-2
        6 months ago

        OK fair point actually. You just gotta write some lisp code yourself (I’m a fairly new lisper although I had emacs for a while now and have dabbled in some elisp to edit my config) to appreciate how the parentheses are actually helpful when you write things. To read things, well-written lisp code will be properly indented, or else a reasonably powerful editor (emacs with sly, etc) is able to indent the code for you

        Take a look at my (shameless plug) eratosthenes sieve function i wrote just yesterday

        (defun range (start end)
          (if (< start end)
              (cons start (range (1+ start) end))))
        
        ;; Checks if d is a factor of n
        (defun factorofp (d n)
          (zerop (rem n d)))
        
        ;; Sieve in lisp??
        (defun sieve (n)
          (let ((primes (range 2 n))
                (curprime 2))
            (maplist (lambda (tail)
                       (delete-if (lambda (n)
                                    (factorofp curprime n))
                                  (cdr tail))
                       (setf curprime (cadr tail)))
                     primes)
            primes))
        

        u don’t have to understand it. But the general principle is, things that are indented at the same level are arguments to the same function. In other words, notice that the delete-if and the setf are indented together. So they must be part of the same “argument:” namely, the body of the anonymous function lambda. So really, you don’t have to count the parentheses or anything. The indentation makes things clear and unambiguous.

        Other things that aid in reading are, obviously, patterns that you pick up along the way. Do not fear the parentheses. Embrace them

        • space_comrade [he/him]@hexbear.net
          link
          fedilink
          English
          arrow-up
          1
          ·
          6 months ago

          I can read it if I really focus but even with the nice indentation the syntax doesn’t make it easy, it’s probably way easier with proper syntax highlighting tho, whatever the Lemmy renderer did here seems wrong.

          I still don’t really see why I would suffer the syntax over using a more readable language, I’ve heard this syntax makes the macro system way more elegant/powerful but I can’t see it being THAT much better than whatever other languages are doing.