> Typescript to bash Literally the worst of both worlds.
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.
Amber the programming language compiled to Bash/Ksh/Zsh
41–50 of 72 posts
Re: Amber the programming language compiled to Bash/Ksh/Zsh
#42Re: Amber the programming language compiled to Bash/Ksh/Zsh
#43Earlier quoted context omitted.
Exactly #!/usr/bin/tcc -run #include int main(int argc, char **argv) { printf("Hello from C!\n"); for (int i = 1; i And ready is your cscript :) $ chmod u+x cscript && ./cscript hello world Hello from C! argument 1: hello argument 2: world (I can't even articulate why I love it so much that this works)
Can you change the current working directory? If not, it's not a shell script.
Re: Amber the programming language compiled to Bash/Ksh/Zsh
#44In a world where AI can generate any code for any environment, is there a need for another language? On the other hand, we're at a point for a binary language (or standard / framework) that one AI/LLM creates and another one validates. What are we missing?
> is there a need for another language? If you know of a language that is perfect for all our needs today and tomorrow, please guide us to it. > What are we missing? Major concerns would be i) trust in the tooling, ii) quality and accountability, iii) future investment in competent engineering.
Re: Amber the programming language compiled to Bash/Ksh/Zsh
#45In a world where AI can generate any code for any environment, is there a need for another language? On the other hand, we're at a point for a binary language (or standard / framework) that one AI/LLM creates and another one validates. What are we missing?
Do we really want to stop evolving the space of languages (and libraries and frameworks while we're at it) just because we have LLM's writing code now? If LLM's were truly smart, they'd argue with us that we should stop asking them to write bash code, because it's a shitty error-prone language. True intelligence should be skeptical of itself and not take any request as a requirement.
Re: Amber the programming language compiled to Bash/Ksh/Zsh
#46This looks great. We have a lot of bash tools because it's the only stable interpreter that we have readily available on all our systems. But bash is a pain to write so this might actually make things easier.
Re: Amber the programming language compiled to Bash/Ksh/Zsh
#47Earlier quoted context omitted.
Presumably you can call chdir(2) from the C code? Or did you mean change the directory of the calling shell (in which case, executable shell scripts written in Bash and friends can’t do that either).
Well, you can "source" a script, so its effects persist in your current shell session. That's a feature of the script and your shell sharing the same language.
Re: Amber the programming language compiled to Bash/Ksh/Zsh
#48In a world where AI can generate any code for any environment, is there a need for another language? On the other hand, we're at a point for a binary language (or standard / framework) that one AI/LLM creates and another one validates. What are we missing?
This is not something we're advocating, instead talking the reality from observing across the industry.
Re: Amber the programming language compiled to Bash/Ksh/Zsh
#49Hm... But why not use Python
Because it's not preinstalled on every machine. Bash is a good target for portability reasons, but it's a shitty language to write in. If ever I get in the position again to have to write some bash, like for an installer or so, I'm going to be looking into Amber again.
Re: Amber the programming language compiled to Bash/Ksh/Zsh
#50unclear use case imo - this sacrifices the ergonomics of actual bash scripting, and hides it behind another language If your script is complex enough to need a higher level language you might as well just switch to python
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.