Prolog was originally invented for parsing natural language (in 1972-ish rule-/logic basic formalisms not LLM or anything fancy), and thus has convenient built-in recursive-decent parsing with backtracking built-in into the language semantics, but also has bottom-up parsing facilities for defining operator precedence parsers. That's why it's very convenient for building DSLs, logical domain knowledge bases, and programming language prototypes such as for Erlang.