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
300 million machines still on XP guys..
Batsh – A language that compiles to Bash and Windows Batch
51–60 of 130 posts
Re: Batsh – A language that compiles to Bash and Windows Batch
#52I 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.
But I'm guessing you don't really notice the performance difference, you just feel the weight of unused features.
Re: Batsh – A language that compiles to Bash and Windows Batch
#53I would have preferred a bash/powershell solution. Hoping no one is still writing batch files on windows... even if he is still using xp
Re: Batsh – A language that compiles to Bash and Windows Batch
#542. I actually use UnxUtils in windows so I can has POSIX command option (and scripting). Performance-wise, never tested as not needed, all short command / simple script
Re: Batsh – A language that compiles to Bash and Windows Batch
#55Earlier quoted context omitted.
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.
I think it's really interesting the way programmers will use phrases like, "it feels heavy", as a way to describe using programs that contain unused features. I'm guilty of the same. Powershell "feels heavy" because it is a lot more sophisticated than batch, you can do all sorts of cool things with WMI or use data structures, but in the end, what does programming in batch actually gain you? If performance is such a p…
Re: Batsh – A language that compiles to Bash and Windows Batch
#56This implementation is not perfect, although it's interesting that it supports Windows. I personally don't care about that, but it brings the idea to create some sugary wrapper around Bash that allows you to use Bash v4 features such as associative arrays in Bash v3, and wrappers that allow functions to return arrays and other typical headaches.
Perhaps I should just master bash scripting once and for all (I know it's not that complex), but I generally find it unpleasant to do anything that requires control flow or traditional "programming language logic" in bash.
A simple way to bootstrap the compiler with the script itself would be especially nice. Basically, an embedded batsh compiler. Might be an interesting avenue for an enterprising person to look into.
Re: Batsh – A language that compiles to Bash and Windows Batch
#57Re: Batsh – A language that compiles to Bash and Windows Batch
#58Earlier 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…
PS> Set-ExecutionPolicy Unrestricted
It's the first line of just about every publicly-distributed script (including Chocolately, etc).Re: Batsh – A language that compiles to Bash and Windows Batch
#59Earlier quoted context omitted.
I reckon you don't, because it's not supported in windows batch. Sure it is: http://www.microsoft.com/resources/documentation/windows/xp/...
Only half-way; it doesn't stream the data, it waits for the first command to finish, saves the entire output, then starts the second command with output as input.