dart-lang / native

Dart packages related to FFI and native assets bundling.
BSD 3-Clause "New" or "Revised" License
115 stars 39 forks source link

☂️ Idiomatic conversions #612

Open HosseinYousefi opened 1 year ago

HosseinYousefi commented 1 year ago

More conversions that can make the code more idiomatic to Dart? Feel free to suggest.

mahesh-hegde commented 1 year ago

Overall this is similar to what most java serialization libraries do with getters / setters. (JSON, ORMs & DB drivers). They try to convert getters and setters into fields / columns.

I actually have a locally drafted proposal about better supporting such PoD (plain old data) types, but I think we are too early in the roadmap to discuss that feature.

mit-mit commented 7 months ago

Big +1 for doing the first two!

That would be similar to what Kotlin to Java interop does: https://kotlinlang.org/docs/java-interop.html#getters-and-setters

HosseinYousefi commented 7 months ago

Big +1 for doing the first two!

That would be similar to what Kotlin to Java interop does: https://kotlinlang.org/docs/java-interop.html#getters-and-setters

Kotlin is doing some other conversions for operators as well but the documentation is somewhat vague about it: https://kotlinlang.org/docs/java-interop.html#operators

For example list[i] turns into list.get(i), and so on... (Similar to the other proposed conversions in this issue).