How explain why Python is easier/nicer than Lisp which has a simpler grammar/syntax?

Christian Gollwitzer auriocus at gmx.de
Fri Aug 7 11:59:47 EDT 2020


Am 06.08.20 um 17:13 schrieb Christian Seberino:
> 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.
> 
> My best guess.....
> 
>        Lisp pros: simpler syntax
>        Lisp cons: prefix notation, lots more parentheses
> 
>        My hypothesis is that the cons slightly outweigh the pros of Lisp
>             which is why Python is easier to work with and is more readable in the end?

I concur with Chris Angelico there. The word "simple" is ambiguous.
"Simpler" for the human is not the same as "simpler" for the computer

In Lisp, the grammar is "simpler", meaining that the definition of the 
grammar is shorter; this makes it simpler for the compiler to parse, and 
to write a compiler for Lisp.

In Python, the grammar is very complicated, writing a compiler for 
Python is a big task - still it is "simpler" to translate your ideas 
into Python

It is related to the old saying "if all you have is hammer, then 
everything looks like a nail". In Lisp, your hammer is the list. So you 
are forced to map your problems onto list processing. For some things 
that works well, for others not so well (infix math....) .

In, say, Java, your tool is classes and inheritance. There are big books 
on "design patterns" that teach you how to map your problem onto 
inheritance. For some things, that works well, for others not so well 
("abstract factory", "visitor pattern", ....)

In Python, you have an awfully complex of syntax, so your toolset 
includes list processing, lambda, inheritance, string interpolation, 
decorators....
This makes it possible to use the tool which best matches the language 
of your problem. Many problem domains have their own language, e.g. 
matrix math for linear algebra, pipes for sequential stream processing 
etc. The easier it is to translate the algorithm on paper into the 
runnable version, the

Lisp is still impressive, because it is very good at metaprogramming. It 
shows how far you can get with so little syntax.

Another point to consider is the ecosystem of your language. If you 
install Python, then you get basic math, I/O, a GUI toolkit, network 
libraries, ... In more "traditional" languages like C or Lisp, you get 
math and I/O, period. For everything else you need to hunt down a 
library. Therefore, solve the task "download the gimp installer from 
github via https" requires 2,3 lines in Python and installing a 
(possibly complex) library for the same task in Lisp or C.

	Christian



More information about the Python-list mailing list