Our great sponsors
-
dogma
Dogma: A modernized metalanguage with better expressiveness and binary grammar support (by kstenerud)
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
I made a grammar to tackle these sorts of problems when I had trouble writing formal grammar notations for my binary data format.
https://dogma-lang.org/
So far it's been able to describe 90% of what's out there. Some examples:
- 802.3 layer 2 Ethernet: https://github.com/kstenerud/dogma/blob/master/v1/examples/8...
- Microsoft ICO format: https://github.com/kstenerud/dogma/blob/master/v1/examples/i...
- Android Dex v39: https://github.com/kstenerud/dogma/blob/master/v1/examples/d...
- IPv4: https://github.com/kstenerud/dogma/blob/master/v1/examples/i...
- DNS query: https://github.com/kstenerud/dogma/blob/master/v1/examples/d...
- Microsoft Minidump: https://github.com/kstenerud/dogma/blob/master/v1/examples/m...
BinaryLang (for Nim) has similar features[1]. I've written a very compact ELF parser with it[2]. Notice that the last struct has array elements that skip over content based on offsets specified in the header.
[1] https://github.com/sealmove/binarylang
[2] https://github.com/khaledh/elfdump/blob/master/elfparse.nim
BinaryLang (for Nim) has similar features[1]. I've written a very compact ELF parser with it[2]. Notice that the last struct has array elements that skip over content based on offsets specified in the header.
[1] https://github.com/sealmove/binarylang
[2] https://github.com/khaledh/elfdump/blob/master/elfparse.nim
Related posts
- Show HN: Dogma: a metalanguage for describing data formats in documentation
- How Big Should a Programming Language Be?
- Show HN: Dogma Metalanguage – Beta5
- BNF Was Here: What Have We Done About the Unnecessary Notation Diversity (2011) [pdf]
- Ask HN: How long does it take for you to release your open source project?