How explain why Python is easier/nicer than Lisp which has a simpler grammar/syntax?
Terry Reedy
tjreedy at udel.edu
Fri Aug 7 04:49:05 EDT 2020
On 8/6/2020 2:39 PM, Akkana Peck wrote:
> Christian Seberino writes:
>> Python is my favorite language and the easiest to use in my opinion.
>>
>> Lisp has a far simpler grammar and syntax. A beginner I think could
>> learn Lisp much faster than Python.
>>
>> Therefore, it seems like Lisp *should* be easier to work with and more readable. I don't feel like it is easier to use but I can't see *why* that is.
>
> First, everybody's brain is different so be cautious of sweeping
> statements. What's true for one person isn't necessarily true for another.
>
> That said, for me, Lisp's simpler syntax arises from the fact that
> there's basically one data structure: a list.
In general, the one data structure is a tree*, skewed by being smashed
into a linked list. Replaced 'list' with 'skewed tree' in what you say
below, and I think you explain well the problem many have with thinking
in Lisp.
* One can think of a flat list of n items as being a one level n-ary
tree with a head node and n leafs. A linked list is a skewed binary tree.
> To do anything in
> Lisp, you have to think in lists, map everything to lists (including
> the program's own structure), build up list-based data structures in
> your head. It's also functional and recursive, which means that as
> you're programming, you have to maintain a stack (which is also a
> list) in your head of all the lists that aren't yet closed. Of
> course, you can use tricks like let and setq to hold intermediate
> variables and mitigate that a little, but that isn't really Lispish.
>
> Trying to maintain that recursive list of unclosed lists in your
> brain is fun. It stretches the brain in interesting ways. I was
> way into Lisp at one point, including writing several Lisp
> interpreters (that simple structure makes Lisp very easy to
> implement). But I never found Lisp code very maintainable, because
> any time you read a program, you have to build up that list in your
> head every time just to follow the logic structure and figure out
> what the return value will be. I suspect most people find that more
> difficult than reading an inherently procedural language like
> Python. I know I do.
Stephen Wolfram's Mathematica is also based on the idea that 'everything
is a symbolic expression'. With a somewhat more standard syntax, it
found a sufficiently substantial audience to be a commercial success.
It obviously fit *his* brain well enough that he was able to do a hugh
number of different computations for his 2002 book A New Kind of
Science. It fits me less well.
--
Terry Jan Reedy
More information about the Python-list
mailing list