Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>First up, I don't hold your view that node.js is doing the right thing exposing all of those callbacks. You end up writing your program in CPS (continuation passing style) and I think it should be the compiler's job to do that transformation.</p> <blockquote> <p>Events: No thread manipulation, the programmer only provides callbacks (as in Snap framework)</p> </blockquote> <p>So with this in mind, you can write using a asynchronous style if you so wish, but by doing so you'd miss out on writing in an efficient synchronous style, with one thread per request. Haskell is ludicrously efficient at synchronous code, especially when compared to other languages. It's all events underneath.</p> <blockquote> <p>Callbacks are guaranteed to be run in a single thread: no race condition possible.</p> </blockquote> <p>You could still have a race condition in node.js, but it's more difficult.</p> <p>Every request is in it's own thread. When you write code that has to communicate with other threads, it's very simple to make it threadsafe thanks to haskell's concurrency primitives.</p> <blockquote> <p>Nice and simple UNIX-friendly API. Bonus: Excellent HTTP support. DNS also available.</p> </blockquote> <p>Take a look in hackage and see for yourself.</p> <blockquote> <p>Every I/O is by default asynchronous (this can be annoying sometimes, though). This makes it easier to avoid locks. However, too much CPU processing in a callback will impact other connections (in this case, the task should split into smaller sub-tasks and re-scheduled).</p> </blockquote> <p>You have no such problems, ghc will distribute your work amongst real OS threads.</p> <blockquote> <p>Same language for client-side and server-side. (I don't see too much value in this one, however. JQuery and Node.js share the event programming model but the rest is very different. I just can't see how sharing code between server-side and client-side could be useful in practice.)</p> </blockquote> <p>Haskell can't possibly win here... right? Think again, <a href="http://www.haskell.org/haskellwiki/Haskell_in_web_browser" rel="noreferrer">http://www.haskell.org/haskellwiki/Haskell_in_web_browser</a> .</p> <blockquote> <p>All this packaged in a single product.</p> </blockquote> <p>Download ghc, fire up cabal. There's a package for every need.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload