This was one of the reasons.
In the late 70s, cheap computers (IMSAI, Altair) were almost unable to run Lisp for useful purposes. Too little memory.
Minicomputers (DEC PDP /etc) were able to run full Lisp implementations but it worked slower than using other languages.
Lisp Machines (MIT CONS, etc) were able to run Lisp fast but those were dedicated, specialized hardware. And expensive.
Enter the late 80s; Lisp ran great on personal computers but implementations AFAIK were mostly commercial, so reserved to big budgets. I'd say Common Lisp did have success on the industry, used for many things (3D, CAD/CAM, simulation, etc).
Meanwhile the rest of the world was on Pascal, C, and C++.
Nowadays things are different, there are many Common Lisp implementations that are free and are good (SBCL and CCL, for example, are lightning fast).
But additionally, it is difficult to understand what advantages would Lisp bring. For this, the developer would have to grok (completely understand) the enormous value of metaprogramming, and to understand as well how flexible is CLOS.
And I agree that things are different nowadays. My main point is that this seems pretty compelling evidence to me. But, what it isn't, is a testable hypothesis. (Is it?)
You'll see many people in such languages say things as "please don't use macros", "metaprogramming makes things difficult", "metaprogramming is hard", "macros make the code hard to read" and so on.
Metaprogramming in all other languages is usually difficult to implement OR is limited to text substitution (example: C), which makes them a mess!
Languages with true macros mean the code gets transformed to an AST first; your macro needs to transform this AST. Thus you need to learn a whole host of functions/methods/classes and to learn the structure of this AST.
While in Lisp, macros are written using plain regular Lisp. There is almost nothing new to learn, really. This is because the language is formed of s-expressions, which are really easy to manipulate. So doing metaprogramming is almost no more difficult than writing a regular function. In Lisp, metaprogramming is not an advanced topic; quite the opposite, is a beginners' topic.
If such "other languages" wanted to make metaprogramming easy, then the language would have to be written in s-expressions.
Which means the language would probably be labeled as a "Lisp dialect", or as a "Lisp-like language."
>other languages are adding advanced features all the time
Yes, but in Lisp you can add them yourself, you don't need to wait for Google or Oracle or your Benevolent-dictator-for-life to approve the features you need, and don't need to wait for the next version of the compiler.
So sorry, most languages don't have the features lisp has. Not even remotely close.
I think the concepts are great, and it's a great language for certain task, but my right pinky finger hurts just looking at it.
New programmers and developers look at that and compare it to something like Go, Python, or JavaScript, and all those look easier to write (although deceptively complex in places) and are 1000x easier to read.
A prettier lisp would do the world good, but things like sweet expressions are confusing for absolutely new devs to implement and veterans feel like they don't need them.
Short version: Lisp wallows in obscurity thanks to it's "look"
Are you sure?
Reading a file in Go
func read(f) {
var text string
var scanner *bufio.Scanner
var err error
file, err := os.Open(f)
if err != nil {
log.Fatal(err)
}
scanner = bufio.NewScanner(file)
for scanner.Scan() {
text += scanner.Text()
}
err = scanner.Err()
if err != nil {
log.Fatal(err)
}
fmt.Println(text)
}
in Common Lisp (defun read (filename)
(with-open-file (input filename)
(loop for line = (read-line input nil)
while line do (print line))))
Now tell me which one is easier to read. And the lisp example you can understand what it does without even knowing any kind of Lisp language; it is almost english.Perhaps a lisp with python-style indentation for blocks would be more easily read?
def read (filename)
with-open-file (input filename)
for line in (read-line input nil)
while line do
print lineGranted, the bike shedding that goes on in our industry is hilarious. I think many people blame semicolons as one of the major hurdles to learning c nowadays. The things we fixate on...
Secondly, parentheses are a non-issue in lisp. Its almost like reading english text with spaces. After a while(quite quickly in-fact) they are a total non issue.
>>New programmers and developers look at that and compare it to something like Go, Python, or JavaScript, and all those look easier to write
Arguably the biggest problem today is programmers who are stuck at early intermediate level all life.
> if the next line is indented, anything from the beginning of the current line starting at the indent till a dedent matching the current line indent is wrapped in one set of parentheses.
Seriously, what about this?
defmacro deftag [name]
list 'defn name ['& 'inner]
list 'str "<" (str name) ">"
'(apply str inner)
"</" (str name) ">"
deftag html
deftag body
deftag h1
deftag p
Now what about the DSL that now downright looks like slim-lang?: html
body
h1 "Hello World"
p "How's it going?"
Or look at that: defn qsort [coll]
if (empty? coll)
coll
let [pivot (first coll)
remainder (rest coll)]
concat
(qsort (filter (partial > pivot) remainder))
[pivot]
(qsort (filter (partial <= pivot) remainder))
(even the qsort ones could be removed, but they balance [pivot] somehow)I'm perfectly happy with writing (+ 1 2 3) or whatever, the only parentheses that bother me are those that are perfectly delineated by indentation already, just as newlines perform the same duty as semicolons. They're just duplicated noise††.
† Other languages perform similar semicolon insertion, with varying degrees of success and ambiguities (JS==terrible, Go==terrific).
†† I know, you're supposed to get used to it and "unsee" them. I know, "paredit!". But seriously if you have to write a tool solely to produce noise, and you have to get accustomed to ignore said noise, well, somehow, something's off.
Modern incarnations of the same like F# are attractive too.
But Lisp is what it is, List processing.
For example, see https://gist.github.com/coding4food/1248505
Part of this is because lisp tends to be more concise, so there are fewer expressions required. There are relatively few places where lisp adds parentheses, rather than just moving them - mostly just basic operator expressions: (+ a b) vs a + b. Adding parens (a + b) doesn't make it any harder to read.
For function calls, Algol-descended languages already use parentheses and prefix notation, they just put the parens around the arguments instead of the whole expression:
(function argument list)
vs function(argument, list)
Lisp didn't win because it used to cost money to get a good implementation, and there was no company throwing tons of marketing at it.
Now, I specifically don't think it is a case of worse ones winning. The reality is they are all impressive. Many newer languages got to make tradeoffs that were not viable years ago. They are still nicely done and I'm glad they are here.