savi-lang / savi

A fast language for programmers who are passionate about their craft.
BSD 3-Clause "New" or "Revised" License
157 stars 12 forks source link

Add `:field_order` declaration for platform-specific field orders. #327

Closed jemc closed 2 years ago

jemc commented 2 years ago

This new declaration allows us to change the order of a type's fields during code generation on a specified platform.

For now the only specifiable platform for this is windows, with the "normal" field order being used for all other platforms.

This is not necessarily a great way to build out this language feature - in the long run it needs more thought and better generality. But for now this serves the needs of one very specific case where we need to use this in the IO library, so the feature is going in as-is for now and we'll reassess before v1.0.0.