[Feature] Portable Shell Script
- Ngôn ngữ chính
- Rust
- Star
- 5.2k
- Fork
- 145
- Merge trung bình
- 5 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 7
Mô tả
Hello, first thank you for creating this awesome language.
I think Amber could help a broader audience if it had the option to produced only [Portable Shell Code](https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.72/html_node/Portable-Shell.html), personally I was looking for some alternative to [GNU autoconf](https://github.com/autotools-mirror/autoconf) which various **C** projects use to probe the operating system to find dependencies, test compilers, etc..
The issue with autoconf is that it adds a bunch of `.m4` files to the project, and require the developer to write an ugly [mix of shell with m4 macros](https://github.com/redox-os/binutils-gdb/blob/master/binutils/configure.ac) which by the end become a single ultra portable `configure` shell script.
The are other alternatives to autoconf, but usually requires extra dependencies in the system or aren't portable across different systems, while a shell script works out-of-the-box "almost" anywhere and doesn't requires any other dependency in the system.
Bash is not optimal for **MacOS** or **Windows** systems
- In MacOS the default shell is `zsh` (or a very old bash), which have some incompatible features to `bash`, and other things behaves differently than bash. Apple ships a pretty old bash for compatibility purposes, but because amber produces bash code, we cannot safely do `source` inside `.zshrc` for example.
- Other targets includes Windows [MSYS2](https://www.msys2.org/docs/what-is-msys2/) and WSL shells, etc.
While trying to get rid of autoconf I collected a few portable shell scripts examples here:
https://github.com/Lohann/shell-tools/tree/main/scripts
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.