Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I have nothing against Lisp, but...

>Is Lisp as hard as people say it is?

>No. Lisp is actually the simplest programming language, and has no syntactic cruft.

I always see this used when claiming certain languages are easy to grasp. "It's not complex at all! The syntax is incredibly simple!" x86 assembly also has very simple syntax but it's not too easy for beginners to write in, beyond very simple and small programs.



The syntax of assembly language isn't combinative, beyond simple catenation. You're not creating trees, just a "link sausage" (or, a graph, more accurately) of instructions. Lisp syntax expresses tree structures; it actually does what other languages achieve with complicated syntax. They have parsers which build trees out of nodes. Those trees can be written in a Lisp-like way. E.g. a C declaration might be turned, by a C compiler, into (declare specifiers-qualifiers declarators), where specifiers-qualifiers might look like (const int) and declarator might be (a (pointer (array 3))), giving us (declare (const int) ((a (pointer (array 3)) (b (pointer (function (a int) (b int))))) for the surface syntax "const int (a)[3], (b)(int, int)". It's not just that the syntax is simple, but that it can capture the structure of programming (and other) languages while remaining simple.


You still end up with myriad syntax rules; why (a int) and not (int a)? Why not any inversion or isomorphic transformation?


It really is. That's why they used Scheme for the Structure and Interpretation of Computer Programs (SICP). If you look closely at it, you'll notice that they don't actually spend a lot of time teaching you anything about language itself, just the processes.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: