Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best YAML parser in elisp?

Tags:

emacs

yaml

elisp

I want to read config in YAML with elisp code. Searched but didn't find ready-to-use parser in elisp. Did I miss something useful?

like image 299
Vivodo Avatar asked Apr 10 '12 17:04

Vivodo


2 Answers

Three years later, we have dynamic modules, and emacs-libyaml looks pretty interesting. It uses the dynamic module system to expose the C bindings of libyaml in Elisp. I would expect the performance to be fantastic, although I haven't tested it.

like image 185
Radon Rosborough Avatar answered Sep 25 '22 21:09

Radon Rosborough


Six months later, it appears that the answer is "there exists no solid easily-available elisp YAML parser."

If you really want to read a YAML document in elisp and turn it into something that elisp can interact with, you're going to have to put in some gnarly work. The EmacsWiki YAML page hasn't got much for you, and the canonical YAML mode has syntax hints, but no actual parser. Fortunately someone has implemented a YAML-parsing web-app that takes YAML and outputs JSON or Python - you could try to get a look under the hood of that and-or use it to check any YAML parser you may write yourself.

Good luck.

like image 26
Brighid McDonnell Avatar answered Sep 25 '22 21:09

Brighid McDonnell