The Emacs Widget Library: A Critique and Case Study

(d12frosted.io)

58 points | by whacked_new 2 days ago

6 comments

  • geokon 1 hour ago
    I only have a limited experience with GUI Widgets - by using JavaFX through `cljfx`

    - vui.el seems like the right idea - You have a widget library, and then you add state management, you add layout management etc. It's sort of a blessing widget is simple enough to be reused this way

    - ECS and inheritance. I have personally never really hit on this limitation. It's there in the abstract.. but don't GUIs generally fit the OO paradigm pretty well? Looking at the class tree for JavaFX, I don't see any really awkward widgets that are ambiguously placed.

    - State Management. This can be bolted on - like with vui.el. But to me this feels like something that should be independent of GUIs. Something like Pathom looks more appealing to me here

    - "Not a full reactive framework - Emacs doesn't need that complexity" .. why not? Maybe the library internals are complex, but it makes user code much simpler, no?

  • dinkleberg 4 hours ago
    This site is quite illegible if your system is set to prefers dark theme.
    • mandw 3 hours ago
      Yes, copied it in to my scratch buffer to read it, not readable in the browser at all with a dark background. It did then make all the elisp nice to look at.
    • aaronchall 3 hours ago
      I clicked through hoping you were wrong, saw the first page, and thought, ah, this is legible... then I got to the code blocks and was completely blinded.

      I'm not sure what to tell authors of such pages...

  • volemo 2 hours ago
    Oh, that's the guy who does `homebrew-emacs-plue` --- my preferred distribution of Emacs!
  • rurban 2 hours ago
    vui.el, nice!
  • smitty1e 4 hours ago
    Thank whoever for posting this.
  • 0x1ceb00da 1 hour ago
    > The buffer is the UI, rendered by Emacs's extremely optimised text display machinery

    Doesn't emacs lag like crazy in files with large lines. Why is this still a problem? Every modern editor handles this gracefully. I remember reading something about using regexes for syntax highlighting. This looks like a problem in the rendering layer which shouldn't be too hard to fix without touching the core engine. Are there any other problems that make it difficult to fix without disabling any useful features?

    • fergie 10 minutes ago
      Right- but if you have a long line that is, for example, a JSON object, then surely it can't be properly be validated or syntax-highlighted before the entire line is scanned?

      I do agree that Emacs can be slower than the terminal when handling long lines/files, although (depending on your case) this can be easily mitigated by running a terminal inside of Emacs.

      Generally though, for everyday use, Emacs feels a lot snappier than VSCode.

    • xenophonf 1 hour ago
      • 0x1ceb00da 1 hour ago
        So long mode is the best fix for this issue but it disables syntax highlighting and line numbers. Vscode can handle long lines just fine without disabling anything.