Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
In this presentation titled "Getting Along with YAML Comments with Psych," Masaki Hara discusses his development of a library focused on retaining comments in YAML parsing. Hara introduces the complexities of YAML and its capabilities, highlighting its similarity to JSON, its roots in Perl serialization, and its powerful handling of complex data types. The presentation covers the three key steps of YAML processing: conversion of text to a tree, tree to graph, and finally to Ruby objects, detailing how comments traditionally disappear during parsing with existing libraries such as Psych. Hara explains how his library, which operates at a mid-level API, retains comments by employing a two-pass parsing strategy. In the first pass, the library uses the original parser, while the second pass focuses on isolating comments through an algorithm that scans for them while managing potential edge cases, such as how extra hashes or trailing comments are processed. The talk also presents challenges involved in extending the Psych library due to its reliance on a C library named LibYAML, which limits modifications. Hara elaborates on the behavior of the library's generator, distinguishing it from parsers and explaining that formatting functions are crucial for preserving spacing and indentation. Finally, Hara summarizes the development of the PyC comment gem, explaining its purpose and future considerations for expanding the library while also acknowledging the limitations in expressing YAML comments. He concludes with insights on the balance between practical implementation and theoretical application of comments in YAML, underscoring the library's focus on maintaining the integrity of comments during parsing.
Suggest modifications
Cancel