4 ms·
I hadn't heard of rope data structures until I read about the xi editor (also written in Rust) a few years ago, but it looks like that's been discontinued. htt
by rdimartino 2y ago
I hadn't heard of rope data structures until I read about the xi editor (also written in Rust) a few years ago, but it looks like that's been discontinued.
https://github.com/xi-editor/xi-editor https://github.com/xi-editor/xi-editor
- kibwen 2y agoThe authors of Xi are currently working on Xilem, an experimental reactive UI framework for Rust: https://github.com/linebender/xilem https://github.com/linebender/xilem In the announcement post, they mention that work on Xi is considered "on hold" rather than strictly discontinued: https://raphlinus.github.io/rust/gui/2022/05/07/ui-architecture.html https://raphlinus.github.io/rust/gui/2022/05/07/ui-architect...
- infogulch 2y agoLegendary-tier yak shaving. "I want to build an editor, but first I must solve rendering 2D graphics purely on the GPU, invent a parallelizable path solver, and code a human perception-based color value manipulation library."
- PoignardAzur 2y agoYou have no idea. I think we're at five or six levels of yaks by now. (xi -> xilem -> masonry -> vello -> peniko -> color)
- bbkane 2y agoIt's a lot of fun to follow, especially as its so different than my developmental expertise. You can see the current projects (13 active) on https://linebender.org https://linebender.org , and several members post interesting checkins in https://xi.zulipchat.com/ https://xi.zulipchat.com/
- kstrauser 2y agoThis is the path to Enlightenment (17).
- mananaysiempre 2y ago> first I must solve rendering 2D graphics purely on the GPU To be fair, the original author of Xi ('raphlinus) has been working on GPU-side 2D rendering much longer than on Xi.
- amanda99 2y agoRepo says "discontinued".
- daveguy 2y agoYes, the xi repo is discontinued. They recommend the lapce editor as the spiritual successor: https://github.com/lapce/lapce https://github.com/lapce/lapce
- satvikpendem 2y agoI'd also recommend Helix [0] (which also uses the rope data structure [1]), that's a more widely used editor also written in Rust. [0] https://github.com/helix-editor/helix https://github.com/helix-editor/helix [1] https://github.com/helix-editor/helix/blob/master/docs/architecture.md https://github.com/helix-editor/helix/blob/master/docs/archi...
- VeejayRampay 2y agohelix is a really really good text editor / terminal IDE I'm seriously impressed by the level of quality out of the box
- jll29 2y agoThis looks pretty cool - except... modes like in vi are a no-go area; has anyone tried to modify the GUI (key bindings) to make it similar to Emacs or Notepad? The extra keypress for switching between "i" (inserting text) "ESC" (moving cursor) "i"... would drive me insane (just not used to it, but used to very fast, friction-free typing/editing).
- satvikpendem 2y agoThere might be mods but it is fundamentally built around those vi like keybindings so you'll be fighting an uphill battle.
- sandbach 2y ago
- itishappy 2y agoZed uses something similar to ropes as well: https://zed.dev/blog/zed-decoded-rope-sumtree https://zed.dev/blog/zed-decoded-rope-sumtree
- PittleyDunkin 2y agoZed seems to be a gui-oriented editor here: https://zed.dev/ https://zed.dev/
- supriyo-biswas 2y agoYou still need a backing data structure that holds the contents of your editor, and that's where you'd use a rope.
- infogulch 2y agoZed's Sum Tree is my favorite datastructure ever and is the future of database indexes.
- senderista 2y agoI think this is what Guy Steele called a "monoid-cached tree": https://www.youtube.com/watch?v=ftcIcn8AmSY https://www.youtube.com/watch?v=ftcIcn8AmSY
- infogulch 2y agoCool talk, thanks for sharing!
- secondcoming 2y agoIs it even possible to write any text editor without some form of rope data structure?
- caconym_ 2y agoGap buffers are the other classic option, and there are others too, e.g. piece tables.
- cschmidt 2y agoHere's a paper reviewing the various choices, that is often mentioned in discussions around data structures for text editors: https://www.cs.unm.edu/~crowley/papers/sds.pdf https://www.cs.unm.edu/~crowley/papers/sds.pdf
- marssaxman 2y agoMost certainly: gap buffers, piece tables, and line arrays are also popular choices.
- ben-schaaf 2y agoVSCode uses a piece table (https://code.visualstudio.com/blogs/2018/03/23/text-buffer-reimplementation https://code.visualstudio.com/blogs/2018/03/23/text-buffer-r...).
- canucker2016 2y agoMS Word used piece table, which led to the "fast save" feature - which saved only the newer pieces.