Ask HN: Web frameworks – which less popular frameworks are you using and why?

84 points by vanilla-almond ↗ HN
Many popular programming languages today have one or two web frameworks that dominate usage in that language over other web frameworks for the same language.

- Python: Django, Flask

- Ruby: Ruby on Rails (RoR)

- PHP: Laravel

- JavaScript: ReactJS

I think it's nice to hear are about lesser-known web frameworks not often in the spotlight. If you are using a lesser-known or less popular web framework, what made you choose the framework? What do you like (or dislike) about the web framework you use?

147 comments

[ 3.5 ms ] story [ 225 ms ] thread
I use PHP-is-a-framework PHP :-) Fast, light and easy.
We use prime-mvc, a lightweight Java MVC framework: https://github.com/prime-framework/

I think this framework grew out of the initial development team's needs for a fast, lightweight Java framework. (I wasn't there, not sure how much looking around they did, but this was years and years ago.) It's now foundational for our applications.

We've had some folks at the Boulder Ruby meetup present on Hanami, which appears to have better separation of concerns and testability as well as less magic than ruby on rails. Hard to compete with the ecosystem, though.

-Nitrogen, Nova and Zotonic (because erlang)
For Kotlin, there's http4k. It just gets out of your way.
I use Pedestal (pedestal.io) because of:

1) Clojure is a superpower

2) Interceptor-based approach (think: dynamic middlewares) works really well and it’s flexible.

Clojure has no “frameworks”, but Pedestal has all the batteries I need included.

I do mostly of my backend in Python, but I've been curious about Clojure for a while. I might give it a try this weekend.
PHP: CakePHP

This was the very first framework I learned when I first learned PHP, and it has always just been so incredibly _easy_ to accomplish most common MVC tasks that I've stuck with it. I've become quite the expert in the framework over the years, even managing to make it bend quirky ways that it was not meant to in service of business goals. That has made me an extremely valuable resource for companies using the framework, and so I keep using it. Plus, I enjoy it immensely.

The cakePHP website uses (almost) white font on white background, doesn't work in Reader mode, and many links point to 404s (eg: https://api.cakephp.org/4.3/namespace-Controller.html)... Is it still maintained?
Yes, CakePHP is still maintained. The API docs are something that is being worked on and, we'll get the 404s fixed soon.

What browser are you having problems with in reader mode?

Firefox doesn't show the Reader icon (right of the url bar). If trying to force reader mode with

    about:reader?url=https://cakephp.org/
it displays the error:

    Failed to load article from page
As it is, the text in super light grey is completely unreadable.
Interesting, I've never seen this mode of firefox before. I checked a few other sites and they also had a 'Failed to load article from page' error. Do you have a link for a site that does work?
It usually works. Here's the 3rd link from HN home page right now for example

    about:reader?url=https://monicalent.com/blog/2019/06/03/absolute-truths-unlearned-as-junior-developer/
I wrote an application in cakephp before I learned rails. What a great framework. Plus, it's PHP, so easy to host anywhere.
wow, this takes me back. before cakephp, there was fusebox. i had started to write my own framework back then, but found fusebox to do most of what i'd wanted to do, so used it for a few projects. then cakephp came out as an iteration on the MVC pattern, and i switched immediately. only later did i discover rails, which was even more pleasant, as it sat atop ruby rather than php.
Never used Fusebox in PHP, but used it in ColdFusion, where it originated.
yah, i actually used it with coldfusion first too, then php later. fun times.
Used mithril.js and really love it albeit that was a few years back so not sure of it's current state.
PHP: usually you only need routing, not the whole kitchen sink; check out slim.
On that note, Fat-Free Framework may be following similar goals. I'm not into PHP myself but I know a few people who really like it.
We've used Slim for most things these days. I love it for its lightweight, standards based approach. I can grab PSR compliant libraries from Symphony or Laravel and usually drop them in with not too much effort.

PHP: Slim Framework

Rust: Warp.

I like Warp because it's akin to a layer on top of Hyper (for HTTP) and Tokio (for async), and can go down into these deeper layers as you wish.

I'm using Warp now because I'm trying all the Rust web frameworks. I like Rust Actix for larger production projects that favor a more-long-term ecosystem. I like Rust Rocket for its user-friendly ideas and superb tutorials for onboarding.

Rust: Zola

Zola is a single-executable static web-framework like Jekyll.

I've tried FastAPI recently, as the idea matured, I came to regret the decison. It's not bad, in fact it was very pleasant to get started with, yet I found myself missing and reinventing the wheel as compared to django. I develop with Django since 2015 (1.6 or so), to me it is the goto for any web related project.

I used to think my distaste for new and upcoming Javascript frameworks is a sign of getting old and not being as adaptable as I used to. But nowadays my thinking has shifted to seeing it as a instant loss of productivity with little upside.

Just like musicians don't switch instruments every time they see something shiny. Neither should we, or at least without feeling guilty about it. Mastery takes time.

I couldnt agree more with this statement. FastAPI was good for the prototype. Then when you want to go and do something a bit more complicated, it becomes a hinderance more than a help.
Can you provide any specific examples?
I've used a variety of Python frameworks, Django, Flask, FastAPI, and I'm always coming back to DJango and wishing I had just used it from the beginning.

Django Ninja brings some of the nice features of FastAPI to Django- https://django-ninja.rest-framework.com/

i used django and odoo previously. now i am working on a project that uses a new common lisp web framework gui called clog [0]. it is websocket based so singlr page applications are no problem. it is awesome because it is very flexible and common lisp has unrivaled repl driven development

[0] https://github.com/rabbibotton/clog

