You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use distinct naming patterns to differentiate its stable external API from unstable implementation details
avoid mutating the global environment in ways that will affect other active modules
consider whether consumers will need enough control to defer or repeat initialization work
run its test suite under a matrix of shell options to ensure compatibility with common modes
I think ideally there'd be a communal set of definitions for the modes to test for a given shell, given the modes the script does use
document restrictions and preconditions (such as required or incompatible shell options)
informal at first, but I imagine this would mature into machine-readable declarations (I don't think it's a good idea to set out trying to lay down the one-true-format before we understand what helps? This may also emerge somewhat naturally as the Nix toolchain matures?)
adapt to different shells or dependencies at build-time (instead of with hard-to-analyze runtime dynamism) when possible
if you must do it at runtime, avoid mixing unique syntactical idioms for multiple shells (there's a tolerable chance they'll render the script unparseable)
minimize defensive run-time skepticism of builtins and the environment (ex: refusing to run if the PATH looks weird, type-checking builtins, always using \command)
these make it harder for consumers/tooling to tweak behavior as needed
defensively using them everywhere makes it harder to pick out essential cases
I imagine it would be better to have tooling for surfacing and triaging conflicts here at build time.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
For now this just expands a little on what was in my blog post neighborly shell with bashup.events (I had a few thoughts that I left out of the post):
Neighborly shell should probably tend to:
\command
)Beta Was this translation helpful? Give feedback.
All reactions