Earlier quoted context omitted.
My personal threshold for upgrading from shell to Python is about "I need an if statement".
Yeah I've seen that Python code. Every other line is a call to os.system('...').
Why Create a New Unix Shell?
231–240 of 298 posts
Re: Why Create a New Unix Shell?
#232Earlier quoted context omitted.
It's an entrenched network effect. There's a lot of existing scripts written targeting POSIX shells, and there's an incentive to have all your distro maintenance scripts written in one language if possible. If you want to switch your existing distro scripts to fish, you need to rewrite a lot of stuff. If you want to start a new distro, "it's written in fish!" isn't a terribly compelling selling point, since I don't t…
> I don't think anyone is actively picking distros based on their tooling language. I would use the crap out of a Linux distribution built in python.
Re: Why Create a New Unix Shell?
#233Lots of overlap in design goals with fish, except fish also places a premium on users interactively using the shell (which means friendlier in-repl experience but a balancing act when it comes to features). Fish’ auto completions are incredible, too. Best of luck to them. Another interesting shell to check out is elvish, lots of new ideas there (even if awkward to use). (Disclosure: I’m one of the core fish devs/main…
(author here) Hm I've tried fish, and it seems very nice for interactive use. However I don't see it being used AT ALL for the cloud/linux use case? Those are the cases where you tend to get 1000+ lines of shell scripts. For example, I mention Kubernetes/Docker/Chef, and I've never seen fish in that space. I also don't know of any Linux distro that uses fish as their foundation -- they all appear to use a POSIX shell…
Any time I have ever heard that, I've heard someone chime in "You shouldn't be using shell scripts for that."
Can you explain a use-case where long shell scripts are superior to a scripting language like Python?
p.s. I like that your language is statically typed.
Re: Why Create a New Unix Shell?
#234Earlier quoted context omitted.
yeah I can actually imagine that. like using an IDE based on the language it was written in to extend and tweak it more easily, or a window manager etc.. actually now you mentioned it, barring possible performance issues I'd also like a Python distro
IIRC, Python performance is better than than bash.
Re: Why Create a New Unix Shell?
#235Earlier quoted context omitted.
Bash is flat-out not a scripting language . It is a command language . It does not support typed variables, or named parameters, or any number of basic scripting language features. It technically does not even provide an 'if' construct. It's sufficient as a 'glue layer', and the Unix toolchain is nice, but it provides next to nothing in the way of abstraction, and that's liable to become a problem closer to the 1000…
This one gets it. What I want from an interactive shell is not what I want from a programming language.
Re: Why Create a New Unix Shell?
#236Earlier quoted context omitted.
I don't know if it's just me, but I don't feel like I'm using a computer when using Windows. After using OpenBSD exclusively for weeks (my laptop broke, so I had to repurpose an old netbook with OpenBSD), I felt bored and limited in Windows. I tried Powershell, but -mostly because I don't know much about it- it didn't give the same feeling. The thing that is working for me is to explore VB.net . It is really an inter…
you can turn windows into an adult computer by using cygwin (maybe mingw), autohotkey and something like window manager. the illusion is almost real, because sometimes i also run linux in vmware/docker/... and when i am not paying attention i forget easily which os i am on. the unix subsystem for win is quite boring as you can't mix windows applications with linux ones, for example running visual studio build from ba…
Re: Why Create a New Unix Shell?
#237Earlier quoted context omitted.
Back when I started programming, I wrote 1000+ lines of shell scripts. Now, I quite seriously believe that a 1000 line shell script only exists out of error. I still occasionally end up doing 2-300 line dense shell scripts, but not without feeling very dirty along the way. Either split into small, simple shell scripts (which is fine), or a different language. In the cross platform build pipeline at work, I keep a str…
> They must be short ( Well, the question is: what do you use as a replacement? For my scripts I tend to pull in some version of PHP as soon as needed. Perl is something that's universally available in anything based on Debian or Ubuntu, but it's a maintenance nightmare, and PHP doesn't care whether I use spaces, tabs or a mixture, or if there are due to any circumstances mixed line endings in a file whereas Python m…
Anyway, I usually avoid perl. While definitely a true programming language, I really don't like it. I find that it lacks clarity, and quickly collapses into bash-like hackery.
I personally use Python when it's a notch above shell, but not enough to pull out the big guns.
(I use to write a lot of perl when I was a kid, even made an accounting system in it, so my dislike of perl is from experience. We also had a 6000 line perl build script at my current job which was the last drop. Rewrote it to 40 lines of batch and 150 lines of Python. Likewise, I also wrote a lot of PHP, and can no longer consider it a proper programming language.)
Re: Why Create a New Unix Shell?
#238Earlier quoted context omitted.
It's an entrenched network effect. There's a lot of existing scripts written targeting POSIX shells, and there's an incentive to have all your distro maintenance scripts written in one language if possible. If you want to switch your existing distro scripts to fish, you need to rewrite a lot of stuff. If you want to start a new distro, "it's written in fish!" isn't a terribly compelling selling point, since I don't t…
> I don't think anyone is actively picking distros based on their tooling language. I would use the crap out of a Linux distribution built in python.
Re: Why Create a New Unix Shell?
#239Earlier quoted context omitted.
Yeah I've seen that Python code. Every other line is a call to os.system('...').
Every other line of my code is check_call. Could you expand on the issue you're observing?
Re: Why Create a New Unix Shell?
#240Earlier quoted context omitted.
Yeah I've seen that Python code. Every other line is a call to os.system('...').
You say that like it's a bad thing. Bash does not support niceties like typed variables, named parameters, or classes. Its conditional operator is an external program with a required last argument to make it look like sane syntax. Little things like interpolating variables, array access, or taking command line options are awkward and prone to failure. It doesn't have the insane syntactical issues that csh had, and PO…
echo "${myArray[2]}"
Bash is weird.