Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'd love to see a little language which compiles to _readable_ bash. Could it be so hard? There's a dead project that comes up now and then called bish.

https://github.com/tdenniston/bish



Maybe this is a bit of a silly question, but what's the point?

I do think it would be a really fun project. But is there really a practical use for it? Bash is portable but not that portable if you want to care about version compatibility. I understand that it's not always possible to install a different interpreted language like Perl or Python. Maybe the use case is for platforms where you can't install other language interpreters and can't cross-compile a compiled language? It seems like a very specific situation.


One of my current hobby projects is a scripting language which compiles to POSIX sh (for maximum portability). However, it's far from complete, the output is not exactly readable and POSIX sh is so limited that I might need to change course and target something else.

EDIT: I didn't know of Bish, but from its code samples we seem to have converged on similar syntax :)


Not what you asked for but there is Babashka for scripting in Clojure.

https://github.com/babashka/babashka


Write the script in pseudo python and ask ChatGPT to convert it into bash but leave a lot of comments




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: