3 ms·
Perhaps I'm misunderstanding your definition of "built for multithreading", but in my (admittedly limited) experience, Lisp isn't it. To my knowledge, McCarthy
by gloob 17y ago
Perhaps I'm misunderstanding your definition of "built for multithreading", but in my (admittedly limited) experience, Lisp isn't it. To my knowledge, McCarthy's Recursive Functions paper, the Scheme standard, and the Common Lisp standard all fail to provide for concurrency (although something like it could be implemented with coroutines, I don't have the impression that's what you're referring to). That said, it's entirely possible I'm mistaken.
I can't comment on Haskell, having no knowledge at all of it.
Erlang is rather more in the region of what your comment seems to be getting at, from my perspective.
- fpgeek 17y agoHaskell's purely functional core and ability to localize computational side effects via monads make it a natural fit for multithreaded programming. Pure (i.e. side-effect free) code can be semi-automatically parallelized (with the programmer giving guidance about where profitable parallelization points are, but just that). Shared-state concurrent programming can be made easier (and, most importantly, more modular) with Haskell's Software Transactional Memory support.
- signa11 17y agoobligatory "Software Transactional Memory: Why Is It Only a Research Toy?" link: http://queue.acm.org/detail.cfm?id=1454466 http://queue.acm.org/detail.cfm?id=1454466.
- fpgeek 17y agoSince I work for a startup ( http://www.bluespec.com http://www.bluespec.com ) that provides tools for developing hardware transactionally, let's just say that I think the story of hardware support for STM hasn't been written yet.
- timwiseman 17y agofpgeek explained what I was talking about in Haskell far better than I can. Perhaps I mispoke, being the very earliest of beginners in Lisp. I had thought that in realms of compiler controlled concurrency for certain types of functional programs it was very similar to Haskell in that respect. I apologize if I erred.
- deleted 17y ago[deleted]
- fpgeek 17y agoWell, to be completely fair, unlike some other languages, Lisp code can be reasonably written in a purely functional style (or a mostly-pure style that a compiler discovers and takes advantage of with something similar to soft-typing). However, what I hear anecdotally is that Lisp code isn't typically written that way. As you say, Clojure is the closest with its immutable local variables and its controlled mutation / concurrency models (of which STM is one).