emacs

Chip 2025-02-25T05:47:14.914979Z

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?

tatut 2025-02-25T06:20:53.317289Z

I doubt it, ime emacs is pretty slow with syntax highlighting of huge files

tatut 2025-02-25T06:22:17.815139Z

but a 144k sounds like a database you wouldn’t want to edit by hand

1
hkjels 2025-02-25T07:12:00.421629Z

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

1
☝️ 1
tatut 2025-02-25T07:40:23.387869Z

yes, might be better with tree-sitter modes

1
tatut 2025-02-25T07:40:45.420089Z

but I’ve had problems with structural modes with big files, changing to fundamental mode is fast

Chip 2025-03-01T21:53:06.735159Z

Thank you everyone.

vemv 2025-02-25T08:33:18.768119Z

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

1
pez 2025-02-25T08:35:36.480849Z

I think the Calva inspector would choke pretty bad on that file. But I’m curious for test results. 😃

👀 1
vemv 2025-02-25T08:36:34.127709Z

Ah interesting, my bad for assuming it's not lazy You may want to sleep on it 😸

practicalli-johnny 2025-02-25T10:04:13.841169Z

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.

👍 1
1
ag 2025-02-25T15:20:11.348349Z

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.

1
daniel.vieira 2025-02-25T21:34:23.614409Z

Yeah I'd go with neovim and treesitter for this

1