
Ask HN: Which static compiled language do you use for web backend? - ghosthamlet
There are many mainstream dynamic language for web backend development, but so pity not many mainstream static compiled language for backend, but for medium to large projects, the static compiled language can give big benefits.<p>As i know, the mainstream for web backend just goes: C++ Java C# Go Rust (V D Nim Crystal OCaml Sml Haskell Idris maybe too good to be mainstream), with Java&#x2F;Go as the king.<p>Maybe i am wrong, can you say what are you using or what you used in the past few years?
======
sigrlami
I and companies I work with use a lot of Haskell on a backend. With Servant
library one can build build type-safe REST APIs and generate types for
different frontends. Take a look at
[https://haskellcosm.com](https://haskellcosm.com) I list there many companies
that use it as backend and it's not a single case.

------
cannabis_sam
I spent around 15 years building web backends in PHP (from your grandma’s
herbal cosmetics to a 50 million exit)

All my backends are currently written in haskell, usually with elm on the
frontend.

This is largely due to my subjective but, negative experience with dynamic
and/or object-oriented languages, and the discovery of abstract data types and
their direct connections to logic (i.e. a product type is a logical AND, a sum
type is logical OR and a function type is just a logical implication etc.)

I’m still keeping rust in my back-pocket though, for those times when I
exhaust the latency guarantees of haskell; but compared to php/python/ruby,
haskell is a walkover win.

This does require you to have a decent onboarding plan, but with Elm as the
first step it’s trivial to get people hooked on haskell, since its type
classes provide an extreme improvement over what Elm provides. And you
essentially get the motivation for the fundamental type classes (functor,
applicative, monad) for free, since people have been using all the
abstractions discretely in Elm, and suddenly get them all connected in a neat
package in haskell.

