abstraction boundaries #1584
amitu
started this conversation in
Ideas & RFCs
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Read this interesting idea:
This is how I translate this in my head: should
ftd.*
functions be able to calldesign-system.*
functions? No. Shoulddesign-system.*
be able to call intofifthtry.ftd
(fifthtry website built usingdesign-system
)? Again, of course no.Now these no-s get enforced because
ftd
rust code does not have access todesign-system.*
, nordesign-system.*
have access tofifthtry.*
in the first place.But if you are working on larger projects, we tend to put everything in one big package, and things get dump, and obstructions at lower level technically has access to abstractions at higher level.
We can enforce this by breaking things into packages. But within the same package there are no abstraction boundaries, there is no concept of "hierarchy".
Should we have some such syntax? Like say letting a module labelled with some sort of hierarchy number, eg
fifthtry/lib.ftd
may have lower hierarchy number than rest of thefifthtry/*
, so the calls, imports are only allowed from higher to lower, and never lower to higher?Beta Was this translation helpful? Give feedback.
All reactions