Facebook's time parser, frozen in 2017 amber
A Clojure library that turns "last Monday of January 2015 at 6am" into structured data—before it was abandoned for a Haskell rewrite.
What it does
Duckling parses fuzzy human text—dates, durations, temperatures—into structured maps with typed values and “grain” precision. Feed it “the first Tuesday of October” and get back an ISO timestamp plus :day granularity. It shipped with multilingual support out of the box.
The interesting bit
The whole API surface is two functions: load! and parse. That’s either elegant minimalism or a sign that the real complexity lives in the undocumented rule engine. The README hints at :time, :duration, :temperature and more, but never lists them exhaustively.
Key highlights
- Supports English, French, Spanish, Chinese, and likely others via
:xx$coreconfigurations - Returns byte offsets (
:start/:end) for the matched substring, useful for highlighting - Grain system (
:day,:hour) lets downstream code know how precise to get - Published to Clojars; one dependency away in a
project.clj - Live playground existed at
duckling.wit.ai(status unknown)
Caveats
- Deprecated since May 2017; Facebook explicitly moved to a new Haskell implementation
- README is essentially a quickstart card; no architecture docs, no rule-writing guide
- The
load!side effect and global state won’t win functional purists
Verdict Worth studying if you’re building a date-time parser and want to see how much complexity two functions can paper over. Skip it for production unless you’re already committed to maintaining a dead fork.