Live data from Hacker News

Batsh – A language that compiles to Bash and Windows Batch

batsh.org

11–20 of 130 posts

Re: Batsh – A language that compiles to Bash and Windows Batch

#12
post #5

I would have preferred a bash/powershell solution. Hoping no one is still writing batch files on windows... even if he is still using xp

Totally agree. Powershell is what you need to use on windows. It's been available on the default server install since 2008 R2. No need for batch scripts anymore.

Re: Batsh – A language that compiles to Bash and Windows Batch

#13
post #11

I have to ask, why?

I posted it here to start a discussion not as an endorsement as we have all kinds of sugary compilers - for JavaScript and other languages, but none of Bash. Cross-platform support would be nice and as others have pointed out, PowerShell really took over Batch especially when Microsoft took care of the slow loading issue. I personally would rather have an extension of Bash rather than a brand new language, but that's me. In fact, I've been thinking of a simple preprocessor that even combines a bunch of scripts into a single one for easier distribution.

Re: Batsh – A language that compiles to Bash and Windows Batch

#18
This is great for me. As part of my day job I am often stuck writing batch scripts (yes, in 2014) for clients that refuse to run powershell. Writing a simple batch script is usually not a problem, but it can be very encumbering as the complexity increases.

Thank you for sharing.

Re: Batsh – A language that compiles to Bash and Windows Batch

#19
post #5

I would have preferred a bash/powershell solution. Hoping no one is still writing batch files on windows... even if he is still using xp

Agreed. Powershell has almost completely replaced batch scripts, and is actually a fairly pleasant language to work with.

b a shell for the win

Re: Batsh – A language that compiles to Bash and Windows Batch

#20

Love the idea of writing bash in a higher, easier to read format, similar to CoffeeScript. Unfortunately Batsh is written in OCaml (the author addresses why he uses it though). How do you use pipes in batsh?

I reckon you don't, because it's not supported in windows batch.

Just googled it. Doesn't seem to be supported yet: https://github.com/BYVoid/Batsh/issues/17

Post reply on HN