[Openmcl-devel] Speed, compilers and multi-core processors

mikel evins mevins at mac.com
Wed May 20 23:12:47 UTC 2009


On May 20, 2009, at 5:42 PM, Justin Grant wrote:

>
> Someone could define a version of Common Lisp with these  
> characteristics...
>
>
> ... hopefully that never happens !
>
> Patronizing assumptions on the part of language implementors have  
> mostly been avoided in CL up until now.
> There's a reason hackers choose CL to design/implement their  
> systems : they are willing to take responsibility for their own  
> code. For the opposite case think Java. Java's StringBuffer class  
> came about due to flawed assumptions that had to be handled after  
> the fact. The world that is modeled in software is not as cut and  
> dried as we would all like it to be : resources are not infinite.
>
> That being said, I really do like some of the features that I've  
> seen in Clojure (speaking from actual experience using Clojure and  
> CL). Forcing immutable data structures on users to simplify the  
> language implementation issues or to make concurrent programming  
> 'easier' is neither of them. The one thing I would change in Clojure  
> is this very thing. Even Haskell has it's monads and Lisp allows for  
> functional and imperative styles to be mixed.
>
> There may be an important lesson here ...

Haskell is more restrictive than Clojure, not less. The language  
defined by Haskell 98 has no way whatsoever to perform assignment.  
Monads provide a way to *simulate* assignment, but what they actually  
do is not assignment (much less simple assignment).

Clojure takes the same approach to managing threads that Common Lisp  
does to managing memory allocation. If Clojure's design in this area  
represents "patronizing assumptions", then so does Common Lisp's  
memory-management design. Common Lisp does not give you malloc and  
free because in a Lisp with those functions, there are a zillion ways  
to lose and very few ways to win. Clojure doesn't give you locks and  
simple assignment for the same reason.

Common Lisp is designed to make winning easy in the area of memory  
management. Clojure takes that design as a given, and in addition is  
designed to make winning easy in the area of concurrent programming.  
If you really want malloc and free, don't use Common Lisp. If you  
really want locks and simple assignment, don't use Clojure.





More information about the Openmcl-devel mailing list