Earlier quoted context omitted.
It also doesn't come with any of the tools bash is a glue for, about the only reason one uses bash. At least with Python I can write my own grep and so on, and piping isn't so bad with coroutines and generators.
I think you missed the point of this language. You write code in this language, and then you compile it to get Bash for Linux and Batch for Windows.
A language that compiles to Bash and Windows Batch
41–50 of 148 posts
Re: A language that compiles to Bash and Windows Batch
#42Re: A language that compiles to Bash and Windows Batch
#43Looks nice but wouldn't you just use something like Python nowadays?
Oh, that' easy, you unpack the Python sources and start with:
./configure
But what is that? It's not written in Python. It can't be, because you don't have Python yet. It's a shell script.It's not a hand-maintained shell script; it's written by expanding Autoconf macros (in the M4 preprocessing language) to shell code: essentially a compiler from another language to shell.
A cleaner language which does the same thing could, in principle, replace Autoconf.
A related use for such a language would be install scripts: perform complex actions to install some software, with minimal dependencies on what is already installed.
Re: A language that compiles to Bash and Windows Batch
#44Earlier quoted context omitted.
I love python, but python is not a shell, and it makes an absolutely awful shell replacement. Python is further from a good shell than bash is from being a decent programming language. Some scripts are good, I do use python for some kinds of shell scripts, but most of what I need bash for, python is not a good replacement at all.
But the goal of this is not shell replacement correct? It is a way to write scripts for both platforms. Python has great cross-platform support in that regard: http://hplgit.github.io/edu/ostasks/._ostasks002.html
I dunno if @zwieback was saying Batsh should target python, or if people should use python instead of Batsh, or something else, but neither of those first two suggestions makes a lot of sense to me.
Python's decent cross platform support doesn't really make it better for shell scripts, and while I use it for some shell scripts, I don't ever default to python. My comment was reacting to the "wouldn't you just", as though python is a natural default choice. In my experience, it's not a good default choice.
It's harder to debug python shell scripts, because you typically can't run individual lines, you typically can't cut and paste parts of it, you can't ever run system commands directly without wrapping it in a python module call, output might not display automatically, and you often have to install something that isn't already on the machine.
Re: A language that compiles to Bash and Windows Batch
#45Earlier quoted context omitted.
It's significantly better than batch
Well sure, but these days PowerShell is what Windows people use for anything non-trivial.
Re: A language that compiles to Bash and Windows Batch
#46Re: A language that compiles to Bash and Windows Batch
#47Earlier quoted context omitted.
It's significantly better than batch
Well sure, but these days PowerShell is what Windows people use for anything non-trivial.
Re: A language that compiles to Bash and Windows Batch
#48Re: A language that compiles to Bash and Windows Batch
#49Re: A language that compiles to Bash and Windows Batch
#50I've never tried but can't you already just run your node or ruby or whatever scripts on both Windows, Mac, Linux? Is there some reason targeting bash and batch is important?