Hacker News new | ask | show | jobs
by oneandoneis2 4774 days ago
On the subject of why amazingly-powerful, ahead-of-their-time languages don't catch on.. I'd be interested to know if a study has ever been done on the "accessibility" of a language and its popularity.

By which I mean: A total novice, even a non-programmer, can be given a simple bit of PHP/Javascript, and work out what it does and how to make minor changes to it. But something like Lisp & Haskell, you just can't do that - you need to spend some time learning the syntax before you can do anything with them.

I'd be surprised if the ramp-up time to be able to do useful things with a language didn't have more of an effect than how powerful and useful it is.

6 comments

A person off the street gets the idea of a recipe. Most will get the idea of a process for taking a list of ingredients and producing a new recipe. But the idea of a procedure that takes a procedure for taking a list of ingredients and produces a recipe, and produces a new procedure for...etc. [I need some parentheses].

It's not the syntax of Lisp that is hard to learn. Nor is it the language primatives. What makes Lisp hard is the expressiveness of their idiomatic usage.

What makes Lisp difficult is how quickly one gets to abstract mental constructs like recursive definitions and procedures which take procedures as arguments - all before macros and meta-linguistics. That's saved for after lunch.

The worst part is that Lisp makes it look simple. A few micrograms can create a mind blowing experience.

"you need to spend some time learning the syntax"

But Lisp has rather less syntax than most other programming languages - and that's possibly a weakness rather than a strength when it comes to anyone new to the language.

I suspect there is a sweet spot when it comes to the syntactic complexity of programming languages - too little and people get lost in the generality and abstractions, too much and its difficult to remember it all and you end up with coding standards desperately trying to close down on the features that should be used (e.g. banning the ternary conditional operator).

> Lisp has rather less syntax than most other programming languages - and that's possibly a weakness

Yup: it's like saying that binary is easier than decimal because it has less digits - the average Joe would still find it easier to do his maths in base ten :)

Personally, I find both Lisp-1 and Lisp-2 easier to read (when it is pretty printed) than any other language syntax.

That the syntax or lack there of also expresses itself as an AST in addition to that is quite elegant.

Due to the reduction in syntax verbosity it is evident in the code what the important elements are as that is the only information displayed.

Lisp's syntax enables powerful utilities like Paredit to exploit that for unrivaled transpositions of the code as refactoring occurs.

I do think other syntax designs look more aesthetically pleasing on its face than what either Lisp-1 or Lisp-2 appear to the novice (the ML family of languages for instance) but it is something I have come to appreciate as my proficiency in Lisp has improved.

Code simultaneously being data and the converse as well is another elegant consequence of Lisp's design, so everything is optimized for the tail, which is what is important for tools and the environment to provide.

I wish the environment provided in other languages was as mature as that of Common Lisp (http://www.cliki.net/development), because it is immensely pleasurable to code in once the learning curve is overcome.

The quality of documentation and literature available for Lisp is also excellent, many of which are classics in Computer Science as a result and are worth reading regardless of actually using Lisp to develop with.

The comparison is not really valid. The point was that one has to spend "less" time to learn Lisp's syntax.

Thus, learning binary syntax vs. decimal syntax is indeed easier, as it is easier to learn Lisp's syntax when compared to other languages like, say, Java or C++.

In both cases I wouldn't say that learning the syntax is the problem. The challenge IMHO lies in the different execution models. And there starting with LISP is likely a good idea, as it's less different than Prolog. It's functional, but still imperative. While in Prolog the switch to declarative programming is more disruptive in my experience (and mind blowing / expanding).

The hard thing in Prolog is that for a non trivial program (and not even a big one) it becomes necessary to understand how the underlying engine works on your code rules in order to be efficient. I had a real case where reordering a few statements meant going from ~15mn to find the first solution to a problem to a split second for all 7 ones!

What helped me with Prolog is viewing the runtime as an engine searching through a possibilities space for a solution fulfilling the program requirements (constraints). The trick is then to layout the requirements to fail early during the search, so that the engine doesn't waste time exploring doomed parts of the space of possibilities.

This is an interesting line of inquiry. I wonder, though, what would be a good way to quantify accessibility. I find myself doubting your statement that even non-programmers would find JavaScript or PHP easier than Lisp due to syntax, given the latter's extreme simplicity of syntax. Programmers with C/Java/etc. experience would of course likely find JS and PHP more familiar and hence accessible.
This doesn't match my experience at all. People with literally no programming experience do not magically understand what a for-loop does. In fact--at least among the people I've tried teaching myself--they don't even understand what a mutable variable is! (And it's not like I used that term: I try to explain it in a simple way.) Learning the syntax for Php or JavaScript isn't that easy.

On the other hand, anybody with some math experience already knows and understands what a function is. At least to these people, Haskell syntax is clearer because it more closely matches something they're already familiar with: defining functions by cases. Sure, if you use some weird operators from odd libraries, people won't be able to follow. But that's true of using odd libraries in any language: people won't inherently understand AbstractBeanFactories or __magic_names__ either!

Now, if you already have some programming experience and little math, it's a completely different story. Once you've seen one imperative language with loops, statements and variables, you've seen them all. But this says more about how similar they are them about how easy they are to understand without background.

The usual experience people have with teaching Haskell and Scheme is that it's actually easier for people without prior programming experience! Colleges starting with either of these languages use them partly to level the playing field, and it seems to have worked reasonably well.

Besides, C and especially C++ are both very difficult to pick up. This hadn't stopped them from being people's first languages and becoming extremely popular. There's definitely much more to the equation, and I think the perceived difficulty of learning is both less important and less pronounced many people believe.

For a few years I got to watch a lot of novices and young programmers come to grips with various topics/programs together while I was helping out with a CS summer camp for prospective students at university. One year I was involved we used Pascal, another year we used JavaScript, but for a number of years, we used... Prolog!

This was done partly because prospective CS students often already knew Pascal, JS, or both -- putting the curriculum in a lesser-known language provided some extra incentive for those looking to stretch themselves.

The other thing, though, is that it seemed to put our smart but novice students on more equal footing with our students who already knew how to program. That is, though Prolog was arguably "harder", our novices seemed to keep up.

I suspect that Prolog isn't really harder, it just requires some thinking on an orthogonal axis to more common languages. Most of us don't get much practice on that axis, so writing programs in it is difficult.

The same thing may well be true of Haskell and Lisp.