ecc-comp
ecc-comp.blogspot.com · Personal blog · on HN since 2014
ecc-comp is a programmer's blog on text editor data structures, reverse engineering Kirby's Dreamland 2, backups, and low-level programming.
What HN saysCommenters link its text editor data structure comparison and Kirby's Dreamland 2 reverse engineering post, and one asks about Backblaze deletion policy.
17HN people shared it
5linked it in comments
50stories submitted
1.3Kstory points
3 years agolast shared
2014people per year2026
Most-shared posts
- 1A Brief Glance at How Various Text Editors Manage Their Textual Data (2015)6 people · 614 points · first shared 2015 · 97 comments on HN
- 2Show HN: Kirby's Dreamland 2 level viewer, in JavaScript3 people · 53 points · first shared 2016 · 19 comments on HN
- 3I translated a simple C program to x86_64 and it was slower2 people · 217 points · first shared 2020 · 126 comments on HN
- 4A glance into web tech-based text editors’ text management2 people · 101 points · first shared 2016 · 20 comments on HN
- 5How to Build a VGA Cable Out of Household Items2 people · 24 points · first shared 2015 · discussion on HN
- 6Why Low Level Lisp is my preferred language for Ethereum Development (2017)2 people · 3 points · first shared 2018 · discussion on HN
- 7Backing Up for Mortals2 people · 3 points · first shared 2020 · discussion on HN
- 8Age of Empires 2 Scenario Editor Is Turing Complete1 people · 143 points · first shared 2018 · 33 comments on HN
- 9Some thoughts on simple state machines using x86_64 / assembly1 people · 40 points · first shared 2020 · 1 comments on HN
- 10The Practicality of J2ME Applications1 people · 33 points · first shared 2014 · 41 comments on HN
- 11Show HN: TensorFlow on FreeBSD1 people · 22 points · first shared 2016 · discussion on HN
- 1280% of software is useless, the other 20% is open source1 people · 4 points · first shared 2020 · 1 comments on HN
- 13Fox News' “pretend voting day” voting system exploit1 people · 4 points · first shared 2016 · discussion on HN
- 14Show HN: The No-Bullshit Web Application Testing Guide1 people · 4 points · first shared 2015 · discussion on HN
- 15Attempt to Use Salvaged Display with Raspberry Pi1 people · 3 points · first shared 2014 · discussion on HN
What HN people wrote when they linked it
fallat · 2021-07-13
Hey, I hope there is a BackBlaze person lurking the comments.
I use BackBlaze to make sporadic, one time backups. I then disconnect everything - which is just 2 mirrored drives. These drives only contain important documents.
Can BackBlaze please not delete my backups if my drives are not connected for X days, even though I pay for the backups? It is very confusing to me, and actually pretty damn frustrating.
To be more clear, my backup solution is detailed here, where I recommend BackBlaze even: https://ecc-comp.blogspot.com/2020/07/backing-up-for-mortals.html
Thanks!
hawski · 2016-12-05
> I wonder what data structure the Atom text editor uses --- it's famously slow on large files, but I doubt that's where the bottleneck is; it's more like an IDE so parsing and rendering are taking the bulk of the time. It is written in JavaScript and browser-based, but having seen JS run a PC emulator and boot a usable Linux kernel, I don't think that is the bottleneck either.
There was quite nice post [1] commented here [2] lately on text management of web text editors.
Quote:
> Every time text is inserted, it's inserted as one "chunk", then split up by its line endings. This is done by invoking a regular expression engine. Personally I think this is overkill, but it certainly lets Atom continue to be easily modifiable. I can imagine the same thought is running through a few people reading this. It pushes all the new lines to a stack (or more technically: a regular JavaScript array). Already I don't want to find myself opening a large file. It then uses "spliceArray" to replace a range of lines.
> So what is the actual data structure of the great Atom text buffer?...
> @lines = [''];
> A regular JavaScript array. Ooof.
I think that in JS simple operations on arrays of strings have much more impact than in C. Few things from the top of my mind: additional metadata that has to be managed behind the scenes and garbage collection. But I don't really know how it would add up to overall performance. Certainly performance would look different if text would be rendered by…
klibertp · 2018-03-06
Yeah, reminds me of this post: https://ecc-comp.blogspot.com/2015/05/a-brief-glance-at-how-5-text-edi…
There's a simple array of lines, a gap buffer, a BTree... No DOM, though. I wonder why... :)
Karuma · 2016-03-16
This is a much interesting link: http://ecc-comp.blogspot.com/2016/03/reverse-engineering-kirbys-dreaml…
Has some screenshots too.
Someone · 2022-01-10
https://news.ycombinator.com/item?id=20603567, discussing https://viewsourcecode.org/snaptoken/kilo/index.html probably will give you some hints.
Architecture-wise, you can start with an ordered list of lines, with each line stored as a string.
Features that complicate things are:
- supporting large documents and staying speedy (“replace all” is a good test case)
- supporting line wrapping or proportional fonts (makes it harder to translate between screen locations and (line, character) offsets)
- supporting Unicode (makes it harder to translate between screen locations and (line, byte position) offsets)
- syntax-colouring
- plug-ins
- regular expression based search (fairly simple for single-line search _if_ you store each line as a string; harder for custom data structures, as you can’t just use a regexp library)
- supporting larger-than-memory files (especially on systems without virtual memory, but I think that’s somewhat of a lost art)
- safely saving documents even if the disk doesn’t have space for two files (a lost art. Might not even have been fully solved, ever)
Edit: you also want to look at https://news.ycombinator.com/item?id=11244103, discussing https://ecc-comp.blogspot.com/2015/05/a-brief-glance-at-how-5-text-edi…