<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="380752" data-post-id="380752">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="garrison" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  garrison
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I don’t love dependencies (as you know) but RSS is one of those things where it’s better to have a battle-tested library because there are a lot of edge cases in the real world. HTML also used to be one of those things until everyone sat down, wrote down all of the edge cases (html5), and said “enough”. And then there’s Markdown, where they <em>tried</em> to write down the edge cases but it didn’t work (lol).</p>
<p>I think if I was writing a new RSS parser right now I would collect a large corpus of feeds and test against a well-worn parser. That should surface the bugs quickly enough.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="380752" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/recommendations-to-parse-atom-and-rss-feeds/73784/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-380752" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="380752"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="380753" data-post-id="380753">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dimitarvp" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/120/38664_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dimitarvp
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="garrison" data-post="12" data-topic="73784">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/g/3bc359/48.png" class="avatar"> garrison:</div>
<blockquote>
<p>I think if I was writing a new RSS parser right now I would collect a large corpus of feeds and test against a well-worn parser. That should surface the bugs quickly enough.</p>
</blockquote>
</aside>
<p>That’s my option three. I’d literally start collecting RSS and Atom feeds and just extend my newborn library with the edge cases I found when needing to process the feeds I care about (and I’ll say as much in the README of the library). I see no point in bringing in a big dependency “just in case”.</p>
<p>Frak “just in case”. I am done with that.</p>
<p>…Well, not quite, but let’s just say that I am mostly done with it. I am paranoid at work but being a senior and even half-PM and half-CTO, I need to prioritize aggressively. It helps a lot with killing the misguided perfectionism.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="380753" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/recommendations-to-parse-atom-and-rss-feeds/73784/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-380753" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="380753"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="380754" data-post-id="380754">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="garrison" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  garrison
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>There are situations which require you to handle all edge cases, e.g. an RSS reader service or anything else with user input.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="380754" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/recommendations-to-parse-atom-and-rss-feeds/73784/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-380754" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="380754"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="380755" data-post-id="380755">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dimitarvp" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/120/38664_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dimitarvp
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Absolutely. I shifted topics to home-grown stuff, my apologies.</p>
<p>I share your reservations: I too think using a NIF for something as trivial as ingesting the occasional XML is heavy-handed. And I am very intrigued by how did <a class="mention" href="/u/derek-zhou" rel="nofollow">@derek-zhou</a> write his software though it’s likely commercial and will never be open-sourced.</p>
<p>The only thing that annoys me when parsing outside input with Elixir is that the BEAM holds on to 64+ bytes long binaries and you have to take special care not to introduce a huge cyclic graph of them that will never be GC’d. If my Golang wasn’t as rusty as it is currently I’d likely write anything in that ballpark with it.</p>
<p>Or learn how to copy segments of binaries without introducing the huge GC cycles and just use <code>:xmerl</code> – that’s what I would do if I absolutely had to stay with the BEAM (which all of us that work with Elixir for money do).</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="380755" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/recommendations-to-parse-atom-and-rss-feeds/73784/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-380755" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="380755"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="380756" data-post-id="380756">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="thiagomajesk" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/thiagomajesk/120/31904_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  thiagomajesk
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Shameless plug here, but take a look at <a href="https://github.com/thiagomajesk/gluttony" rel="noopener nofollow ugc">Gluttony</a>. It’s Sax-based, and it’s pretty fast. I haven’t been using it for a while, but the code is stable and pretty extendable / easy to maintain<br>
.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="380756" data-batch-url="/posts/batch_likers">
                        4
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/recommendations-to-parse-atom-and-rss-feeds/73784/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-380756" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="380756"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-most-liked cat-most-liked" title="One of the top 3 liked posts in this thread!"></div>
  </section>
