News for hackers. Stuff that matters.
Re:Ropey – A UTF8 text rope for manipulating and editing lar... by rdimartino on Wednesday January 15, 2025 @11:20AM (#42712866)
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

Re:Ropey – A UTF8 text rope for manipulating and editing lar... by kibwen on Wednesday January 15, 2025 @12:01PM (#42713614)
The authors of Xi are currently working on Xilem, an experimental reactive UI framework for Rust: 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-architect...

Re:Ropey – A UTF8 text rope for manipulating and editing lar... by infogulch on Wednesday January 15, 2025 @12:11PM (#42713763)
Legendary-tier yak shaving.
Re:Ropey – A UTF8 text rope for manipulating and editing lar... by PoignardAzur on Wednesday January 15, 2025 @12:49PM (#42714398)
You have no idea.

I think we're at five or six levels of yaks by now.

(xi -> xilem -> masonry -> vello -> peniko -> color)

Re:Ropey – A UTF8 text rope for manipulating and editing lar... by bbkane on Wednesday January 15, 2025 @02:50PM (#42716020)
It'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 , and several members post interesting checkins in https://xi.zulipchat.com/

Re:Ropey – A UTF8 text rope for manipulating and editing lar... by kstrauser on Wednesday January 15, 2025 @03:50PM (#42716748)
This is the path to Enlightenment (17).
Re:Ropey – A UTF8 text rope for manipulating and editing lar... by mech422 on Wednesday January 15, 2025 @10:25PM (#42720729)
They just had a release as well :-) It doesn't really seem to get much press anymore... Back in the 'early days' - wow! E! was something pretty special :-D
Re:Ropey – A UTF8 text rope for manipulating and editing lar... by kstrauser on Wednesday January 15, 2025 @10:27PM (#42720751)
E15 or so was mindblowing at the time. It was living in a sci-fi movie.
Re:Ropey – A UTF8 text rope for manipulating and editing lar... by mananaysiempre on Wednesday January 15, 2025 @04:32PM (#42717365)
> 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.

Re:Ropey – A UTF8 text rope for manipulating and editing lar... by amanda99 on Wednesday January 15, 2025 @12:11PM (#42713767)
Repo says "discontinued".
Re:Ropey – A UTF8 text rope for manipulating and editing lar... by daveguy on Wednesday January 15, 2025 @12:35PM (#42714149)
Yes, the xi repo is discontinued. They recommend the lapce editor as the spiritual successor:

https://github.com/lapce/lapce

Re:Ropey – A UTF8 text rope for manipulating and editing lar... by satvikpendem on Wednesday January 15, 2025 @01:35PM (#42715076)
I'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

[1] https://github.com/helix-editor/helix/blob/master/docs/archi...

Re:Ropey – A UTF8 text rope for manipulating and editing lar... by VeejayRampay on Wednesday January 15, 2025 @02:55PM (#42716083)
helix is a really really good text editor / terminal IDE

I'm seriously impressed by the level of quality out of the box

Re:Ropey – A UTF8 text rope for manipulating and editing lar... by jll29 on Wednesday January 15, 2025 @06:42PM (#42718853)
This 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).

Re:Ropey – A UTF8 text rope for manipulating and editing lar... by satvikpendem on Wednesday January 15, 2025 @09:46PM (#42720437)
There might be mods but it is fundamentally built around those vi like keybindings so you'll be fighting an uphill battle.
Re:Ropey – A UTF8 text rope for manipulating and editing lar... by sandbach on Thursday January 16, 2025 @06:53AM (#42724126)
I'm curious, how do you avoid friction between inserting text and editing? Surely moving your hand to the mouse, arrow keys, or Ctrl key for an Emacs keybinding takes longer than pressing "i"?

I'll grant that Esc is further away, but it can be remapped.

Re:Ropey – A UTF8 text rope for manipulating and editing lar... by satvikpendem on Thursday January 16, 2025 @03:05PM (#42730198)
I rebind ESC to caps lock, works wonders as it's right on the same keyboard row as the home keys.
Re:Ropey – A UTF8 text rope for manipulating and editing lar... by pryelluw on Wednesday January 15, 2025 @03:33PM (#42716539)
Thanks for posting. I discovered floem https://github.com/lapce/floem I’ve been looking for something like it
Re:Ropey – A UTF8 text rope for manipulating and editing lar... by itishappy on Wednesday January 15, 2025 @12:11PM (#42713765)
Zed uses something similar to ropes as well:

https://zed.dev/blog/zed-decoded-rope-sumtree

Re:Ropey – A UTF8 text rope for manipulating and editing lar... by PittleyDunkin on Wednesday January 15, 2025 @12:32PM (#42714095)
Zed seems to be a gui-oriented editor here: https://zed.dev/
Re:Ropey – A UTF8 text rope for manipulating and editing lar... by supriyo-biswas on Wednesday January 15, 2025 @12:48PM (#42714380)
You still need a backing data structure that holds the contents of your editor, and that's where you'd use a rope.
Re:Ropey – A UTF8 text rope for manipulating and editing lar... by infogulch on Wednesday January 15, 2025 @01:10PM (#42714717)
Zed's Sum Tree is my favorite datastructure ever and is the future of database indexes.
Re:Ropey – A UTF8 text rope for manipulating and editing lar... by senderista on Wednesday January 15, 2025 @05:23PM (#42717992)
I think this is what Guy Steele called a "monoid-cached tree":

https://www.youtube.com/watch?v=ftcIcn8AmSY

Re:Ropey – A UTF8 text rope for manipulating and editing lar... by infogulch on Friday January 17, 2025 @12:05AM (#42734281)
Cool talk, thanks for sharing!
Re:Ropey – A UTF8 text rope for manipulating and editing lar... by secondcoming on Wednesday January 15, 2025 @01:56PM (#42715352)
Is it even possible to write any text editor without some form of rope data structure?
Re:Ropey – A UTF8 text rope for manipulating and editing lar... by caconym_ on Wednesday January 15, 2025 @02:17PM (#42715642)
Gap buffers are the other classic option, and there are others too, e.g. piece tables.
Re:Ropey – A UTF8 text rope for manipulating and editing lar... by cschmidt on Wednesday January 15, 2025 @02:29PM (#42715775)
Here'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

Re:Ropey – A UTF8 text rope for manipulating and editing lar... by marssaxman on Wednesday January 15, 2025 @02:30PM (#42715797)
Most certainly: gap buffers, piece tables, and line arrays are also popular choices.
Re:Ropey – A UTF8 text rope for manipulating and editing lar... by ben-schaaf on Wednesday January 15, 2025 @09:08PM (#42720129)
Re:Ropey – A UTF8 text rope for manipulating and editing lar... by canucker2016 on Thursday January 16, 2025 @02:56AM (#42722593)
MS Word used piece table, which led to the "fast save" feature - which saved only the newer pieces.