amber-lang / amber-lang/amber

[Feature] Portable Shell Script

オープン
#1,039 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Rust
スター
5.2k
フォーク
145
平均マージ
5日 3時間
マージ済み PR(30日)
7

説明

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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。