Emacs internals: Deconstructing Lisp_Object in C (Part 2)

(thecloudlet.github.io)

75 points | by thecloudlet 3 days ago

3 comments

  • __patchbit__ 50 minutes ago
    Is AI able to measure the ratio of craft to cruft source lines of code in Emacs over its lifetime?
    • sillysaurusx 39 minutes ago
      Not AI, but I studied it extensively for about 6 months. I was trying to port Emacs to JS, line by line, about eight years ago.

      I love Emacs' design. I think the cruft is minimal, and pretty much every line of code I studied had a good reason for being there.

      And I also think there's a lot to learn from studying how Emacs is implemented. Few people will probably do this, but it was a nice experience for me. I learned a lot about gaps, text properties, how buffers are implemented, how the eval function works (it's surprisingly complicated between buffer-local variables and thread-local variables, but it's hard to think of a simpler alternative), and how intervals are implemented.

  • praptak 4 hours ago
    SBCL uses a single zero bit to tag integers. This trick means the representation of n is just 2n, so you can add the values directly without any decoding.

    It obviously also means that all the other tag values have to use 1 as the last bit.

    • thecloudlet 1 hour ago
      That’s so cool. I did not know that.
  • alex_dev42 4 hours ago
    [flagged]