For SPAs I still use Backbone.js... Yes, I know, 2014 called and it wants its framework back. But... I like it. It's lightweight and doesn't impose any particular style or philosophy. It's well suited to small projects.

On the back end, for small projects, using a full-fledged framework is usually overkill. Writing a simple API that reads and write normalized data is quite trivial, and when one is writing everything it's easier to understand what's going on.

By this I mean that some behaviors come from the framework and can sometimes surprise you. For example, in Backbone, change events on the model are triggered not when an instance is updated, but only if the new version is different from the old. This makes sense, but the problem is that the comparison is only done on a shallow level. When updating deep properties, no change event is triggered. This took me some time to figure out.

Light frameworks have fewer unexpected behaviors, by virtue of being small.

My man! Another backbone.js user. It's so simple to standup an webapp with backbone I don't know why more people don't use it.
I tried backbone.js and couldn't get past white screen of death even after a few days of trying. Comparing that to Vue, it's just barbaric.
Are you using backbone with Marionette? I used this back in 2010ish. Love the simple MVC pattern while separating HTML, CSS and Javascript.
I love this. I used backbone in 2012/13 when everyone was all angularjs, it was a great project and I enjoyed the simplicity. I was intimately beaten into learning angular for the next gig

Edit: dates

I use http://rivetsjs.com/ in a production intranet project. At the time I started using it I wanted a lightweight alternative to angular/vuejs. I didn’t want the junior devs at the customer to have to learn webpack, etc, but I did want two way data binding, and wanted as lightweight as possible. It has met those needs, and more - it supports creating web components so has let me do reusable code bits also. My main gripe is it’s somewhat stagnant, and there isn’t the ecosystem of components and help like vue or angular.

Still, I’d recommend it for small projects where you need binding.

TypeScript: Nestjs

If you have used a good batteries included MVC like Django before, you’ll feel at home. I made a production ready app in a few weeks with it and Prisma as ORM, that’s been the base of our startup and served us wonderfully. Can’t recommend it enough, as it is really powerful and is very extensible and as obvious by the number of plugins and examples available.

Hey there, I work at Prisma — awesome to hear it's been serving you well!

Since you mentioned NestJS, I just wanted to quickly plug a comprehensive tutorial that we've published today that explains how build a REST API with NestJS, Prisma, Swagger and PostgreSQL. I think it gives a really nice overview of the main workflows and best practices when using these tools together!

You can find it here: https://www.prisma.io/blog/nestjs-prisma-rest-api-7D056s1BmO...

Thanks for everything Nikolas, you and your team at Prisma has been very supportive and helpful in both GitHub and slack. Your cloud editor has also served our team very well.
I also recommend NestJS. I can build something quickly that is modular and well structured.
I've been using ForgoJS ( https://forgojs.org/ ) over the past year, and have become a maintainer on the project.

I like it because it just gets out of my way. I get declarative DOM updates like in React, but without any heavy-handed idioms, behavior that's tricky to understand, or subtle footguns.

It feels more like using a library than integrating with a framework. Most of my code is just boring variables and function calls, as if I have a simple declarative layer between me and the DOM but I'm otherwise writing vanilla JS/TS.

Javascript: SvelteJS

Using it for some personal projects with Vite and it is a breath of fresh air. I use React for work during the day, but coding in Svelte just brings me joy.

I really hope SvelteJS takes off!
It mostly has. The lead dev has been hired by Vercel, which means I'm sure there's some exciting platform level stuff coming to SvelteKit too (similar to Next.js and React).
I recently migrated a large react app to svelte, it's been a lot of fun. I feel more productive working on svelte code than react.
React is really grinding my gears, lately.

Do you use something t like Redux with Svelte or is the approach different?

At the moment there is no external library for state management in Svelte. There is however Svelte context api and stores but I doubt you can make complex apps with that alone same as is very hard to do it with React context api.
If your state is simple enough you can just use a custom store or a writable store. If it gets hairy you could pick something like xstate or rxjs, they both conform to the store contract that svelte uses so they are pretty much plug and play.
Svelte is just amazing. Just makes sense
JavaScript: AdonisJS

Arguably the first JS equivalent of web development frameworks such as Laravel/Rails

Nah. More or less the same marketing s*t that's going on with Remix.

The author has fake accounts pretending to be a happy user to promote the framework. That stuff really puts me off, even if the framework might be awesome technically speaking. If you don't believe search for "andycharles" here, on reddit, twitter, etc. An account created everywhere on or after the framework was released, whose only information on the entire internet is about how great adonis is.

Scala: Akka-Http

If you want something that scales out horizontally akka-http + an distributed akka stack (cluster, sharding, etc) works beautifully. Especially pairing it with websockets/grpc streaming, you can end-to-end stream pretty effortlessly.

I've been using Python's Tornado (http://www.tornadoweb.org/) for years now.

Now on version 6, it's fast, well maintained, mature, and has good docs with readable code.

@bdarnell has done an excellent job maintaining it.

Here's one example:

Tornado supported async style coroutines before asyncio was a thing. Now it uses asyncio under the hood by default -- and it did so with an exceptionally smooth transition.

Same here. In addition, it's incredibly versatile, has abstractions that I like, and ships with the right amount of stuff. Most importantly, it never gets in my way. I just keep coming back to it.
Golang, Fiber.io framework, Go Templates, and some AlpineJS.

Why: No JS build toolchain hell, tight control over dependencies (you know because software supply chain), blazing speed, really nice live editing of go templates without server restarts, fully supportive of the browser's back/forward cache, and a single binary to deploy (plus the templates, CSS, etc.). Simpler DevOpsLife!

This sounds interesting, do you have any open source project examples?