Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't use windows much anymore so there might be a better way to do this, but I'll propose a use case: Automating the installation of python on a fresh machine.


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 wouldn't surprise me if someone has already written a DSL in a well known language that can output to batch or powershell, we don't need a whole new language for this.


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 than the technical merits of the choice.


Maybe. Python is under an MIT-like license, so you're fine, but if it were under e.g. the GPL you could still look to see if they have some form of runtime exception as GCC does. In any case it's rare for a company that's not well-established to care more about licensing that technical merit (and even any that do, the typical approach is to ask to buy a separate license if possible), and it's also rare that a company would use such a tool as this (created as a hackday project, in Ocaml, according to the author) rather than finding an alternative that meets their licensing criteria or just developing it in-house since it's not that big a tool and lacks a lot of useful capabilities like piping.


In that case you would use the chocolatey package manager bootstrapped by powershell to silently install Python.

It's a oneliner in powershell followed by choco install Python.


How are you going to install batsh though?


you don't need to install batsh. you maintain your code in batsh, compile to bat and have that up on your page as a download.


Even if you did distribute bat files online Windows would block downloading or running them by default so they are not a useful method.


Or, if you have developers, some on Windows and some on *nix, check in the batsh and its outputs.


You generate bat and sh files during the build, like deb or exe files.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: