Ask HN: Current state of statically typed web framework

7 points by raphaelj ↗ HN
Hi,

I'd like to know if any of you had a good experience with a statically typed web framework.

I'm currently starting a new project, and I haven't been able to find a statically web framework that match my need.

I've been using Flask with Python for several years, and dynamic typing shows its limit when your project reaches a significant size, as you basically need a 100% code coverage to avoid any runtime error that could have been detected at compile time in another language.

I used Yesod (Haskell) and Play (Scala) too. While I enjoy the type safety, I find them quite bloated compared to Flask.

I saw some new frameworks coming from the Rust and TypeScript community, but I'd like to know any feedback from people that actually used them.

8 comments

[ 2.6 ms ] story [ 26.2 ms ] thread
Http4s is pretty nice, less magic then play
You can go to /r/rust and search/question for answers
FWIW, I've found the Go standard library `net/http` to be reasonably productive. It's pretty well-designed and intuitive for me, but YMMV. I've observed that ramping up in it from a Python/flask background is relatively painless.

If you're willing to dive into the Go landscape, there are a few quality web frameworks available, ranging from the small highly-performant https://github.com/buaazp/fasthttprouter, to the more opinionated and feature-creepy https://github.com/gobuffalo/buffalo. I'd skim the selection, see what trade-offs they make, and pick the one that suits you best.

ASP.net core is pretty well documented, has a nice CLI, the tooling is fantastic and the community is growing.

At the end you just have a single executable that you can deploy on a server. NancyFx is nice too.

If you haven't already it may be worth checking out Rocket [0]. From the guide:

"... you can think of Rocket as being a more flexible, friendly medley of Rails, Flask, Bottle, and Yesod."

[0] https://rocket.rs/

I've recently came across oatpp c++ web framework https://oatpp.io/. It has nice code-gen features for endpoint parameters mapping, and http client. As well as swagger-ui integration. Tried to play with example projects looks nifty.