4 ms·
> But I had a look into it the other day from the point of view of implementing the back-end for a new web project, and its support for writing web servers is s
by ghostwriter 6y ago
> But I had a look into it the other day from the point of view of implementing the back-end for a new web project, and its support for writing web servers is still probably a decade behind the state of the art.
This is an unsubstantiated claim. For years, Haskell has had the best in class backend web stack - https://www.aosabook.org/en/posa/warp.html https://www.aosabook.org/en/posa/warp.html
- Silhouette 6y agoFor years, Haskell has had the best in class backend web stack Please define "best in class".
- ghostwriter 6y agoBest in class - when within a single language, the following is available either out of the box or as a simple extra library dependency: * Semi-explicit deterministic parallelism out of the box (https://www.microsoft.com/en-us/research/wp-content/uploads/2009/09/multicore-ghc.pdf https://www.microsoft.com/en-us/research/wp-content/uploads/... , https://downloads.haskell.org/~ghc/8.4.2/docs/html/users_guide/using-concurrent.html#using-smp-parallelism https://downloads.haskell.org/~ghc/8.4.2/docs/html/users_gui...) * implicit Async IO runtime out of the box (https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/parallel_haskell2.pdf https://www.microsoft.com/en-us/research/wp-content/uploads/...) * thread-safe global mutable state and atomic transactions (http://book.realworldhaskell.org/read/software-transactional-memory.html http://book.realworldhaskell.org/read/software-transactional...) * type-safe native TLS (https://hackage.haskell.org/package/tls https://hackage.haskell.org/package/tls) * multicore async streaming web server (Warp) with a unified application API (WAI) * type-safe embeddable DSLs for rendering web content (https://hackage.haskell.org/package/blaze-html https://hackage.haskell.org/package/blaze-html , http://fvisser.nl/clay/ http://fvisser.nl/clay/) * type-safe embeddable binary content at build-time (https://hackage.haskell.org/package/file-embed-0.0.12.0/docs/Data-FileEmbed.html https://hackage.haskell.org/package/file-embed-0.0.12.0/docs... , https://hackage.haskell.org/package/servant-static-th-0.2.2.1/docs/Servant-Static-TH.html https://hackage.haskell.org/package/servant-static-th-0.2.2....) * type-safe HTTP specs and automatic schema derivation (https://docs.servant.dev/en/stable/cookbook/index.html https://docs.servant.dev/en/stable/cookbook/index.html) * the whole stack (multicore asyncio runtime, Network, HTTP/1.1/2, WebSockets, TLS, HTTP Server + Schema Specs, Markup rendering) is compiled into a single static binary of ~3 megabytes, universally across Linux, MacOS, Windows. * fullstack story with a help of GHCJS and a selection of frameworks (https://reflex-frp.org https://reflex-frp.org , https://haskell-miso.org https://haskell-miso.org)
- Silhouette 6y agoSo Haskell is best in class if you define that to mean web servers written in Haskell? If we surveyed a representative sample of 1000 professional web developers, how many of them do you think would give a list broadly in line with your definition for the properties of their ideal server implementation language?
- giantDinosaur 6y agoSince most web developers have no real clue about any of that stuff, why would their list in comparison matter here?
- Silhouette 6y agoI think if you are going to claim a tool is "best in class" then it should be demonstrably better at meeting the actual needs of people doing what it's used for. The list above was a list of features, not a list of benefits. Those features might bring practical benefits to the working web developer -- after all, people who program in Haskell do so for a reason, which is probably that they believe this kind of language is helpful in some way -- but that has yet to be established here. Meanwhile, an experienced back end web developer will probably be asking questions about managing large numbers of routes or guarding against common attack vectors or integrating with databases or calling external APIs or having a template system that supports translation to multiple (human) languages or understanding performance characteristics and how the servers will react to higher loads. These are practical matters that many web server frameworks attempt to address. It is revealing but not entirely surprising that the Haskell response to my question was instead to talk about strong typing and STM and so on.
- ghostwriter 6y ago> So Haskell is best in class if you define that to mean web servers written in Haskell? I was answering your comment about Haskell's web ecosystem. I didn't claim that Haskell is the best in class for everything just because it's the best for implementing web backends. > It is revealing but not entirely surprising that the Haskell response to my question was instead to talk about strong typing and STM and so on. I put them into my response because they are the features that you highly likely are not going to find alltogether on any other platform. The regular things like I18N, L10N, and so on that you mentioned are not worth the discussion, because Haskell ecosystem has them, in various shapes and forms, and apart from boring implementation details they are no different from similar libraries on other platforms.