6 ms·
Looks nice but wouldn't you just use something like Python nowadays?
by zwieback 10y ago
Looks nice but wouldn't you just use something like Python nowadays?
- thoth 10y agoThe "Why not Python/Ruby/Node.js/Lua" section lists 3 reasons the author developed this language...
- sigjuice 10y agoBullet 1 says "None of them is preinstalled on all platforms", but OPAM isn't universally preinstalled either.
- recursive 10y agoYou can build your scripts to a machine that has OPAM and distribute them to one that doesn't.
- merb 10y agoOPAM is only needed on the computer you develop the script. Actually you guys shouldn't be so lazy to just write something without reading the README.
- ake1 10y agobut you don't need opam to run the compiled scripts...
- hk__2 10y agoThe second point says “Functionalities like process piping are not convenient to use” but Batsh itself doesn’t support piping [1], a core feature of shell languages. [1]: https://github.com/BYVoid/Batsh/issues/17 https://github.com/BYVoid/Batsh/issues/17
- onecooldev24 10y agoI don't think windows comes with python installation.
- Jach 10y agoIt 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.
- scott_s 10y agoI 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.
- Jach 10y agoI get it, I just disagree with "it's not bundled" as a major disadvantage: neither is your script, and maybe neither is your argument to any `call()`, so you're going to be thinking about deployment in any case.
- catmanjan 10y agoCould be a great tool for government/enterprise customers who want to avoid the whitelisting process involved around getting anything installed. IT departments would laugh at you if you said you wanted to install python on their server...
- Jach 10y agoSure, there are probably use cases, though I'm biased to think there are better options for any specific one except perhaps the project creator's inspiring situation. IT can laugh, I laugh back when java/flash/excel/browsers are already installed.
- milcron 10y agoWindows has knock-off versions of several unix tools: grep = findstr cat = type which = where sort = sort more = more sudo = runas
- deleted 10y ago[deleted]
- dahart 10y agoI 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.
- moondev 10y agoBut 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 http://hplgit.github.io/edu/ostasks/._ostasks002.html
- dahart 10y agoYes, you're right. Batsh isn't trying to be a shell replacement, but it is targeting the two shells that you're nearly guaranteed to find one of on any given computer. 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.
- TillE 10y agoPerl is probably still the best in its class of being a decent language while allowing close interaction with shell commands. If I really needed to write a sophisticated shell script (try to avoid that), I'd probably go for Perl.
- 10y ago
- kazinator 10y agoWhat if you want to build Python? 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.
- MichaelBurge 10y agoWriting your language's build system in itself shouldn't be any worse than writing your language's compiler in itself. The GHC folks are rewriting their jungle of recursive Makefiles in Shake, a Haskell-based build system. I think you only need the ability to build a cross compiler for this to work.