frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Structured Etymology Dataset

https://github.com/droher/etymology-db
1•downboots•1m ago•0 comments

Google released an app that lets you download and run AI models locally

https://techcrunch.com/2025/05/31/google-quietly-released-an-app-that-lets-you-download-and-run-ai-models-locally/
1•ashutosh-mishra•6m ago•0 comments

Sebastião Salgado's View of Humanity

https://www.newyorker.com/culture/photo-booth/sebastiao-salgados-view-of-humanity
2•mitchbob•11m ago•1 comments

Function Black_box

https://doc.rust-lang.org/beta/std/hint/fn.black_box.html
1•csomar•14m ago•0 comments

Eliezer Yudkowsky: Artificial Intelligence and the End of Humanity [video]

https://www.youtube.com/watch?v=0QmDcQIvSDc
1•grugagag•18m ago•0 comments

Ask HN: Will chatbots trigger a AI winter?

2•theowawajkk•31m ago•0 comments

Commodore 64 Bass Guitar (2012)

https://www.youtube.com/watch?v=_kDhpFaf4EY
1•nazgulsenpai•35m ago•0 comments

Business Insider goes 'all-in on AI,' laying off 21% of staff

https://www.sfgate.com/bayarea/article/business-insider-ai-laying-off-staff-20353086.php
3•ryan_j_naughton•43m ago•0 comments

Basic Interpreter in Ruby

https://medium.com/@konstanty.koszewski_35161/basic-interpreter-in-ruby-from-scratch-part-1-c68bbf365ab0
1•thunderbong•47m ago•0 comments

Image to Text Converter

https://image-1.org
1•ghhjklhga•51m ago•0 comments

Ask HN: What are your honest thoughts on AI tools replacing programmers

2•kurrupttt•59m ago•5 comments

Unsafe Pricing at Any Scale

https://melkat.blog/p/unsafe-pricing/
1•Bluestein•1h ago•0 comments

Show HN: PollMasters – A desktop app to create, send, and track WhatsApp polls

https://github.com/harishoke/PollMasters
1•smithscotts•1h ago•1 comments

LocalScore – Local AI Benchmark by Mozilla Builders

https://www.localscore.ai/
1•nalinidash•1h ago•0 comments

Superabundance and the Infinite Game

https://domofutu.substack.com/p/superabundance-and-the-infinite-game
3•wjb3•1h ago•1 comments

U.S. Pauses Exports of Airplane and Semiconductor Technology to China

https://www.nytimes.com/2025/05/28/business/economy/jet-engine-chip-software-exports-to-china.html
2•bookofjoe•1h ago•2 comments

WebSockets guarantee order – so why are my messages scrambled?

https://www.sitongpeng.com/writing/websockets-guarantee-order-so-why-are-my-messages-scrambled
2•todsacerdoti•1h ago•0 comments

Ask HN: Why reinvent front-end frameworks and static site builders?

1•keepamovin•1h ago•0 comments

Of course the Apple Network Server can be hacked into running Doom

http://oldvcr.blogspot.com/2025/05/harpoom-of-course-apple-network-server.html
25•classichasclass•1h ago•3 comments

Buy a Blog Post

https://www.scannedinavian.com/buy-a-blog-post.html
2•akkartik•1h ago•0 comments

Map of the Known Human Metabolic Pathways (2017)

https://old.reddit.com/r/MapPorn/comments/6sxznd/map_of_the_known_human_metabolic_pathways/
1•downboots•1h ago•0 comments

Why does it matter if AI is sentient or not?

https://2084.substack.com/p/why-does-it-matter-if-ai-is-sentient
2•thatbritishspy•1h ago•5 comments

Rent-Setting Algorithms Find Legal Lifeline

https://www.wsj.com/real-estate/rent-setting-algorithms-find-legal-lifeline-4822ad5f
2•JumpCrisscross•1h ago•0 comments

OpenAI featured chatbot is pushing extreme surgeries to "subhuman" men

https://www.citationneeded.news/openai-incel-chatbot-subhuman-men/
5•OuterVale•1h ago•0 comments

OpenAI models defy human commands, actively resist orders to shut down

https://www.computerworld.com/article/3999190/openais-skynet-moment-models-defy-human-commands-actively-resist-orders-to-shut-down.html
3•_jcrossley•1h ago•0 comments

Ask HN: What are your thoughts on AI recruiters?

1•perthvandeda•1h ago•2 comments

Firefox now allows you to add custom search engine manually by default

https://bugzilla.mozilla.org/show_bug.cgi?id=1967739
2•gslin•1h ago•0 comments

Show HN: RustTensor: a Rust Library for Tensor Computation and ML Learning

https://github.com/ramsyana/RustTensor
1•ramram6278•1h ago•0 comments

Enhancing MySQL: MySQL improvement project

https://github.com/enhancedformysql/enhancedformysql
13•bratao•2h ago•10 comments

Google AI Edge Gallery

https://github.com/google-ai-edge/gallery
1•xnx•2h ago•0 comments
Open in hackernews

Ask HN:How do you structure comment trees to handle pagination, sort, recursion?

1•cyjackx•1d ago
Been burning my brains clock cycles for days as I brainstorm what might be me overcomplicating things.

I've got basic lazy loading implemented. Click expand on comment, it API calls for replies. It will show load more if there are more to load.

Contrast this with something like hackernews, which loads many layers at once. I can conceptualize a recursive way to retrieve the whole tree, but...

Supabase limits to 1000 rows returned; while I have not hit those limits yet, future proofing may be a good practice. Or simply limiting in general.

But limiting, paginating, and sorting all run into hurdles with a recursive call of arbitrary depth using one API call.

If the limit truncates one comment's replies, do I just need to have a column counting direct replies to compare to? Over fetching doesn't quite work here, does it?

Is it possible to sort within the recursive query such that if one of them still needs to load more, the order will be correct?

For ex, if my limit is 100 comments, there are interesting cases where it runs out breadth first or depth first.

I've been informed that I'm currently implementing something called adjacency list, but I'm not sure how I should implement eager loading of a few layers

Comments

PaulHoule•1d ago
Eager instead of lazy but how about: pull all the comments in chronological order starting from the beginning and then build the tree downstream of the database as items come in?

See also the nested set representation of trees which makes it fast to get subtrees.

[1] https://github.com/etrepat/baum [2] https://www.amazon.com/Hierarchies-Smarties-Kaufmann-Managem...