Live data from Hacker News

BlackSheep: Fast ASGI web framework for Python

github.com

41–49 of 49 posts

Re: BlackSheep: Fast ASGI web framework for Python

#41
post #20

I’m worried about the psychological health of people that make stuff like this. Why? Nobody uses these frameworks unless paid, you need an actual team of people to maintain it.

I like LiteStar for this reason. It's similar to FastAPI, but I like the breadth of leadership involved.

Re: BlackSheep: Fast ASGI web framework for Python

#42

Feels like an in-between library that I'm not sure has a great fit in the current Python BE environment. It's not as batteries-included as Django, primarily because Django's the incumbent and the ecosystem is vast. It's not as modular and independent as Flask, which it's taking a lot of inspiration from. It doesn't seem to bring enough to the table to be flat out better all-rounder than FastAPI. I'm quite unsure wher…

I must have missed the part where we decided there can only be three Python web frameworks...

For a start, this shouldn't be compared with Django at all. This is, as far as I can tell, a web framework, as advertised. Django is a complex CRUD-web-app framework that is commonly mistaken for a web framework (probably because it calls itself that).

This is important because while there isn't really room for many Djangos, there is room for many web frameworks. That's why we have lots: Flask, Bottle, FastAPI, Pyramid etc.

Django is like a complete house: it has everything you need for doing a very specific thing, namely building a CRUD web app. But if you want to add an extra room or something it's a struggle. You either rebuild the house or clumsily bolt on an extension.

This kind of thing fits into your own software architecture which you'll hopefully design to be simple and adaptable. The choice between FastAPI, Flask or this is but a tiny detail at the edge of your application, like the colour of the front door of your house. You don't build the house around the front door, you just choose the colour you like and if you change your mind later you get a new door.

Stuff like Django has convinced people that choice of web framework is a huge deal that will determine the entire future of your application. It shouldn't be like that. Choose modular components and don't write yourself into a corner.

Re: BlackSheep: Fast ASGI web framework for Python

#43

Earlier quoted context omitted.

FastAPI also supports dependency injection.

Was quoting the library's docs. I've actually used FastAPI's DI, which is a nice convenience. It didn't feel as a big selling point, again, due to this being Python. Wrapping up your own DI is near trivial, and barely feels like a pattern. Thanks for pointing that out, I didn't even realize last night how weak of a selling point this is, even.

Yeah, you’re right that it’s not a strong sell. It’s not clear to me why I’d want to use this over any other more mature framework.

Re: BlackSheep: Fast ASGI web framework for Python

#44

Earlier quoted context omitted.

For Django, there's also django-bridge. This lets you build React apps that are backed by Django views/routing. You can also use Django's built-in authentication and forms which isn't easy with APIs.

Yes, auth between Django and a PWA is not a solved problem. It seems people just give up and go the hosted auth route or something. But it's also really not that difficult. Auth just takes a lot of practice for people to grok so most people don't want to touch it. I'll open source something once we're done solving the problem cleanly at my company.

There is no canned way to do it in one shot, but using regular Django session authentication together with a PWA frontend hosted separately is not that difficult.

The actual authentication remains on the Django app, using the standard way of POSTing to a login form and receiving a session cookie -- only instead of a server-generated page serving a HTML form, you have the PWA lipstick sending data directly. This approach is so much simpler than dealing with id/access/refresh tokens, encryption keys, black lists, and all of the OIDC dance.

Re: BlackSheep: Fast ASGI web framework for Python

#46
post #20

I’m worried about the psychological health of people that make stuff like this. Why? Nobody uses these frameworks unless paid, you need an actual team of people to maintain it.

...sometimes people build things for fun, or as proofs of concept for iterative improvement on existing tools (which can then go on to inspire changes in existing and new mainline tools). What does that have to do with (negative) mental health?

No, it’s a pain in the ass to do this. It’s not fun at all. It’s more a kind of boosting that makes it fun. Just aimlessly coding is dumb to justify.

Re: BlackSheep: Fast ASGI web framework for Python

#47
I'm building and maintaining Blazeio: https://github.com/anonyxbiz/Blazeio. Blazeio is designed to handle massive concurrency with low response times and high requests per second. It utilizes a perishable buffer, discarding chunks as they are received, and operates with a single task throughout the entire request/response cycle. In theory, Blazeio can scale to handle infinite concurrency. While Black Sheep crashes under heavy load, Blazeio continues to scale seamlessly and outperform it.

Re: BlackSheep: Fast ASGI web framework for Python

#49
post #20

I’m worried about the psychological health of people that make stuff like this. Why? Nobody uses these frameworks unless paid, you need an actual team of people to maintain it.

I built Blazeio ([https://github.com/anonyxbiz/Blazeio]) because aiohttp let me down in production. I needed a framework I could trust to support high-concurrency web apps, and rather than just complain, I decided to build it myself. It’s not about coding pointlessly, it’s about solving real problems. I update it for me, but since others have faced similar challenges, they can benefit from it too. I designed to be efficient, scalable, and lightweight, capable of handling hundreds of thousands of requests on a single server with minimal resources. Sometimes, creating something is motivated by necessity, not just by a paycheck.
Post reply on HN