Conversation

Jarkko Sakkinen

Edited 5 days ago
tpm2-protocol is the first thing i've done with Rust which would not be existentially possible achieve without some of the Rust features.

With TPM protocol shenanigans people tend to go generation path because writing all data types manually would be ridiculous amount of work.

By creating DSL with macros, "ridiculous" factored down to "huge" but only for the initial pass i.e., to reach the current TCG standard version. And given that I have now efficient DSL, keeping the implementation up to date is almost cost-free. And since none of the compiled code is a generation artifact, it is easy to "shift away" in selected places, and write down traits manually.
1
1
1

@jarkko any tips how to make DSL with macros? Guides? Tutorials?

1
0
0

Jarkko Sakkinen

Edited 5 days ago
@amackif for this i just read the Rust documentation and for TCG specs I have 11 years familiarity so it's then it was just basically synthesis of those. As the word is defined you need to have a deep understanding of the domain really. From that angle, it is also impossible question to give any correct answer.
0
0
0