<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">i've had a bit of fun with stackless, and it's nice, but the GIL is a problem, ouch<br><br>Terracotta is interesting too!<br>......<br><br>there's a nice presentation here.<br><br>http://blip.tv/file/2232410<br><br>Nice post Rick, concise at at the point... straight from the horses mouth.<br><br>I like it! :-) <br><br><br><br>--- On <b>Wed, 18/11/09, Rick Moynihan <i><rick.moynihan@gmail.com></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Rick Moynihan <rick.moynihan@gmail.com><br>Subject: Re: [dundee] Concurrent Programming on Linux<br>To: "Tayside Linux User Group" <dundee@lists.lug.org.uk><br>Date: Wednesday, 18 November, 2009, 10:04<br><br><div class="plainMail">2009/11/17 Gary Short <<a ymailto="mailto:gary@garyshort.org"
href="/mc/compose?to=gary@garyshort.org">gary@garyshort.org</a>>:<br>> All,<br>><br>> Which is the best programming language to use for concurrent programming on<br>> Linux? By best I also mean one that has a rich library for handling JSON and<br>> XML input too – I don’t want to go back to the RegEx stone age. J<br><br>Hey Gary,<br><br>Good question, and as is always the case it depends specifically upon<br>the details of the problem, and what you think is important. What do<br>you mean by best? How important are:<br><br>- Speed of sequential execution<br>- Scaling up across cores<br>- Scaling out across machines<br>- Expresivity, familiarity, interop, programming paradigm etc<br><br>Regardless here's some suggestions:<br><br>- Clojure<br><br> + JVM based (best library support of any platform - seamless Java interop)<br> + Functional language, immutable data<br> + All reference types have strong
concurrency semantics<br> + Atoms, CAS style atomic updates on single values<br> + Refs, Built in Software Transactional Memory (STM) for<br>co-ordinated, synchronized change...<br> + Agents, for uncoordinated, unsynchronised change<br> + Vars, for thread-local bindings<br> + Assumes local concurrency model (i.e. you can safely peek at<br>values without blocking or freezing the world)<br> - Terracotta (distributed JVM) can be used for distribution<br> + Fast (maybe 3-4x quicker than python) in the general sequential case<br> + Lisp (great metaprogramming... macros, parentheses etc...)<br> + Dynamically Typed<br> + Lots of good XML/JSON parsers available<br> + Multi-methods<br><br><a href="http://delicious/InkyHarmonics/clojure+video"
target="_blank">http://delicious/InkyHarmonics/clojure+video</a><br><br>- Erlang<br><br> + Very good at parallelism, multi-core and scaling out<br> + Functional language, immutable data<br> + Actor model<br> + Message Passing<br> + Concurrency model is ALWAYS distributed (even when its local) -<br>imposed complexity<br> + Robust & fault tolerant<br> + XML/JSON parsers<br> + Clunky string processing<br> + Dynamically Typed<br> + Pattern Matching<br> + Excellent error handling... crash, burn and restart philosophy...<br> + OTP - framework for building HA systems<br><br><a href="http://delicious/InkyHarmonics/erlang+video" target="_blank">http://delicious/InkyHarmonics/erlang+video</a><br><br>Of the above Clojure is my favourite, and is more suited to general<br>purpose workloads than Erlang... Rich Hickey, the creator of Clojure<br>has
proven to be an excellent ambassador of the language, providing<br>lots of good tech talks on clojure (all recorded).<br><br>If I was writing mission critical High Availability stuff, Erlang<br>would be my first choice. Other languages that you might consider<br>(but I know less about include):<br><br>- Objective Caml<br><br> + Incredibly fast....<br> + powerful ML static type system<br> + Immutable Data<br><br>- Haskell<br><br> + Purely functional, immutable data<br> + Very Strongly typed<br> + Fast<br> + lazy evaluation<br> + Very academic but has XML/JSON parsers and is used in the real world.<br> + STM, lots of concurrency stuff...<br><br>- Scala<br><br> + JVM Based (awesome library support via Java... pretty good java interop)<br> + Actors<br> + multi-paradigm<br> + Strongly typed<br> + Mostly just "a better Java/C#"<br> + As it doesn't favour
immutability it's IMHO less suited to<br>handling concurrency problems.<br><br>Alternatively if you don't actually care too much about language level<br>support for parallelism you can get it (at the expense of lots of<br>memory) by pushing it to the O/S.... i.e. by making use of Unix system<br>calls for IPC, e.g. fork, pipe, kill, select etc... you can start a<br>bunch of separate O/S processes... This has been done recently with<br>great success in Unicorn (an almost pure Ruby HTTP Server), and is an<br>approach that can be adopted in most languages.<br><br>There is also stackless python, which might be of interest as it<br>simulates LOTS of parallelism with coroutines/continuations etc...<br>However the Global Interpreter Lock (GIL) means that you'll never be<br>able to take advantage of multiple cores... meaning its main use is if<br>you spend a lot of time waiting on I/O.<br><br>All of these languages work excellently on Linux... they probably
also<br>work well on Windows too.<br><br>No doubt see you soon mate,<br><br>R.<br><br>_______________________________________________<br>dundee GNU/Linux Users Group mailing list<br><a ymailto="mailto:dundee@lists.lug.org.uk" href="/mc/compose?to=dundee@lists.lug.org.uk">dundee@lists.lug.org.uk</a> <a href="http://dundeelug.org.uk" target="_blank">http://dundeelug.org.uk</a><br><a href="https://mailman.lug.org.uk/mailman/listinfo/dundee" target="_blank">https://mailman.lug.org.uk/mailman/listinfo/dundee</a><br>Chat on IRC, #tlug on irc.lug.org.uk<br></div></blockquote></td></tr></table><br>