-
-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
In this comment @mpiannucci said:
I... was going to codegen [a Rust implementation of the GRIB code tables] but never had the time
We could use this issue to capture some ideas & design requirements for the codegen. I'll get started below but please shout if I'm off track 🙂.
Input to the codegen
GDAL's CSV representation of the GRIB tables
. The README for that directory is here: gdal/frmts/grib/degrib/README.TXT
Output from the codegen
Rust code!
- Rust Enums which represent the GRIB code tables.
- Make it super-easy and super-fast to look up the appropriate enum variant by generating the definitions for at least 2
phf::Map
s (perfect hash functions generated at compile time):- Map from abbreviation
String
to enum variant. This will be useful for parsing.idx
files (Add idx metadata file handling #41). - Map from numeric GRIB code to enum variant.
- Map from abbreviation
Questions
UPDATE: I've removed the questions for now because I'm working on a code sketch which I hope answers the main questions... I'll post a comment with the code sketch soon...
Development timeline
Hopefully I'll be able to help write the PR which implements this in a few months... But, of course, I'm more than happy for other people to do it!
Related
- "Introduction to Code Generation in Rust" by Chip Reed at CrabNebula, November 2023. (Discusses very useful crates for us:
quote
,walkdir
, andphf
)
Metadata
Metadata
Assignees
Labels
No labels