natevw/struct-fu

Syntax [pack/unpack instead of bytesFromValue/valueFromBytes?]

Closed this issue · 1 comments

Would love to see this have the same syntax as restructjs. As restruct JS is now old.

Like pack or unpack to serialize or parse data.

Do you mean the chaining syntax or just the names of the conversion methods? The method names I'm not too happy about myself either and have considered/will consider alternatives; just haven't found anything "perfect" yet.

The chaining syntax I'm not terribly keen on (I like how fields are their own objects), and simply being "old" shouldn't be a knock against restructjs IMO.

I made struct-fu to try out some "quick" ideas already started in another context, ended up taking longer and being more fun than I thought, so now it exists and has grown as I needed more features … but by publishing it I didn't mean to imply the others that already existed were bad. I maybe could of and perhaps should have used one of them but I tend to enjoy any and all excuses to reinvent wheels (e.g. IIRC many didn't have bitfield support ;-). All that to say, happy you found struct-fu and I hope it can be useful to you, but OTOH if you like restructjs better please don't avoid it just because it's been "finished" (and proven/tested/debugged!) for longer time.

[leaving open since I am curious to hear your thoughts on what you do like best between the two libraries!]