Live data from Hacker News

Batsh – A language that compiles to Bash and Windows Batch

batsh.org

41–50 of 130 posts

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

#41

So I like the idea of a cleaner higher level version of BASH that still works like BASH but doesn't have the baggage of it's evolution. Key feature has to be output that is no less readable than the average bash script. Which it seems to be.

> Key feature has to be output that is no less readable than the average bash script. Which it seems to be.

So does smashing your head into the keyboard while holding the shift key.

I use bash but it's not a pretty language.

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

#44
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

For simple use cases I still use batch files as the performance is much greater. Powershell feels too heavy when I just want to run a build with some parameters and a couple of other commands.

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

#45
post #28

Earlier quoted context omitted.

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.

This sounds like you're saying that it suits your needs, therefore we should take that as meaning it fits our needs. Unfortunately, things are not that simple. I needed to do something and looked at using powershell, but in the end I couldn't just distribute it and have it work for whomever would be using my project. It needed to be signed or something. On the contrary, the bat script I wrote just worked and would ju…

There's a config switch to allow execution of scripts. I agree it's a complete pain (literally falling at the first hurdle), but it is a one-time thing change.

I had mixed opinions of powershell when I tried my hand at it. The naming convention and documentation system were well designed, piping objects is an interesting concept, and IDE support was great for a terminal (step through debugger, intelligent auto complete). Despite this, there were numerous quirks and ugly spots that diminished the experience. I felt it was a missed opportunity. This was powershell 3, I can't speak for later versions

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

#47
post #37

There's no mention of error handling, which is what really makes Windows batch files completely hopeless for anything involving more than one or two commands. Being able to write code with exceptions and having it compiled to the corresponding mess of ERRORLEVEL and GOTO would be sweet! (I've switched to just writing everything in JavaScript for WSH. It's ECMAScript 3 and the API has some issues, but it's still a mil…

Ive leaned towards node.js for a couple years now in windows.. with edge.js I get about anything I could ask for....

You can also put a thin shim to launch node for the script in case it's in a wsh environment.

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

#48
I don't like the concept so much. They are their own languages, and I'd rather write very low level ansible primitives and build upon them than rely on a somewhat opaque translation process. Also, all automation I do going forward is PowerShell, not batch.

I could see a lot of places using it, though, so bravo for sharing.

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

#50

I don't like the concept so much. They are their own languages, and I'd rather write very low level ansible primitives and build upon them than rely on a somewhat opaque translation process. Also, all automation I do going forward is PowerShell, not batch. I could see a lot of places using it, though, so bravo for sharing.

Exactly, when the automation need arises just Batsh it.
Post reply on HN