Top all-time · #13915
Jason H Priestley
Personal blog · jasonhpriestley.com · on HN as jhpriestleyprogrammingai
Jason H Priestley's personal blog at jasonhpriestley.com covers programming and ai. Since 2017, 5 different Hacker News readers have linked it 14 times, most often “The World's Shortest Regex Compiler?”. No feed was found, so read it on the site itself.
Too few sampled comments (3) to say how often HN recommends it.?
Why HN links it
HN readers link these posts on implementing unification and a linear-time regex matcher in about 65 lines of code. The comments cite and summarise the posts rather than judging the writing.
Summarised by Claude from a sample of 3 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.
Most-linked posts?
- The World's Shortest Regex Compiler?3 people · 3 mentions · first linked 2018-05-18
- Regex Optimization: DFAs and WebAssembly2 people · 3 mentions · first linked 2018-06-20
What Hacker News says?
For some reason the wikipedia article does not mention the more efficient Myers diff approach. I have recently implemented it here: https://jasonhpriestley.com/array-distance-and-recursion (for edit distance but Levenshtein should work similarly)
Comment linking /array-distance-and-recursion
on “Levenshtein Distance”Submitted LR Parsing: More Elegant Than You Think as a story · 160 points
HN discussionYou can also implement linear-time regex matching in user code with webassembly. In my tests it was faster than native regex matching ( https://jasonhpriestley.com/regex-dfa )
Comment linking /regex-dfa
on “ECMAScript regular expressions are getting better (2017)”Submitted Johnny LLM Can't Read Code as a story · 26 points
HN discussion> It is somewhat surprising that unification is cleaner and easier to implement in an loopy imperative mutational style than in a recursive functional pure style. I came to a similar conclusion, my implementation uses recursion but also leans on shared mutable variables, which is something I usually avoid especially for more "mathy" code. https://jasonhpriestley.com/short-simple-unification
Comment linking /short-simple-unification
on “Don't implement unification by recursion”Submitted Flows: A New Approach to UI Development as a story · 3 points
HN discussionThe features are less important than the linear complexity. It lowers to an NFA. An NFA can recognise any linear language, so adding more features affects the generation of the NFA, while increasing the performance involves faster matching against the NFA. In this case he's done a followup with benchmarks where he's converting the NFA to a DFA ajd comparing favourably against both Node and your browers regexp engine…
Comment linking /regex-dfa
on “How could the early Unix OS comprise so few lines of code?”Submitted The World's Shortest Regex Compiler? as a story · 3 points
HN discussionI've written a linear-time regex matcher in 65 lines of code: https://jasonhpriestley.com/regex
Comment linking /regex
on “How could the early Unix OS comprise so few lines of code?”Submitted Boyer-Moore Style Regex Search as a story · 2 points
HN discussionSubmitted Regex Optimization: DFAs and WebAssembly as a story · 2 points
HN discussionSubmitted The World's Shortest Regex Compiler? as a story · 2 points
HN discussionSubmitted Show HN: Imperative.js, simpler UIs with JavaScript generators as a story · 2 points
HN discussionSubmitted Flows: A New Approach to UI Development (2018) as a story · 1 points
HN discussion