Skip to content

Commit 9597be2

Browse files
committed
README: polish a few bits and add the main interpreter caveat
See #171.
1 parent 9093cb8 commit 9597be2

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ A shell parser, formatter, and interpreter. Supports [POSIX Shell], [Bash], and
88
### Quick start
99

1010
To parse shell scripts, inspect them, and print them out, see the [syntax
11-
examples](https://pkg.go.dev/mvdan.cc/sh/v3/syntax#pkg-examples).
11+
package examples](https://pkg.go.dev/mvdan.cc/sh/v3/syntax#pkg-examples).
1212

1313
For high-level operations like performing shell expansions on strings, see the
14-
[shell examples](https://pkg.go.dev/mvdan.cc/sh/v3/shell#pkg-examples).
14+
[shell package examples](https://pkg.go.dev/mvdan.cc/sh/v3/shell#pkg-examples).
1515

1616
### shfmt
1717

@@ -69,14 +69,21 @@ $ echo '$((foo); (bar))' | shfmt
6969
It is also required to support `declare foo=(bar)`.
7070
Note that this means expansions like `declare {a,b}=c` are not supported.
7171

72+
* The entire library is written in pure Go, which limits how closely the
73+
interpreter can follow POSIX Shell and Bash semantics.
74+
For example, Go does not support forking its own process, so subshells
75+
use a goroutine instead, meaning that real PIDs and file descriptors
76+
cannot be used directly.
77+
7278
### JavaScript
7379

7480
The parser and formatter are available as a third party npm package called [sh-syntax],
75-
which bundle a version of this library compiled to WASM.
81+
which bundles a version of this library compiled to WASM.
7682

7783
Previously, we maintained an npm package called [mvdan-sh] which used GopherJS
78-
to bundle a JS version of this library, but that npm package is now archived
84+
to bundle a JS version of this library. That npm package is now archived
7985
given its poor performance and GopherJS not being as actively developed.
86+
Any existing or new users should look at [sh-syntax] instead.
8087

8188
### Docker
8289

0 commit comments

Comments
 (0)