News for hackers. Stuff that matters.
Re:Build Your Own Text Editor by proverbialbunny on Sunday August 04, 2019 @01:55AM (#20604656)
In case anyone hasn't seen it this CppCon talk https://youtu.be/sPhpelUfu8Q talks about rrb-trees and how they're a great data structure for writing a text editor that can handle unlimited sized documents without locking up, and allows for editing while saving and opening, and an easy way to support an undo command.

Most text editors today do not support such functionality. With lockless data structures like an rrb-tree it becomes easy. It really is an ideal way to do write a text editor.

Re:Build Your Own Text Editor by lioeters on Sunday August 04, 2019 @03:31AM (#20604981)
For those like me who are unfamiliar with Relaxed Radix Balanced trees, here's the paper presenting the algorithm:

RRB-Trees: Efficient Immutable Vectors (2012)

https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf

EDIT: For further reading:

Improving RRB-Tree Performance through Transience (2014)

https://hypirion.com/thesis.pdf

Article: https://hypirion.com/musings/thesis

Code: https://github.com/hyPiRion/c-rrb

Re:Build Your Own Text Editor by mekanicalsyncop on Sunday August 04, 2019 @04:24PM (#20609015)
Are there any good ones that exist? I'm a security analyst and I frequently work with large text files, 200MB-1GB and the text editors I've tried are incredibly slow.

A lot of the time I can use grep and other command-line tools to find what I need, but given the nature of the job I don't always know what I'm looking for so having the raw file open in a text editor is sometimes the only way.

Re:Build Your Own Text Editor by cjohansson on Sunday August 04, 2019 @11:57PM (#20611167)
I’d recommend xi-editor, vi/vim/neovim or emacs for that
Re:Build Your Own Text Editor by jhallenworld on Monday August 05, 2019 @09:49AM (#20614160)
Try JOE, it can handle files this large no problem.
Re:Build Your Own Text Editor by proverbialbunny on Sunday August 04, 2019 @10:04PM (#20610472)
The person from the talk may have a github repo with the text editor he wrote shown in the talk.
Re:Build Your Own Text Editor by diegoperini on Monday August 05, 2019 @06:54AM (#20613000)
As an ultimate noob of this area of expertise, can I ask if Sublime Text works? If not, why?
Re:Build Your Own Text Editor by diegoperini on Monday August 05, 2019 @12:50PM (#20615662)
I'm the noob, not the parent. No sarcasm intended.
Re:Build Your Own Text Editor by BubRoss on Monday August 05, 2019 @12:05PM (#20615206)
Gvim can open files of 2GB or more and search through them without any problem.
Re:Build Your Own Text Editor by drudru11 on Monday August 05, 2019 @12:54PM (#20615696)
What about piece tables?