Antirez’ tiny JSON selector library

Salvatore Sanfilippo, also known as antirez, recently released a telegram bot library in C. Although I’m not particularly interested in telegram bot libraries, I always enjoy reading Salvatore’s code because it is always outstanding. The interesting part of this release is a file that includes a simple selector library built on top of the json library that he is using. In just 100 lines of code, Salvatore has implemented a function that can parse and execute a small jq-like language. It’s a clever demonstration of how a parser for a tiny language can be made so simple. I might even try re-implementing it in a different language for better understanding in the future.

https://notes.billmill.org/link_blog/2023/11/antirez__tiny_JSON_selector_library.html

To top