Earlier quoted context omitted.
Can you change the current working directory? If not, it's not a shell script.
Of course you can. How do you think `cd` utility is implemented?
Amber the programming language compiled to Bash/Ksh/Zsh
61–70 of 72 posts
Re: Amber the programming language compiled to Bash/Ksh/Zsh
#62Earlier quoted context omitted.
Or Perl. Or Python. How many environments have only bash and not awk, perl, or python?
For small stuff I use bash / sed / awk / jq / yq / curl etc. I stopped using perl (a long time ago) and hate trying to build or distribute anything in Python. "You asked for a script! I give you... a venv, a pip install, woops need to compile something, so let's install build tools. Actually let's get github actions set up to handle this, or would you prefer a Docker image? Do you have a registry so I can share the i…
Try it out :)
uv init uv add XXX uv run main.py
( You can pin python versions and auto install them etc )
Re: Amber the programming language compiled to Bash/Ksh/Zsh
#63Second, just why?
Re: Amber the programming language compiled to Bash/Ksh/Zsh
#64Earlier quoted context omitted.
Bash is great for orchestrating other Unix tools into an automated workflow. Only when that workflow requires stuff that Bash doesn't have is it time to break out Python. Integrate Shellcheck into your editor, and you get automated help for writing more reliable Bash.
ShellCheck is like a spaz hall monitor, filling my editor with useless warnings about what it believes are best practices. I thank my stars I mostly write shell scripts in zsh which it doesn't support.
Re: Amber the programming language compiled to Bash/Ksh/Zsh
#65Earlier quoted context omitted.
Or Perl. Or Python. How many environments have only bash and not awk, perl, or python?
For small stuff I use bash / sed / awk / jq / yq / curl etc. I stopped using perl (a long time ago) and hate trying to build or distribute anything in Python. "You asked for a script! I give you... a venv, a pip install, woops need to compile something, so let's install build tools. Actually let's get github actions set up to handle this, or would you prefer a Docker image? Do you have a registry so I can share the i…
Re: Amber the programming language compiled to Bash/Ksh/Zsh
#66Earlier quoted context omitted.
Regardless of where it’s deployed I can edit it and run it without any additional tools.
So does an amber script after it's been compiled, that's the whole point. You can tweak it and inspect it if you want. Realistically though you'll probably regenerate it and copy the new compiled version over. But you can do both.
Re: Amber the programming language compiled to Bash/Ksh/Zsh
#67Any language is a shell script if you're brave enough: https://en.wikipedia.org/wiki/Shebang_%28Unix%29
Can go one step further and define a custom binfmt like was done here https://blog.cloudflare.com/using-go-as-a-scripting-language...
Re: Amber the programming language compiled to Bash/Ksh/Zsh
#681. From the docs: "In the the project it is production ready because it is already used in this context because the shell code generated is tested and confirmed that works, the language is evolving with the tooling set." Hmm... 2. Support Fish too. Having one language that can generate zsh (macOS default), Fish (power users default), and bash would be really nice!
About Fish we are planning to support more bash subset but we aren't so much in the team to focus in everything. Right now the priority is to adds more stuff to the language in a way we can stabilize it and implement the other "output" target later.
About the production ready the Bash code is tested, shellchecked tested (we are not at 100% yet) and works but is an alpha because we are working in the syntax.
Re: Amber the programming language compiled to Bash/Ksh/Zsh
#69Earlier quoted context omitted.
The only thing I can think of is if you have an existing system you are integrating with thats implemented in shell script already - for example a packaging or build pack system; but I can’t really see how this could be justified even there because this could easily be a toy that becomes abandoned.
A really common use case is install/bootstrap/setup scripts. You know, those sketchy curl-to-bash things, or cloud-init scripts, or whatever you run to set up your actual higher level tools like Python.
As said there are use cases where you want to use only bash because you can't install scripting languages with their dependences as example.
As usual there is a tool for any user cases and Amber resolves some of them :-)
Re: Amber the programming language compiled to Bash/Ksh/Zsh
#70How does it achieve memory safety? Via garbage collection? Via runtime checks? Via some clever compile-time analysis?
Right now we check the bash output with Shellcheck but we are not yet full valid and we test it for performances.
About security right now we are just avoiding evail and this kind of things, we are focusing right now on stabilizing the language itself.