Read a paper: Ropes-- an alternative to Strings

Ғылым және технология

Boehm, H. J.; Atkinson, R.; Plass, M. F. Ropes: an alternative to strings. Software Practice and Experience. 1995 December; 25 (12): 1315-1330.
Link to paper: www.cs.rit.edu/usr/local/pub/...
vivekhaldar.com
/ vivekhaldar

Пікірлер: 7

  • @monad_tcp
    @monad_tcp6 ай бұрын

    (from the title only) At first I though this was about Physics, but then I remembered I'm actually graduated in Compsci

  • @anon_y_mousse
    @anon_y_mousse5 ай бұрын

    I read that paper and it seems to suggest that the method I use for allocation is actually faster than using a rope. I use a geometric allocation scheme and I retain the length of the string. As far as the example of reading in a file by lines, it's a shame I didn't read this paper sooner because it's not too dissimilar from the method I came up with independently where I create a sparse array where it's just a series of partially filled buffers in a balanced tree referenced by their indices. Unless I'm misunderstanding what they're saying where it sounds like they're saying each node in a rope would be sized specifically for whatever data it stores, while I used the same size for each node and allowed for unfilled space before and after each string piece. I used a tag to denote a partial line which actually allowed me to size the buffers in relation to the screen width in characters so that I could very easily wrap lines. It was a lazy method because words would be clipped in half in a lot of cases, but it was really fast when it came to edits. It wouldn't be too difficult to wrap by words, it would just require a slight adjustment to the buffer filling code, but maybe I should continue developing it.

  • @VivekHaldar

    @VivekHaldar

    5 ай бұрын

    That sounds neat. You should do a proper comparison with ropes and write it up! The Xi editor used ropes and was written in rust if you're looking for a reference implementation. xi-editor.io/docs/rope_science_00.html

  • @julianyumanji1159
    @julianyumanji1159 Жыл бұрын

    Thank u and please continue this series

  • @delian66
    @delian662 ай бұрын

    Thank you. I like your channel a lot.

  • @loogabarooga2812
    @loogabarooga28125 ай бұрын

    Why mention that an issue with char array strings is immutability and then not go into how ropes approach that at all lmao I remember as a college project trying to figure out how to make a text editor and I did end up using a rope. I still don't know how immutability comes into it, and I'm pretty sure I read this specific paper

  • @delian66

    @delian66

    2 ай бұрын

    @OmerTairi-cf1jxunfortunately I think that people that use `lmao` unironically can not help you or anyone else.

Келесі