Are there any languages that compile to Bash?

后端 未结 8 1395
夕颜
夕颜 2021-01-30 02:13

I both love and hate writing Bash. I love that it\'s so streamlined for operating on files and working with processes (I agree with this popular question that it\'s way

8条回答
  •  面向向阳花
    2021-01-30 03:01

    The problem is that the whole strings-based semantics of Bash is so horribly broken, it'd be pretty difficult to do something like CoffeeScript for Bash.

    Since you probably don't need function-level interoperability to call functions that are written in Bash, you're better off using something entirely different. Perl is close to Bash in being nasty and full of shortcuts and weird syntax, but its semantics are mostly sound. Python is less comfortable for things such as launching processes but is far better for general systems programming, clean and easy to maintain. Python has great libraries and modules for everything; Perl even better.

提交回复
热议问题