batsh-dev-team / Batsh

A language that compiles to Bash and Windows Batch
http://batsh.org
4.32k stars 169 forks source link

Enhancement: Write in bash and compile to batch, or vice-versa. #30

Open DrewMcArthur opened 10 years ago

DrewMcArthur commented 10 years ago

Currently, it is only possible to write using the C syntax. It would be great to be able to paste in a bash script I've written, and have it compiled as a batch file.

If it's possible to reverse engineer the compiling, it'd be easy to go bash -> current input (C) -> batch. The hardest part would be reversing the current compiler.

ygra commented 10 years ago

This post on HN asks the same and the first answer pretty much nails the problem with that approach.

BYVoid commented 10 years ago

I am afraid this could be a difficult job to reverse-compile bash to the C-syntax language. Be aware that the Batsh syntax does not cover all functionalities of Bash.

bhagyas commented 9 years ago

+1

johnwright commented 9 years ago

-1 this is in opposition to the entire purpose of Batsh.

dgtlrift commented 9 years ago

-1 - I think this defeats the purpose. By having a simplified language, the output generation is very predictable. There's just too much flexibility in either bash or batch to handle to concept of conversion from one to the other.