frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Generate tests from GitHub pull requests

2•Aamir21•1m ago•0 comments

AI, Human Cognition and Knowledge Collapse – Daren Acemoglu

3•aanet•1h ago•1 comments

Ask HN: What's your biggest pain point when joining a new developer team?

4•KevStatic•3h ago•7 comments

Ask HN: Got cancer, a new job,new boss in less than a year What do I do now?

16•Goleniewski•12h ago•16 comments

I traced $2B in nonprofit grants for Meta and Age Verification lobbying

65•theseusares•16h ago•17 comments

Ask HN: Is there prior art for this rich text data model?

3•chrisecker•4h ago•2 comments

I'm a project manager, to the engineers: how replaceable do you think my job is?

9•ferociousmadman•11h ago•17 comments

Instagram Ending Encrypted DMs

4•01-_-•4h ago•1 comments

Ask HN: What Are You Working On? (March 2026)

289•david927•4d ago•1122 comments

Tell HN: Apple development certificate server seems down?

109•strongpigeon•3d ago•39 comments

Ask HN: Why have co-ops never played a major role in tech?

6•AbstractH24•10h ago•7 comments

Enabling Media Router by default undermines Brave's privacy claims

4•noguff•19h ago•2 comments

X is selling existing users' handles

196•hac•2d ago•90 comments

Looking for Partner to Build Agent Memory (Zig/Erlang)

6•kendallgclark•1d ago•5 comments

Ask HN: How to be alone?

686•sillysaurusx•5d ago•560 comments

Ask HN: Is Claude down again?

86•coderbants•2d ago•72 comments

Ask HN: Remember Fidonet?

121•ukkare•3d ago•69 comments

Ask HN: Does anyone here use Discord as their work chat tool?

2•Poomba•18h ago•7 comments

Ask HN: Please restrict new accounts from posting

715•Oras•5d ago•508 comments

Ask HN: Most beautiful personal blog UI you have ever seen?

150•ms7892•5d ago•55 comments

Tell HN: I'm 60 years old. Claude Code has re-ignited a passion

1076•shannoncc•6d ago•984 comments

Claude 4.6 Opus can recite Linux's list.h

23•itzmetanjim•1d ago•3 comments

Ask HN: How do you cope with the broken rythm of agentic coding?

14•pauletienney•1d ago•7 comments

AI is supercharging fake work

12•rxm233•1d ago•3 comments

Ask HN: Why is my submission not visible if I am not logged in?

3•beepbooptheory•1d ago•6 comments

Ask HN: Can I repurpose a Bluetooth voice remote as input device for a PC?

15•albert_e•5d ago•20 comments

Ask HN: Which DNS based ad blocker do you suggest?

3•SoftwareEn2•1d ago•13 comments

The Strait of Hormuz: A systems engineering view on the $20k drone threat

3•BeyondTheMap•1d ago•3 comments

LazyFire – a lazygit-style terminal UI for Firebase Firestore

4•egosurffing•1d ago•1 comments

What is the strongest open source model for coding against Opus 4.6?

3•eeko_systems•1d ago•2 comments
Open in hackernews

Ask HN: Is there prior art for this rich text data model?

3•chrisecker•4h ago
I've built a rich text data model for a desktop word processor in Python, based on a persistent balanced n-ary tree with cached weights for O(log n) index translation. The document model uses only four element types: Text, Container, Single, and Group — where Group is purely structural (for balancing) and has no semantic meaning in the document. Individual elements are immutable; insert and takeout return new trees rather than mutating the old one. This guarantees that old indices remain valid as long as the old tree exists. I'm aware of Ropes, Finger Trees, and ProseMirror's flat index model. Is there prior art I should know about — specifically for rich text document models with these properties?

Comments

PaulHoule•4h ago
So my first take is that there is something off about all WYSIWYG editors going back to Microsoft Word. Like you try to select some text to cut-and-paste and you can select the whole text except the first letter but if you try to get the whole text it suddenly jumps to select the whole document. Or hitting the "B" button sometimes bolds the paragraph above where you are, etc. It's like there is something wrong with the conceptual model behind all of these things.

So when I read "Group is purely structural (for balancing) and has no semantic meaning" my blood runs cold. Here's a mysterious something hidden in the document which bizzare misbehavors will be centered around. Like maybe when I try to select something and I got something else, it is one of those groups.

chrisecker•3h ago
You're right that hidden structure is often the cause of strange effects — but Group is not a document element in that sense. It's invisible at the index level too: when you iterate over the document by index, you pass through Groups transparently. A Group is purely a tree node for balancing purposes — it has no position in the document model that a cursor could land on, no semantic meaning, and no user-visible boundary. It has no effect the user can see or feel. Think of it like the internal nodes of a B-Tree: they exist to keep the structure efficient, but you never 'see' them when you traverse the data."