4 ms·
I have worked on military communication software in Ada a few years ago. We had to encode and decode messages with a nested structure and irregular binary struc
by reacweb 14y ago
I have worked on military communication software in Ada a few years ago. We had to encode and decode messages with a nested structure and irregular binary structures. These binary format were very well specified.<br>
We have developed manually encoding/decoding of a couple of message types, then I have coded in perl a code generator. I can not give you the code (classified), but the structure was trivial:<br>
- first part: a copy of the format specification. Perl allows to have syntax very close to the structure of the specifications, reducing the risk of mistakes.<br>
- second part: reorganize these specification in data structures more adapted for code generation<br>
- third part: generate each source file.<br>
<br>
It has been very effective. Perl is ideal for generation of text files. Ada is very verbose. With the big number of messages, coding manually so many lines of code would introduce many bugs, hard to find.
<br><br>
The generated code was very clean, fast and easily tested. It has been developed very fast. The business logic was added via inheritance, as a result it was possible to update the generator and regenerate everything each time a missing feature or a defect was identified.
- dkersten 14y agoFYI - use two newlines to separate paragraphs. Eg "abc\n\ndef": abc def Other handy formatting: italics are done by placing * around the text indented text by putting two space characters before each line. Useful for code snippets and other preformatted text Or very long lines of text like this this this this this this this this this this this this this this this