A language that compiles to Bash and Windows Batch
141–148 of 148 posts
Re: A language that compiles to Bash and Windows Batch
#142Earlier quoted context omitted.
Fresh machine where and for whom? I doubt a simple batch script will get you very far (setup.exe exists for a reason...), and I doubly-doubt you would have enough overlap in the process that something that can convert the steps to bash would be an advantage. The only advantage I see for batsh is that it looks nicer to write in for the tiny subset of batch it supports. But then so is pretty much anything else -- it wo…
Ok, I'll try another use case: Political differences (specifically licensing). This project appears to be licensed under MIT, and python appears to be licensed under !MIT. I don't know what the implications are for the licensing of machine-produced shell code, or binary versions of Python, but I'm sure there are companies out there that would have opinions to favour one alternative over the other for reasons other th…
Re: A language that compiles to Bash and Windows Batch
#143Earlier quoted context omitted.
PowerShell took everything that was great about .NET and combined it with everything that was terrible about Bash. So we have, yet again, a difficult to understand language for shell scripting.
Why is it bad? I've been able to write some pretty great PS scripts to automate tasks. It's easier than firing up Visual Studio and writing a C# program I'd need to recompile if I ever want to change it.
If ($Number -gt 0)
That's just one example. There is a lot of really confusing stuff in powershell that's entirely unnecessary. There were going for some kind of Bash-shell familiarity which, oddly enough, most Windows developers don't even have.Re: A language that compiles to Bash and Windows Batch
#144Earlier quoted context omitted.
Most of my big complaints about syntax are related to the shell-ness of PowerShell. For example, when comparing things, I really want to use ' ' rather than -le and -gt. Generally though, the syntax is different but once you learn it, it's mostly fine and sometimes the text-based nature of Unix commands means you have to do a lot more reg-exing. For example, compare these two: ps -ef | grep "chrome" | awk '{print $2}…
Um... pkill chrome, still prefer bash/gnu tools. The bazaar has far more tools, you just have to find the right one. > and sometimes the text-based nature of Unix commands means you have to do a lot more reg-exing. That's a feature that has far more upside than downside.
My point still stands. They are different but (IMHO) both excellent. Ubuntu on Windows may eventually reach parity with PowerShell but until then, PowerShell is worth knowing (especially if you follow Microsoft's advice and run servers without the GUI installed).
Re: A language that compiles to Bash and Windows Batch
#145Earlier quoted context omitted.
Um... pkill chrome, still prefer bash/gnu tools. The bazaar has far more tools, you just have to find the right one. > and sometimes the text-based nature of Unix commands means you have to do a lot more reg-exing. That's a feature that has far more upside than downside.
I didn't know about pkill, thanks! My point still stands. They are different but (IMHO) both excellent. Ubuntu on Windows may eventually reach parity with PowerShell but until then, PowerShell is worth knowing (especially if you follow Microsoft's advice and run servers without the GUI installed).
Re: A language that compiles to Bash and Windows Batch
#146Earlier quoted context omitted.
Why is it bad? I've been able to write some pretty great PS scripts to automate tasks. It's easier than firing up Visual Studio and writing a C# program I'd need to recompile if I ever want to change it.
It's very powerful but the syntax is step back 20 years: If ($Number -gt 0) That's just one example. There is a lot of really confusing stuff in powershell that's entirely unnecessary. There were going for some kind of Bash-shell familiarity which, oddly enough, most Windows developers don't even have.
Re: A language that compiles to Bash and Windows Batch
#147Earlier quoted context omitted.
It's very powerful but the syntax is step back 20 years: If ($Number -gt 0) That's just one example. There is a lot of really confusing stuff in powershell that's entirely unnecessary. There were going for some kind of Bash-shell familiarity which, oddly enough, most Windows developers don't even have.
I'd say the usage of -lt and the like is because angle brackets are used for piping data.
Re: A language that compiles to Bash and Windows Batch
#148Earlier quoted context omitted.
The attraction for me is not about portability, it's about having a better language to write CMD script. Even when you know you have Python available sometimes you still need to glue things together with CMD.
These days you probably want Windows Powershell. It's built on the .NET framework so it's pretty darn powerful and AFAIK is available by default on every modern WinOS.