Tag

Tree-sitter

2 stories

Parser combinators in TypeScript, shown by parsing real ping output (t3.at)

A parser here is a function from a string to a value and the unread remainder. Small ones chain into larger ones with pSeq, pMap and pRepeat, and the typed result is a tuple or object rather than a match array.

The finished example parses the header, per-packet lines and summary of a real ping run into one typed object.

Not just a headline — the discussion unpacked

The top HN threads: facts from the discussions, both sides, insider voices. Email, Telegram, or RSS.

Emacs 31 finally makes tree-sitter 'just work', and users are deleting their dotfile hacks (rahuljuliato.com)

Rahul Juliato's rundown of the Emacs 31 features he's daily-driving topped HN: auto-installing tree-sitter grammars, editable xref result buffers, window-layout transposition, and speedbar as a real side window. The author showed up in the thread to answer questions.

The feature that landed hardest was the boring one. 'Tree-sitter that just works' lets one longtime user delete a multi-line, OS-branching dotfile script he'd carried for years to make syntax highlighting behave.