Javascript, despite a few ugly gotchas, is an elegant language with a few simple rules that allow for an impressive degree of freedom and flexibility.
You just described Forth, and a good portion of Lisp. Both of which are great, groundbreaking, and productive languages.
> an elegant language with a few simple rules that allow for an impressive degree of freedom and flexibility
Very eloquently said. However, compared to other dynamic languages like Lisp, Perl, Ruby, and Python, it doesn't strike me as particularly free or flexible. The ability to create and use DSLs directly within those languages really displays true flexibility and freedom, IMO.
Of course, you don't always want unlimited flexibility and freedom in a language; it's why a particular type-safe languages with a very restrictive borrow checker is so popular.
Admittedly, JS doesn't have operator overloading, but I personally think that's a good thing.
i.e.
describe file("foo") do
it { should exist }
it { should be_owned_by "root" }
end
vs. _.map(["a"], function(s) {alert(s)}) describe("something", () => {
it(should(exist))
it(should(be_owned_by, "root"))
});
Also _.map(["a"], s => alert(s))
Or just _.map(["a"], alert)Also, when you use only one function of lodash, you can't call it a language, but there are chains and flows for creating powerful pipelines for collection processing.
We could by analogy apply this argument to adding integers and floats together. It's more convenient to use the + operator for that, but someone could argue that an add() function is just a minor inconvenience, so why bother overloading the + operator?
That is until you have to use it hundreds of times.
JS is my favorite language, hands down... C# is a close second, and that's as much for the tooling as the language, though the p/invoke and native interfaces are pretty awesome. After that, there's some functional languages I like, and have been looking for a reason to use Rust or Go for something... beyond that, most languages have a lot of their own warts.
Perhaps not a bad language, but I do think it falls into the same category as PHP - just good enough.
It's just good enough to do what we want it to do, and given the lack of choice, we're willing and ready to pile abstraction upon abstraction upon it to try and reduce the pain involved with getting work done.
And like masochists, we look at the results and go "Well, that didn't hurt too bad this time, so I'm willing to go do it again."