Recent submissions

Comment · 2 months ago
tl;dr you just don't really do that.

99% of the time, you simply write the code or change in the sources first, then compile/run it in the runtime.

If you're modifying the runtime directly at the REPL without having sources, good luck? or you don't really care about persisting those changes. CL has pretty good introspection, so you could look at the source expression of a function defined at the REPL for example, if you really wanted to recover something (and happened to put the change in a function first), but this isn't always reliable.

Comment · 2 months ago
I don't object to any of this. "Restart this system from initial state" is quite a bit more common than people imagine in CL. I was hinting at it perhaps being even more common than image-based development, though don't quote me on that. I personally don't even really create Lisp images in dev (save for creating executables that I don't then further modify, which are technically images in SBCL).

Incremental runtime modification is great for development, but I very frequently restart (from sources) every so often, and certainly at least before deployment to verify everything is working as expected. Sometimes because it's completely necessary, sometimes for my own sanity.

For production, I think it's a very "neat" thing to be able to do and I've heard some great stories (no personal experience), but it's definitely a foot gun if not used very carefully.

Comment · 2 months ago
You may already know of these, but for others curious:

I'm also not a huge fan of quicklisp, though bundles[0] made it a little more bearable for me. You may also consider vend[1], ocicl[2] (heavily AI-assisted recently), or qlot[3].

  [0] https://www.quicklisp.org/beta/bundles.html
  [1] https://github.com/fosskers/vend
  [2] https://github.com/ocicl/ocicl
  [3] https://github.com/fukamachi/qlot
For macroexpansion, SLIME and SLY have macrostep functionality that lets you expand macros in place, which has helped me immensely on more than one occasion, though you can also manually expand with macroexpand.
Comment · 2 months ago
As a Common Lisp developer, the intro about Lisp strikes me as sort of mostly(?) true.

I would say in my experience we do actually "compile and execute" code, we can just do this incrementally and with less context switching because of the described workflow. But quite often there are in fact separate compile and run steps, it's just not at the whole program level (say, compile a function and run it or a calling function).

And despite how often it's shown off as a strength, redefining code during actual execution isn't quite that common, I think. Yes, it is done sometimes, but lots of programs don't really fit that paradigm in the first place. It can work well for e.g. some games or long running servers.

As for working in an image without source code: this seems like a terrible idea. You might do this for trivial, one off experiments, but in general you benefit from writing out and organizing your code early. I'm not even aware of a particularly easy or clean way to write out source code from an image as described. It could be done, but all the ways I can think of sound like more of a pain or mess than anything. Could just be my experience or I'm missing some neat feature of a commercial Lisp or something.

Comment · 3 months ago
Comment · 3 months ago
Oh yeah, way more fun :) I just kinda saw CL in the Clojure and was trying to make it look like that.
Comment · 3 months ago
For me, the most effective way to read Lisp is to essentially forget the parentheses (I shadow them out in matching, low contrast colors) and go almost entirely by indentation. I find this makes it more similar to reading other languages, though granted not exactly the same.

You do have to keep up with the parentheses of course, but editor settings or extensions can make this automatic if not invisible.

Comment · 3 months ago
CL also has pretty much arbitrarily extensible syntax:

- https://sr.ht/~dieggsy/whisper/

- https://dieggsy.com/json-literals.html

And could also be used to build languages, supporting more modern programming paradigms (though yes, I believe Racket does make this easier):

- https://coalton-lang.github.io/

I also might have written the Common Lisp example using reduce as well, which is in the standard library, but that's preference. Nice to have the option though:

  (defun calculate (instructions)
    (reduce
     (lambda (result op-value)
       (destructuring-bind (operation value) op-value
         (case operation
           (:add (+ result value))
           (:subtract (- result value))
           (:multiply (* result value)))))
     instructions
     :initial-value 0))

  (calculate '((:add 5) (:multiply 3) (:subtract 4))) ;; => 11
Comment · 4 months ago
I use emacs --daemon with emacsclient for this. I always have a running emacs instance, and connect with the client. Opening and quitting a client is near instant.
Comment · 9 months ago
Ha! I was going to disagree, but then I realized I force most monospace html entities to use a specific font in my browser (using a wildcard stylus stylesheet). This is quite nice to normalize things (and sidestep atrocious font choices) actually.

Anyway, turned it off; sure enough, misaligned.

Comment · 9 months ago
Not sure if humor, but this is meant to make a distinction with a non-human readable compilation target, many of which aren't, even when using high level languages.
Comment · 9 months ago
Just resubmit it, you'll probably get a new link. I get something different every time.
Comment · 9 months ago
I love Wikipedia and think it's one of the greatest resources on the Internet, but there's absolutely a lot of bias in Wikipedia. Even within the same language, I think a lot of it has to do with how many people have or are contributing to a page, whether there's a recent event affecting it, how polarizing or political the subject, etc. But it's not hard to find examples of straight up opinions or very incomplete narratives.

I've also noticed huge differences between two different language versions of the same articles. (English/Spanish specifically). Sometimes they even feel independently written.

Of course, we should all do our part to improve these things when we spot them, if we're able.

Comment · 9 months ago
This is fun. Is it not checking for previously submitted URLs though? I can seemingly re-submit the exact same URL and get a new link every time. I would expect this to fill the database unnecessarily but I have no idea how the backend works.
Comment · 9 months ago

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton