←back to thread

81 points behnamoh | 1 comments | | HN request time: 0.2s | source
Show context
mplanchard ◴[] No.43683465[source]
I did Advent of Code in Janet the year before last I think, and really loved the PEG support. Essentially every day started out with making a quick grammar to parse the problem into whatever data structures I was using. It's intuitive, pretty easy to pick up and adjust, and powerful.
replies(2): >>43683928 #>>43684869 #
1. 3036e4 ◴[] No.43683928[source]
I did that as well, in 2023. Tried to use PEGs as much as possible. Have only good memories of the PEGs, but have not had much reason to use them since. Janet+PEG is definitely something I will consider for future projects whenever I need to parse something. Even for something that would otherwise be just a small regular expression I think writing a PEG instead may make some sense for readability.