wuffs icon indicating copy to clipboard operation
wuffs copied to clipboard

want to add encoding as well?

Open c0b opened this issue 6 years ago • 3 comments

safe decoding is important however is limited, the puffs is designed elegant I admit and want to use in decoding some proprietary binary format, but to occasionally to write in such format is also a need, would you like to support encoding eventually? to make the cost of learning a different language more of worthy?

https://github.com/google/puffs/blob/master/std/gif/decode_lzw.puffs for example, would you make some code generator support encoding functions to enable write gif files in lzw compression?

c0b avatar Nov 23 '17 00:11 c0b

Another motivating example for this: I just implemented pieces of BGP in Go for a project of mine. Since I'm speaking BGP to someone else, I need both parsing and serialization.

BGP is not the world's hardest protocol to parse. It's mostly basic types and TLV-encoded arrays. However, it's evolved over 20 years and a dozen or more RFCs, and as such has picked up a number of subtleties that tripped me up while implementing. Fuzz testing was very helpful, but there's a limited corpus of BGP pcaps out there, so I don't have much faith that my fuzzer is covering useful ground.

This seems like a good use case for puffs, but parsing alone is not that useful.

danderson avatar Nov 25 '17 22:11 danderson

Yes, I absolutely want to support encoding eventually, and e.g. encoding JPEGs and PNGs are already in the doc/roadmap.md file. It just hasn't been the highest priority thing to work on so far.

Sorry if the "Parsing" name suggested otherwise. In any case, I'm probably going to change the name: https://groups.google.com/d/topic/puffslang/cSrH-s7UqwA/discussion

nigeltao avatar Nov 27 '17 22:11 nigeltao

If I get to learn how I will soon

Dawane9729 avatar Nov 28 '17 21:11 Dawane9729