News for hackers. Stuff that matters.
[dead]
Re:Tries as the evolution of nothing by saagarjha on Tuesday August 07, 2018 @11:28PM (#17713009)
Hi, it’s me, the pedantic try-hard with my real name as my Hacker News handle, and I’d like to tell you about the time I saved a project by implementing a trie (ok, a finite state machine derived from a trie) to speed up string matching by two orders of magnitude using the Aho-Corasick algorithm.
Re:Tries as the evolution of nothing by pedant-triehard on Tuesday August 07, 2018 @10:44PM (#17712831)
I'll bite: tries were (and are still?) used for longest prefix match lookups on IP addresses in forwarding plane software and hardware. I've actually seen and worked with tries in real, shipping, working hardware/software.

e.g. see https://vincent.bernat.im/en/blog/2017-ipv4-route-lookup-lin...

Later TCAMs came along for hardware lookups.

Re:Tries as the evolution of nothing by blattimwind on Wednesday August 08, 2018 @04:13AM (#17714028)
Tries are used by various networking systems in a similar capacity, e.g. both zeromq and nanomsg use tries to match subscription topics in pubsub.
Re:Tries as the evolution of nothing by kjeetgill on Wednesday August 08, 2018 @02:52AM (#17713717)
I don't think it's too pedantic to mention common non-interview uses. They're pretty core to search and spell checks problems. Or url routes in a webserver. Or routing IPs. Or keywords in a compiler. You know, anytime you have a set of a bunch of strings and you need to find one?
Re:Tries as the evolution of nothing by spadros on Tuesday August 07, 2018 @10:55PM (#17712871)
Thanks a lot, I'm actually so embarrassed right now. Never confidently log onto Hacker News drunk and expect to contribute in a meaningful way.
Re:Tries as the evolution of nothing by panic on Wednesday August 08, 2018 @01:23AM (#17713389)
To be fair, the name is pretty terrible! ("Prefix tree" is a much better name for them IMO)
Re:Tries as the evolution of nothing by spadros on Wednesday August 08, 2018 @10:03AM (#17716031)
Yeah I smiled this morning when I logged on to do some damage control on this thread and saw that the author updated the title.
Re:Tries as the evolution of nothing by bjoli on Wednesday August 08, 2018 @05:55AM (#17714457)
I see what you are saying, and I agree somewhat. They have uses that most people won't have to implement themselves though. Many persistent data structure use tries. They have been getting loads of attention, especially since clojure started using them.
Re:Tries as the evolution of nothing by JadeNB on Tuesday August 07, 2018 @10:15PM (#17712693)
> Of course as soon as you say that, some pedantic try-hard with their real name as their hnews handle will swoop in and tell you that time they saved Google by implementing one in production in under 20 minutes.

You say that like it's a bad thing, but isn't it good? If I think that something is of only academic interest, and then I find out about a real-world application, I feel that I have learned something that's worth knowing.

Re:Tries as the evolution of nothing by lamacase on Tuesday August 07, 2018 @10:13PM (#17712688)
I think you mean pedantic trie-hard
Re:Tries as the evolution of nothing by spadros on Tuesday August 07, 2018 @10:55PM (#17712872)
Laughed pretty hard