←back to thread

81 points behnamoh | 3 comments | | HN request time: 0.225s | source
1. 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 #
2. 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.
3. wodenokoto ◴[] No.43684869[source]
I had plans to try the same, but with Python background and having never touched any lispy languages or any macros I found the Janet for Mortals book surprisingly difficult to follow and gave up.