frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

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

3•chrisecker•2h 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•1h 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•42m 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."

AI, Layoffs and the Shifting Tech Job Landscape

https://inc42.com/buzz/ai-layoffs-and-the-shifting-tech-job-landscape/
1•saikatsg•1m ago•0 comments

Made-in-Canada Circuit Boards

https://www.reilindustrial.com/
2•jbm•5m ago•0 comments

The MacBook Air 13 (M5) is still the best ultraportable I've ever used

https://www.techradar.com/computing/macbooks/apple-macbook-air-13-inch-m5-review
1•mounram•6m ago•0 comments

Precious metals boom catches the attention of organized crime in Mexico

https://english.elpais.com/international/2026-02-21/precious-metals-boom-catches-the-attention-of...
2•PaulHoule•6m ago•0 comments

How Safe Is Plasma Donation?

https://www.nytimes.com/2026/03/13/health/plasma-donation-safety.html
1•koolba•6m ago•0 comments

Most EU startups use US hosting services

https://www.cloudinfraatlas.eu/scan/
1•domdaddydo•7m ago•2 comments

The anxiety driving AI's brutal work culture is a warning for all of us

https://www.theguardian.com/technology/ng-interactive/2026/feb/17/ai-startups-work-culture-san-fr...
4•saikatsg•9m ago•0 comments

The Boom in Autism Therapy Is Medicaid's Fastest-Growing Jackpot

https://www.wsj.com/health/healthcare/autism-therapy-medicaid-payments-640aa435
1•impish9208•10m ago•1 comments

Show HN: Anthrology – Time-Traveling Radio

https://anthrology.site/
2•airstrike•10m ago•0 comments

U.S. Tech Giants Flocked to the Persian Gulf. Now They Are Targets

https://www.nytimes.com/2026/03/13/technology/amazon-google-persian-gulf-war.html
7•standardUser•13m ago•0 comments

A one-question experiment to measure trust

https://trust-ledger-11.preview.emergentagent.com/trust-test
1•roeik•14m ago•0 comments

Show HN: Mutate – free inline text replacement for Mac

https://github.com/robert-v/Mutate-public
2•rob3rth•14m ago•1 comments

Evan You shows VOID: Vite-native deployment platform [video]

https://www.youtube.com/watch?v=Bp86buftbX8
1•CharlesW•15m ago•0 comments

Digg: A Hard Reset, and What Comes Next

https://digg.com/
2•pavel_lishin•17m ago•2 comments

Florida's New "Thought Police" Bill Is Real (HB 945) [video]

https://www.youtube.com/watch?v=9wjnBWnL8bM
1•hrimfaxi•17m ago•1 comments

AI engineer uses ChatGPT+AlphaFold to develop cancer vaccine for his dog

https://www.theaustralian.com.au/business/technology/tech-boss-uses-ai-and-chatgpt-to-create-canc...
4•bensandcastle•19m ago•1 comments

Right to Compute Act (NH HB1124)

https://legiscan.com/NH/text/HB1124/id/3286560
1•maxwell•21m ago•0 comments

GitHub infuriates students by removing some models from free Copilot plan

https://www.theregister.com/2026/03/13/microsoft_github_removes_models_student_plan/
2•raybb•25m ago•0 comments

Who Goes Nazi? (1941)

https://harpers.org/archive/1941/08/who-goes-nazi/
10•Anon84•25m ago•2 comments

Reverse-engineering Claude's generative UI – then building it for the terminal

https://michaellivs.com/blog/reverse-engineering-claude-generative-ui/
1•gmays•25m ago•0 comments

coming soon: fashion critique newsletter

https://igasped.substack.com/about
2•kholiflower•28m ago•1 comments

Show HN: I save £300/mo by auto-scaling my staging cluster at night

https://github.com/tiny-systems/desktop-client
1•gtpoxa•28m ago•0 comments

Claude Visual and Interactive Content

https://support.claude.com/en/articles/13641943-visual-and-interactive-content
2•droidjj•29m ago•0 comments

Accidental complexity, essential complexity, and Kubernetes (2022)

https://jamsocket.com/blog/complexity-kubernetes
1•Tomte•31m ago•0 comments

US Gas spending increase since Feb 28

https://gas-cost-of-iran-war.netlify.app/
2•loss_flow•31m ago•2 comments

Show HN: DJX – Convention over Configuration for Django (Rails-Inspired CLI)

2•RedsonNgwira•32m ago•0 comments

Waller: A game teaching the fundamentals of drystone walling

https://www.orthodoxmasonry.com/waller
3•CGMthrowaway•33m ago•0 comments

How do you capture WHY engineering decisions were made, not just what?

13•zain__t•35m ago•8 comments

Hawkeye – open-source flight recorder

2•mklamine•35m ago•1 comments

Another AT&T FirstNet user gets $6,200 bill, at $2 per megabyte

https://arstechnica.com/tech-policy/2026/03/att-wrongly-charged-man-6196-reversed-bill-after-hear...
4•mounram•36m ago•0 comments