Tony Finch
dotat.at · Personal blog · on HN since 2012
Tony Finch writes technical notes on parsing, data structures, random numbers, Unix tools and time, plus a link log.
What HN saysHN links his post on where computers get the time from as a favorite, and his notes on temp files and GLL parsing for technical detail.
58HN people shared it
27linked it in comments
96stories submitted
1.7Kstory points
3 months agolast shared
2012people per year2026
Most-shared posts
- 1GLL Parsing (2010) [pdf]6 people · 24 points · first shared 2014 · discussion on HN
- 2QP-Tries5 people · 2 points · first shared 2017 · discussion on HN
- 3Really divisionless random numbers4 people · 68 points · first shared 2022 · 34 comments on HN
- 4Where does my computer get the time from?4 people · 33 points · first shared 2023 · discussion on HN
- 5Sudon't4 people · 15 points · first shared 2024 · 3 comments on HN
- 6Dot Dotat.at4 people · 2 points · first shared 2021 · discussion on HN
- 7Unifdef4 people · first shared 2015
- 8Exponential Rate Limiting3 people · 119 points · first shared 2024 · 23 comments on HN
- 9An Update on Leap Seconds3 people · 6 points · first shared 2022 · 1 comments on HN
- 10p-fast trie: lexically ordered hash map3 people · 6 points · first shared 2025 · discussion on HN
- 11HTTP RateLimit Headers3 people · 6 points · first shared 2026 · 1 comments on HN
- 12One Page of Async Rust3 people · 5 points · first shared 2026 · discussion on HN
- 13Homepage3 people · first shared 2014
- 14Against /tmp2 people · 257 points · first shared 2024 · 159 comments on HN
- 15Constructing a Four-Point Egg2 people · 166 points · first shared 2024 · 52 comments on HN
What HN people wrote when they linked it
thakoppno · 2025-03-29
This reminded me of one of my favorite links ever on HN.
https://dotat.at/@/2023-05-26-whence-time.html
pxeger1 · 2024-10-29
It's quite hard to write mktemp securely[1]. It would be great if POSIX didn't make people attempt to do that error-prone task themselves.
[1]: There's some explanation in this recent post: https://dotat.at/@/2024-10-22-tmp.html
fanf2 · 2024-05-17
Not entirely a bot and not entirely old content.
I’ve got a lot of good stuff in my link log https://dotat.at/:/ so I thought it might be fun to share a few retro classics. There has been some good discussion, so it seems to be worth it.
inopinatus · 2023-07-27
Tony Finch's email address is still my favourite. https://dotat.at/email.html
wtetzner · 2020-10-26
Any chance of also including GLL (generalized LL)?
I found the paper (http://dotat.at/tmp/gll.pdf) quite hard to follow, and haven't been able to find a good explanation anywhere else.
Doctor_Fegg · 2014-07-07
This guy famously has an email address that can only be parsed one way... with a little thought: http://dotat.at/ (scroll to the bottom for mail)
mananaysiempre · 2025-08-10
Cool, yes. Useful or a good idea, I dunno. Reading through the (non-reference) documentation on SOM, I’m struck by how they never could give a convincing example for the utility of metaclasses. (Saying this as someone who does love metaclasses in Python, which are of course an inferior interpretation of the same academic sources.) The SOM documentation is also surprisingly shallow given its size: with a copy of Brockschmidt, Box, the COM spec, and the Platform SDK manual, you could reimplement essentially all of COM (not ActiveX though), whereas the IBM’s documentation is more like “here’s how you use our IDL compiler and here are the functions you can call”. (This is in contrast with the Presentation Manager documentation, which is much tighter and more detailed than the one for USER/GDI ever has been.) From what I can infer of the underlying principles, I feel SOM is much more specific about its object model, which, given the goal is a cross-language ABI, is not necessarily a good thing. (I’d say that about WinRT too.)
And of course COM does do implementation inheritance: despite all the admonitions to the contrary, that’s what aggregation is! If you want a more conventional model and even some surprisingly fancy stuff like the base methods governing the derived ones and not vice versa, BETA-style, then WinRT inheritance[1] is a very thin layer on top of aggregation that accomplishes that. Now if only anybody at Microsoft bothered to document it. As in, at all.
(I don’t…
aquariusDue · 2025-07-12
Well, sometimes I'm digging through my (multiple!) lists of links when I remember a tidbit that relates to what I'm working on but most of the time those lists gather dust.
In the future I'd like to maintain a link log or something similar on my personal website like some people do:
- https://matklad.github.io/links.html
- https://dotat.at/:/
- https://til.simonwillison.net/
The weird thing about saved links in my case is that I get the most satisfaction out of them when I share them with friends and so on, a bit of "Hey! I think this might be helpful, here you go" and that ends up being the extent of that particular link's usefulness for myself most of the time. Of course I can't accurately gauge how helpful it actually is for the other person.
pja · 2024-05-17
Tony Finch is a real person: https://dotat.at/social.html
He used to be [email protected], amongst other things. Why he’s farming internet points on HN I’ve no idea!
senkora · 2024-03-09
You may be interested in unifdef, which selectively evaluates and removes ifdefs.
https://dotat.at/prog/unifdef/
I used it once at work for a niche usecase. It’s main use case seems to be making it easier to simplify platform-specific code when you remove support from old platforms in legacy codebases.
silasdavis · 2023-07-11
Crit bit tries are also, therefore, sorted. They can be iterated in order.
See also https://dotat.at/prog/qp/README.html
haberman · 2023-07-02
Do you mean the conversion from YYYY-MM-DD to Unix Time? That can be quite fast; I wrote a blog article showing some algorithms that take less than 10ns to perform the conversion: https://blog.reverberate.org/2020/05/12/optimizing-date-algorithms.htm…
Recently I came across another variant of the algorithm that is even smaller and simpler. I've been meaning to test this variant and add it to my article (assuming it is correct), but I haven't had the chance: https://dotat.at/@/2008-09-10-counting-the-days.html
mildbyte · 2022-10-13
Kind of off-topic, but this person's e-mail address is "dot at dotat dot at", which is very unique (see https://dotat.at/email.html).
dsr_ · 2022-10-10
Here's Tony Finch's discussion of the data structures he's working on for ISC's BIND:
https://dotat.at/prog/qp/README.html
wahern · 2020-11-18
This can be accomplished with the TCP socket options TCP_CORK on Linux and TCP_NOPUSH on FreeBSD and OpenBSD. When enabled only full TCP frames are sent; upon disabling any partial frame is immediately sent. See tcp(7) on Linux, tcp(4) on FreeBSD, and http://dotat.at/writing/nopush.html clarifying the behavior.
tonyg · 2018-10-12
Related: qp-tries and critbit tries: https://dotat.at/prog/qp/README.html, https://cr.yp.to/critbit.html
iovrthoughtthis · 2018-04-17
How have you totally missed GLL and GLR parsing?!
http://dotat.at/tmp/gll.pdf
lukego · 2017-03-17
Unifdef
http://dotat.at/prog/unifdef/
Saved me 100+ hours _this week_ :-). Thanks, Tony Finch &co!
nickpsecurity · 2016-09-22
Welcome. :) Here's the link to first paper I saw I think:
http://dotat.at/tmp/gll.pdf
cremno · 2015-03-22
There also some tools I think should be added: I'm not sure if linking to AddressSanitizer is okay (as its (an underused) part of Clang and GCC), but I consider include-what-you-use, unifdef, and maybe C++ Compiler Explorer a worthwhile addition.
What about mbedTLS (formerly PolarSSL)? It's dual licensed though.
https://code.google.com/p/address-sanitizer/(Apache 2.0)
https://code.google.com/p/include-what-you-use/ (same license as LLVM/Clang)
http://dotat.at/prog/unifdef/ (BSD)
http://gcc.godbolt.org/ (BSD)
https://tls.mbed.org/ (GPLv2)
Edit: midipix is something one should look out for. What it promises to support and how, sounds much more appealing to me than Cygwin or MinGW-w64, but it's still in early development: http://midipix.org/
brynet · 2015-03-18
This is an old Unix utility, OpenBSD versions <=5.5 shipped with a much older version from CSRG times. It was recently updated to the rewrite done by Tony Finch.
http://dotat.at/prog/unifdef/
panic · 2015-03-05
The algorithm used is Generalized LL parsing (http://dotat.at/tmp/gll.pdf), which promises linear-time parsing of LL grammars and cubic-time parsing of arbitrary grammars. For some reason this isn't mentioned until the very end.
samatman · 2014-12-01
Even in the parser corner, the parser combinator / graph-structured stack / GLL algorithm is both new and exciting. GLL was published in 2010: http://dotat.at/tmp/gll.pdf
pmav · 2012-10-12
I think listlife is a simple and efficient algorithm: http://dotat.at/prog/life/life.html
Some years ago I implementend something similiar in javascript: http://pmav.eu/stuff/javascript-game-of-life-v3.1.1/
The benchmark can be really slow in some steps.
takoid · 2022-09-17
https://jrock.us/
https://jgc.org/
http://kaledavis.com/
https://aegir.sexy/
https://www.gwern.net/
https://jacquesmattheij.com/
https://danwin.com/
https://www.kalzumeus.com/
https://www.magic.do/
https://edweissman.com/
https://jakeseliger.com/
http://www.fogus.me/
https://www.stavros.io/
https://jasonlefkowitz.net/
https://minimaxir.com/
https://www.robinwhittleton.com/
https://ciexinc.com/
https://rongarret.info/
https://williampietri.com/
https://bpier.re/
https://joshtriplett.org/
https://ooer.com/
https://feross.org/resume/
https://www.brandons.me/
https://benjaminpbreen.com/
http://hokstad.com/
https://www.scott-a-s.com/
https://www.bermita.com/
http://tlrobinson.net/
https://ldpreload.com/
https://dotat.at/
http://xavvy.com/
https://correa.in/
https://adriann.github.io/
https://leclan.ch/
https://joeyespo.com/
https://pius.me/
https://adamierymenko.com/
https://drewdevault.com/
https://battlepenguin.com/
https://chris.improbable.org/
https://www.snellman.net/
https://ocdtrekkie.com/
https://www.cryptolotus.com/
https://www.gregkogan.com/
https://david.kitchen/
In no particular order. From: https://jessimekirk.com/blog/hn_users_links/. I went through about half of the list looking for personal websites to use as inspiration for my own.
twic · 2021-06-11
Paging Tony Finch: https://dotat.at/email.html
PeCaN · 2015-12-23
Generalized LL Parsing - http://dotat.at/tmp/gll.pdf
Parse ambiguous context-free grammars in worst-case cubic time and unambiguous grammars in linear time, with an intuitive recursive-descent-ish algorithm. GLL is the future of parsing IMO, more powerful than packrat/PEG parsers and comparatively easy to write by hand. It also handles ambiguities more elegantly than GLR, IMO.
Dependency-Based Word Embeddings - https://levyomer.files.wordpress.com/2014/04/dependency-based-word-emb…
word2vec algorithm with context based on linguistic dependencies instead of a skip-gram approach. A quick explanation is skip-grams give words related to the embedding (ex: Hogwarts -> Dumbledore) and dependencies give words that can be used like the embedding (ex: Hogwards -> Sunnydale). It's not meant to replace skip-grams, but augment them; skip-gram contexts learn the domain and dependency-based contexts learn the semantic type.