3 ms·
Would love to be able to transpile zsh or any other higher level scripting language into Bash for portability reasons alone. Is there something that converts ba
by pmarreck 5y ago
Would love to be able to transpile zsh or any other higher level scripting language into Bash for portability reasons alone. Is there something that converts bash, sh, or zsh into an AST?
Also useful would be a tool that tells me if I'm using a zsh construct that isn't supported in bash... or even better, how to do it in bash
- arp242 5y agoThe shfmt parser seems re-usable: https://github.com/mvdan/sh https://github.com/mvdan/sh (syntax subpackage).
- kej 5y agoNot really what you're asking for, but a language that compiles to bash for portability reminded me of Batsh [0], a C-like language that compiles to bash for Linux/Mac and batch for Windows. [0] https://github.com/batsh-dev-team/Batsh https://github.com/batsh-dev-team/Batsh