Clone or download
Latest commit 8cbd123 Dec 28, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md Fix date Dec 5, 2018
out.html rebuild Nov 29, 2018
package.json ready for march? Mar 9, 2018
spec.html Update spec.html Nov 29, 2018

README.md

Hashbang Grammar

This proposal is to match de-facto usage in some CLI JS hosts that allow for Shebangs / Hashbang. Such hosts strip the hashbang in order to generate valid JS source texts before passing to JS engines currently. This would unify and standardize how that is done.

Example

#!/usr/bin/env node
// in the Script Goal
'use strict';
console.log(1);
#!/usr/bin/env node
// in the Module Goal
export {};
console.log(1);

Status

  • Stage: 3
  • Tests
  • Spec PR: TODO
  • Implementations shipping: None

Why Hashbang instead of Shebang

Hash is commonly associated with modern terms involving # such as hashtag. In addition for discoverability, the term "hash sign" is used for # but "she sign" is not.

Why only at the start of a Source Text

Hashbang directives are only valid at the start of a file for interpretters in various CLI environments. There is no gain for the intended usage by allowing it in other places and in fact could lead to confusion since it would not be picked up by CLI environments. Additionally by allowing Hashbang in other places it overlaps a grammar space for #! if it is an inifix binary expression of some kind. Use // if you want line comments elsewhere.

Existing Notes from Meetings