My system has a 144k-and-growing EDN file at its core. I'm cutting my Clojure/Datomic teeth in VS Code with Calva. It is now struggling with the size of this file. I certainly have some options for breaking the file into pieces. I'm trying to see if I can reasonably keep it monolithic. My question: for EDN syntax highlighting, structural checks and navigation, completions, and file size capacity is Emacs a reasonable option?
I doubt it, ime emacs is pretty slow with syntax highlighting of huge files
but a 144k sounds like a database you wouldn’t want to edit by hand
Emacs is plenty fast with files of any size. Historically, its been problematic with very long lines, but that to should be fine. Give it a try with tree-sitter
yes, might be better with tree-sitter modes
but I’ve had problems with structural modes with big files, changing to fundamental mode is fast
Thank you everyone.
An alternative could be to use the Cider Inspector as an 'interface' to browse this file It's lazy by design https://calva.io/inspector/ seems similar
I think the Calva inspector would choke pretty bad on that file. But I’m curious for test results. 😃
Ah interesting, my bad for assuming it's not lazy You may want to sleep on it 😸
Using Emacs with https://github.com/clojure-emacs/clojure-ts-mode (instead of clojure-mode) should be much more efficient at syntax highlighting very large Clojure & EDN files. Treesitter is a very efficient incremental language parser and should be much https://github.com/clojure-emacs/clojure-ts-mode?tab=readme-ov-file#rationale . Clojure Treesitter mode is relatively new, so there maybe some limitations or issues, but worth a try. Neovim also has treesitter which suppoers Clojure. Support has been around for longer and could be even faster than Emacs & Treesitter at parsing very large files.
Emacs has an Indirect buffers feature, allowing you to hide/show different pieces of a large file. e.g., you can collapse/hide all the nested keys in a big map and selectively inspect them in an indirect buffer one by one - as if you're working with completely different files. Yet any edits to a selected piece in the indirect buffer still will go into the same file.
Yeah I'd go with neovim and treesitter for this