<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Shivansh Singh</title>
    <description>The latest articles on DEV Community by Shivansh Singh (@shivansh_singh_25562c9dde).</description>
    <link>https://dev.to/shivansh_singh_25562c9dde</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4061019%2Fbe8c367d-4e16-426c-ae90-c88408894f64.jpg</url>
      <title>DEV Community: Shivansh Singh</title>
      <link>https://dev.to/shivansh_singh_25562c9dde</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shivansh_singh_25562c9dde"/>
    <language>en</language>
    <item>
      <title>Porting Python Parsy to Rust: Lessons from Port Mortem 2026</title>
      <dc:creator>Shivansh Singh</dc:creator>
      <pubDate>Mon, 03 Aug 2026 16:28:27 +0000</pubDate>
      <link>https://dev.to/shivansh_singh_25562c9dde/porting-python-parsy-to-rust-lessons-from-port-mortem-2026-2aj2</link>
      <guid>https://dev.to/shivansh_singh_25562c9dde/porting-python-parsy-to-rust-lessons-from-port-mortem-2026-2aj2</guid>
      <description>&lt;p&gt;Completed my submission for Port Mortem 2026 – Code Resurrection Hackathon!&lt;/p&gt;

&lt;p&gt;Over the past few days, I worked on parsy-rs, an idiomatic Rust port of the Python Parsy parser combinator library.&lt;/p&gt;

&lt;p&gt;At first glance, porting a parser library sounds like a straightforward language translation. In reality, it became an exercise in understanding language design, type systems, and preserving behavior across two very different ecosystems.&lt;/p&gt;

&lt;p&gt;Python and Rust solve many of the same problems in fundamentally different ways.&lt;/p&gt;

&lt;p&gt;Python gives you dynamic typing, generators, *args, **kwargs, and flexible runtime behavior.&lt;/p&gt;

&lt;p&gt;Rust gives you ownership, lifetimes, traits, generics, and compile-time guarantees.&lt;/p&gt;

&lt;p&gt;That meant this project was never about translating code line by line—it was about preserving the intent of the original library while designing APIs that feel natural in Rust.&lt;/p&gt;

&lt;p&gt;Some interesting engineering decisions along the way:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Implemented the core parser combinator framework in idiomatic Rust.&lt;/li&gt;
&lt;li&gt;Adapted optional() to Rust's Option model.&lt;/li&gt;
&lt;li&gt;Redesigned combine() and combine_dict() to work with Rust's strongly typed collections.&lt;/li&gt;
&lt;li&gt;Replaced Python-specific patterns with Rust-native abstractions using bind() and map().&lt;/li&gt;
&lt;li&gt;Intentionally omitted generate() because Python's generator coroutine model has no direct equivalent on stable Rust.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Beyond writing code, I wanted the repository to feel like a real open-source project.&lt;/p&gt;

&lt;p&gt;The repository includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Comprehensive documentation&lt;/li&gt;
&lt;li&gt;Engineering decision log (DECISIONS.md)&lt;/li&gt;
&lt;li&gt;Port status tracking&lt;/li&gt;
&lt;li&gt;Benchmark &amp;amp; validation documentation&lt;/li&gt;
&lt;li&gt;Extensive Rust unit tests and documentation tests&lt;/li&gt;
&lt;li&gt;Versioned releases and incremental commit history&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A few project highlights:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Python → 🦀 Rust&lt;/li&gt;
&lt;li&gt;425 Rust unit tests passing&lt;/li&gt;
&lt;li&gt;57 documentation tests passing&lt;/li&gt;
&lt;li&gt;Stable release build&lt;/li&gt;
&lt;li&gt;cargo fmt&lt;/li&gt;
&lt;li&gt;cargo clippy&lt;/li&gt;
&lt;li&gt;Production-ready repository structure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The biggest takeaway from this project:&lt;/p&gt;

&lt;p&gt;Porting software isn't about translating syntax—it's about preserving behavior while embracing the strengths and constraints of the target language.&lt;/p&gt;

&lt;p&gt;A huge thank you to Hackathon Raptors for organizing Port Mortem 2026. I really enjoyed working on a challenge that rewarded engineering discipline, thoughtful design decisions, and software quality rather than just generating code.&lt;/p&gt;

&lt;p&gt;🔗 GitHub Repository:&lt;br&gt;
&lt;a href="https://github.com/shivansh023023/parsy-rs" rel="noopener noreferrer"&gt;https://github.com/shivansh023023/parsy-rs&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  PortMortem2026 #RustLang #Python #ParserCombinators #OpenSource #SoftwareEngineering #Hackathon @raptors_hack
&lt;/h1&gt;

</description>
      <category>portmortem2026</category>
      <category>rust</category>
      <category>parsercombinators</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
