Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There's, unfortunately, a million similar implementations for this basic concept. 010 Binary Templates, Hex Workshop structures, Okteta structures, Kaitai Struct Definitions. Heck, I made my own Go struct tag DSL that does this, before I realized just how many times it had already been done before.

The thing that's complicated of course, is that while it is a good idea and the basic idea is incredibly similar across implementations, there are just enough different concerns to make it hard to have one universal standard that can cover all of the use cases. It's hard enough to have a single parsing framework that handles both text parsing and binary format parsing well, but you also would need to consider the ability to incrementally parse/stream, read/write support, support arbitrary transformations, some formats need pointers, offsets, indices, and of course to what degree such a descriptor should be declarative versus imperative (declarative is better, but it gets increasingly hard to capture all details entirely in a purely declarative manner.)



^ Insightful!

I too have been working in this space for a while. Then I found out about kaitai stuct, lost some steam but regrouped. I do have some novel ideas and my dsl is less verbose than theirs :)

I have a DSL in go with cli tooling at https://github.com/martinlindhe/feng/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: