News for hackers. Stuff that matters.
Re:Storm 2.0 by kazinator on Monday June 03, 2019 @04:56AM (#20081487)
> even more to learn a Lisp, especially if they are used to a C-like language

Ah, you're mixing up Clojure and Lisp. The restrictions in Clojure have nothing to do with Lisp tradition.

Someone used to a Lisp-like language will also struggle with Clojure.

Traditional Lisps like Common Lisp are multi-paradigm languages in which variables and most aggregate types are mutable.

They are not hard to pick up for someone with a background in C.

C has pass-by-value functions; so does proper, traditional Lisp.

C has mutable variables, arrays and structures; so does Lisp. Lisp data structures like lists or hash tables are easily understandable by a C programmer with a good background in data structures.

cons is like malloc-ing and filling-in a two-field struct, except that freeing is taken care of.

People have written Lisp systems in C (and written more than one book on that exact subject: Nils M. Holm just put a new one out: http://www.t3x.org/lsi/index.html), with a lot of the internals being written in C over the Lisp library functions. E.g. visiting and printing the elements of a list can literally look like this, in the internals of a C-based Lisp implementation:

   for (val iter = list; list; list = cdr(list))
     print(car(list));
val is some typedef for a pointer to a "struct lisp_object" or whatever. The nil value is represented by null, and so it goes.

There are no comments on this comment yet.