I have idea for making rust more potable by clean architecture
i see we need to make the crates to four areas (io , pure_logic , adapters , main): the main: can only call the adapters and cant have the io operations the adapters: can only calls the pure_logic and io the pure_logic: can only call the the other pure_logic and cant have any target operations the io: can only do target operations like row pointers and system io and can be called only from adapters
this idea will make the code highly portable like make it work for linux and window and macos and ios and android and also playstation and xbox and embedded and wasm and any new target without the need for refactoring the code that mean all the crate will support that by default
i see the idea will worth because imagine with this we will enforce each developer to make his crate work on every target that mean we will not need of rewriting some crates just for portability , and if the crate don't have io layer for some target we can make it without rewrite the entire crate just to add this target
i think the easy way to do that is to add this to cargo.toml
[package]
layer = "pure_logic" # compiler enforces no io or adapter calls
or layer = "io" or any thing like that , because i think this will make the ecosystem better , and thank you
Discussion in the ATmosphere