Show HN: A nom parser for the Starcraft 2 Protocol Replay format
github.com
Show HN: A nom parser for the Starcraft 2 Protocol Replay format
1–10 of 58 posts
Re: Show HN: A nom parser for the Starcraft 2 Protocol Replay format
#2Re: Show HN: A nom parser for the Starcraft 2 Protocol Replay format
#3I may be the only one not familiar, but nom refers to https://github.com/rust-bakery/nom which looks like a pretty handy way to parse binary data in Rust.
Re: Show HN: A nom parser for the Starcraft 2 Protocol Replay format
#4Re: Show HN: A nom parser for the Starcraft 2 Protocol Replay format
#5I may be the only one not familiar, but nom refers to https://github.com/rust-bakery/nom which looks like a pretty handy way to parse binary data in Rust.
It's a pretty handy way to parse any sequence of things in Rust! I'm using it to write a compiler for a toy language and it's been a delight
Re: Show HN: A nom parser for the Starcraft 2 Protocol Replay format
#6I've also been impressed with the amount of data in SC2 replay files given the size, although I'm more interested in Broodwar (SC1) as a game. If I'm not mistaken Broodwar replay files contain a lot less information. They mainly contain player actions, i.e. you don't even know when a marine died -- the game has to literally be replayed to get that information.
Re: Show HN: A nom parser for the Starcraft 2 Protocol Replay format
#7I've also been impressed with the amount of data in SC2 replay files given the size, although I'm more interested in Broodwar (SC1) as a game. If I'm not mistaken Broodwar replay files contain a lot less information. They mainly contain player actions, i.e. you don't even know when a marine died -- the game has to literally be replayed to get that information.
Re: Show HN: A nom parser for the Starcraft 2 Protocol Replay format
#8Earlier quoted context omitted.
It's a pretty handy way to parse any sequence of things in Rust! I'm using it to write a compiler for a toy language and it's been a delight
Could you share the repo? I've been curious what nontrivial parsers look like woth nom, I always lose the overview pretty quickly.
The DSL supports comparison operators, '&&', '||' and nested expressions, while preventing mixing of '&&' and '||' without making precedence clear using parentheses. This DSL should fit 'non-trivial', but it still should be simple enough to easily understand it.
Re: Show HN: A nom parser for the Starcraft 2 Protocol Replay format
#9I may be the only one not familiar, but nom refers to https://github.com/rust-bakery/nom which looks like a pretty handy way to parse binary data in Rust.
Re: Show HN: A nom parser for the Starcraft 2 Protocol Replay format
#10I've also been impressed with the amount of data in SC2 replay files given the size, although I'm more interested in Broodwar (SC1) as a game. If I'm not mistaken Broodwar replay files contain a lot less information. They mainly contain player actions, i.e. you don't even know when a marine died -- the game has to literally be replayed to get that information.
The Broodwar replays were really cursed -- I remember that hilarious (perfectly reproducable) bugs of quickly replaying a game which resulted in a completely different replay then the actual game, apparently because the replay missed to integrate all replay information correctly and ended up in a different game state.