From de9862a987ef1c4749a53afd23f872d522d32b56 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 6 Dec 2023 12:21:06 -0600 Subject: [PATCH] fix: Cover required vs optional shebang --- text/3503-frontmatter.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/text/3503-frontmatter.md b/text/3503-frontmatter.md index 01cf34a37..d07fdacfd 100644 --- a/text/3503-frontmatter.md +++ b/text/3503-frontmatter.md @@ -109,6 +109,18 @@ Like with Python, this allows any file in a package (with the correct deps and ` As for the hard-coded infostring used by cargo, that is a decision for [RFC 3502]. +## Required vs Optional Shebang + +We could require the shebang to be present for all cargo-scripts. +This would most negatively impact Windows users as the shebang is a no-op. +We still care about Windows because cargo-scripts can still be used for exploration and prototyping, +even if they can't directly be used as drop-in utilities. + +The main reason to require a shebang is to positively identify the associated "interpreter". +However, statically analyzing a shebang is [complicated](https://stackoverflow.com/questions/38059830/how-does-perl-avoid-shebang-loops) +and we are wanting to avoid it in the core workflow. +This isn't to say that tools like rust-analyzer might choose to require it to help their workflow. + ## Syntax [RFC 3502] lays out some design principles, including