</div>
    <div class="postbit" id="380757" data-post-id="380757">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="garrison" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  garrison
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>On the other hand if you know what you’re doing the refc binary slicing behavior is extremely powerful. I managed to design a whole storage engine that never actually deserializes the blocks from disk and only copies out what it needs just-in-time. But more on that later.</p>
<p>In this case you would indeed have to be careful to copy out the binaries while parsing. I would think libraries like Saxy and Floki do this by default, right?</p>
<p>There are huge advantages to be had staying within the BEAM, and that’s what I was getting at with the NIF comment. In Elixir you can build server-rendered multitenant apps that can just do stuff like fetching an RSS feed from the web and parsing it without any indirection. It’s a very unique value proposition. My understanding is that Go is the closest (goroutines) but they still have a global GC which is not enough.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="380757" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/recommendations-to-parse-atom-and-rss-feeds/73784/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-380757" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="380757"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="380758" data-post-id="380758">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dimitarvp" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/120/38664_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dimitarvp
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="garrison" data-post="17" data-topic="73784">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/g/3bc359/48.png" class="avatar"> garrison:</div>
<blockquote>
<p>On the other hand if you know what you’re doing the refc binary slicing behavior is extremely powerful. I managed to design a whole storage engine that never actually deserializes the blocks from disk and only copies out what it needs just-in-time. But more on that later.</p>
</blockquote>
</aside>
<p>Now you got me interested. This is one of those things that I know are important but never got around to them. If you plan a write-up on the topic then do ping me.</p>
<aside class="quote no-group" data-username="garrison" data-post="17" data-topic="73784">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/g/3bc359/48.png" class="avatar"> garrison:</div>
<blockquote>
<p>I would think libraries like Saxy and Floki do this by default, right?</p>
</blockquote>
</aside>
<p>No idea. I would not bet on it unless I specifically go and check.</p>
<aside class="quote no-group" data-username="garrison" data-post="17" data-topic="73784">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/g/3bc359/48.png" class="avatar"> garrison:</div>
<blockquote>
<p>My understanding is that Go is the closest (goroutines) but they still have a global GC which is not enough.</p>
</blockquote>
</aside>
<p>Theoretically correct but in practice Golang’s GC is one of the most iterated on and perfected (maybe except the JVM one). They have literal microseconds worth of GC pauses even on high-traffic services.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="380758" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/recommendations-to-parse-atom-and-rss-feeds/73784/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-380758" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="380758"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #17"></div>
  </section>
</div>
    <div class="postbit" id="380759" data-post-id="380759">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="garrison" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  garrison
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I had not seen this one before. Skimmed through it quickly and it looks good to me. Also great name!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="380759" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/recommendations-to-parse-atom-and-rss-feeds/73784/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-380759" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="380759"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #18"></div>
  </section>
</div>
    <div class="postbit" id="380761" data-post-id="380761">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="ducharmemp" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/ducharmemp/120/32121_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  ducharmemp
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Plugging my own library here if we’re talking about parsers– <a href="https://github.com/ducharmemp/saxaboom" class="inline-onebox" rel="noopener nofollow ugc">GitHub - ducharmemp/saxaboom · GitHub</a></p>
<p>It uses saxy, xmerl, or erlsom. I was actually trying to make my own rss feed aggregator and reader and got pretty far with using my structural parser in <a href="https://github.com/ducharmemp/nosh" class="inline-onebox" rel="noopener nofollow ugc">GitHub - ducharmemp/nosh · GitHub</a> but it <em>definitely</em> didn’t get up to compliance standards like gluttony or other libs.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="380761" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/recommendations-to-parse-atom-and-rss-feeds/73784/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-380761" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="380761"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #19"></div>
  </section>
</div>
    <div class="postbit" id="380780" data-post-id="380780">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Wigny" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Wigny/120/25529_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Wigny
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="dimitarvp" data-post="11" data-topic="73784">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/48/38664_2.png" class="avatar"> dimitarvp:</div>
<blockquote>
<p>And yes if memory serves <code>:xmerl</code> does not use atoms</p>
</blockquote>
</aside>
<p>I was just playing with <code>xmerl</code> this week and sadly it parses XML generating atom keyed trees.</p>
<aside class="quote no-group" data-username="garrison" data-post="10" data-topic="73784">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/g/3bc359/48.png" class="avatar"> garrison:</div>
<blockquote>
<p>it seems like maybe the xmerl sax parser does use strings?</p>
</blockquote>
</aside>
<p>Yes, we have the option of using <code>xmerl_sax_parser</code> and handle the string parsing ourselves:</p>
<p><a href="https://github.com/Wigny/xml/blob/7a41eeed367709d1a4359e8b4b87ffa9ff8f05d0/lib/xml/parser.ex#L13" class="onebox" target="_blank" rel="noopener nofollow ugc">https://github.com/Wigny/xml/blob/7a41eeed367709d1a4359e8b4b87ffa9ff8f05d0/lib/xml/parser.ex#L13</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="380780" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/recommendations-to-parse-atom-and-rss-feeds/73784/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-380780" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="380780"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #20"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/73784/load_more?page=3">Load more posts (3 remaining)</a>
</div></template></turbo-stream>