Quote:
Originally Posted by
Koalaboration
Ah yes, I see some clarification is needed.
The BEST programming/script/anything language is:
1) Simple (i.e. only as complicated as absolutely necessary) (python is simple)
Depends on your point of view. Python is enormous(25 megabytes, at least), spread across jillions of tiny files(takes my system a few seconds to tally that size of 25 megabytes), and opens dozens of files to do absolutely nothing at all. BASH is tiny in comparison.
Python is of course capable of things bash can't do, so it's not a completely fair comparison, but the cost of a 'better' language can be tremendous.
Quote:
2) Intuitive; not necessarily easy to learn. (i.e. implemented logically, syntactically logical, semantically logical) (C is extremely syntactically logical, although semantically it can be a little cryptic)
BASIC's lack of symmetry always bugged me; "why can't I make a routine like PRINT that takes a variable number of arguments", "why can't I save PRINT's output in a variable", etc, etc, etc. C is almost perfect in this regard; C libraries are written in C, hence never have any "magic" syntax. It's very, very hard to make a design as smart as that.
Quote:
3) As good as BASH or TCSH (functionally speaking)
That's doable in just about any language. Functionally speaking, shells aren't that great as languages go except in a few key areas.
Quote:
BASH, while ubiquitous, powerful, and useful, is:
1) Unnecessarily complicated. Its like the English language. We think it simple, because we've learned it by rote, but anyone with an objective opinion (and therefore more valuable scientifically speaking) (i.e. a native non-English speaker) will tell you it makes little sense. Imagine how much faster infants would learn to speak if we used a language that was actually designed to be easy to learn ...
You've got us there. I blame history. They kept nailing features on the side without overhauling the language and now this mess is a
defined standard. You've got your single square brackets for doing a few kinds of comparisons via cryptic unguessable keywords, BASH's fancy double square brackets that were supposed to be their modern replacement but sane programmers avoid, your 'expr' builtin for numeric operations, your double-round-brackets
also for numeric operations, optionally with $ in case you felt like turning it into a string, your backticks for capturing output, and $(this) kind of construct
also for capturing program output... It's no unified whole.
On the other hand, I think its syntax for piping and redirection is about as good as can be expected.
Quote:
2) BASH's cryptic syntax make it look cool, but also make it esoteric, which is a terrible quality for any language to have, as it directly contradicts it purpose.
Well, how wordy do you want it? Shell scripting is one extreme, where the command to run a command is a single keystroke: enter. java might be the other, where you must dig through 9 levels of nested objects to find the system call you want.
Quote:
The PERFECT language would simple require to user to tell the computer what to do, and it would do it. Simple as that. However, BASH is an inadequate stopgap (it's not a good enough alternative in the meantime) Python is much closer, but it's a bit of a pain to write shell scripts in python.
Sometimes I wonder if shell scripts are even necessary, but they so often prove their use, that this though rarely lingers :P
To be honest, I was REALLY hoping someone would say:
"Hey, yeah, why don't you try TPSH (The Perfect Shell) ? Syntactically it's like python, but is semantically implemented via LISP and has features of both. The core functions basically form a wrapper for BASH while the rest incorporate other features like OOP and AOP and more!"
It's a nice thought. I've long wondered what a next-generation shell would look like. How radically can the shell be redesigned and still have
"cat foo bar | baz" do what it traditionally did? Traditional redirection's also a syntax I think should be kept. And of course interactivity. Comparisons and numerics should be built into one syntax like in C. A noninteractive language with several steps between writing and testing is a severe barrier to a novice programmer.