In general you shouldn't worry about "idiomatic way", Nim doesn't have an
"official way" of doing things. Each technique is more suitable for a
particular set of problem. Handling the freedom that Nim gives you is not a
matter of learning Nim, but a matter of learning programming concepts in
general.
Nim is awesome because it allows you to apply programming concepts with as
little hassle as possible. If you want strict guidelines about how to do
things, then Nim is not a good choice (for example Rust follows this
philosophy).
> idiomatic way of composing objects and structure the code in Nim.
Specifically for structuring data, I have one advice: you use tuples instead of
objects whenever you don't need the extra features that objects provide.
type
MyType1 = tuple
a: int
b: float
MyType2 = tuple
a: MyType1
b: MyType1
Run