79734150

Date: 2025-08-13 10:00:57
Score: 1.5
Natty:
Report link

A number of answers are ridiculing the idea that it would be possible to translate Bash into Perl. These days we might use an LLM, but even back when the question was asked we had parsers. While translating every shell script might not be possible, most shell scripts have a traditional nested block structure without any weird self-modification or anything. These scripts could be parsed into an Abstract Syntax Tree which could then be used to generate Perl.

In one week I created Debashc 0.1.0 (De Bash Compiler). While still very much an experimental test of concept, I have got it to translate 49 simple bash example scripts covering a wide variety of bash features and helper commands frequently used by bash like grep. The translations produce the same output as the originals. The homepage of this project is https://github.com/gmatht/debashc and there is an online demo at https://dansted.org/Debashc6/.

Reasons:
  • Contains signature (1):
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: gmatht