Live data from Hacker News

BlackSheep: Fast ASGI web framework for Python

github.com

1–10 of 49 posts

Re: BlackSheep: Fast ASGI web framework for Python

#3
I was trying to see the value of this as well, but I don't know Python well enough. Maybe there is no ASGI for python?

And I assume Python cannot handle it's own HTTP server (using threads, similar to Javalin's virtual threads)? I always cringe when a programming language needs to find another solution/language to handling its processes. I understand why you will need a load balancer, but for small, simple projects, I like to contain things.

Re: BlackSheep: Fast ASGI web framework for Python

#4

I was trying to see the value of this as well, but I don't know Python well enough. Maybe there is no ASGI for python? And I assume Python cannot handle it's own HTTP server (using threads, similar to Javalin's virtual threads)? I always cringe when a programming language needs to find another solution/language to handling its processes. I understand why you will need a load balancer, but for small, simple projects,…

Python has had threaded, multiprocessing and such web servers for 20 years now e.g. in the form of Apache's mod_wsgi.

The async movement is recent, and optional in Python. There are benefits for async, but obvious downsides line coloured functions.

Re: BlackSheep: Fast ASGI web framework for Python

#6

I was trying to see the value of this as well, but I don't know Python well enough. Maybe there is no ASGI for python? And I assume Python cannot handle it's own HTTP server (using threads, similar to Javalin's virtual threads)? I always cringe when a programming language needs to find another solution/language to handling its processes. I understand why you will need a load balancer, but for small, simple projects,…

> And I assume Python cannot handle it's own HTTP server (using threads, similar to Javalin's virtual threads)?

ASGI is an Interface standard, not an implementation in another language. The AGSI compliant servers that Blacksheep recommends are both written in Python.

Re: BlackSheep: Fast ASGI web framework for Python

#7

I was trying to see the value of this as well, but I don't know Python well enough. Maybe there is no ASGI for python? And I assume Python cannot handle it's own HTTP server (using threads, similar to Javalin's virtual threads)? I always cringe when a programming language needs to find another solution/language to handling its processes. I understand why you will need a load balancer, but for small, simple projects,…

There is plenty. FastAPI, Starlite and Flask are all ASGI.

Yes, Python has its own ASGI HTTP Servers, Uvicorn and Hypercorn are two most common.

I agree, I'm not sure what this project aims to fix over other more established projects.

Re: BlackSheep: Fast ASGI web framework for Python

#8
post #6

I was trying to see the value of this as well, but I don't know Python well enough. Maybe there is no ASGI for python? And I assume Python cannot handle it's own HTTP server (using threads, similar to Javalin's virtual threads)? I always cringe when a programming language needs to find another solution/language to handling its processes. I understand why you will need a load balancer, but for small, simple projects,…

> And I assume Python cannot handle it's own HTTP server (using threads, similar to Javalin's virtual threads)? ASGI is an Interface standard, not an implementation in another language. The AGSI compliant servers that Blacksheep recommends are both written in Python.

Nitpick: If you're going to use ASGI with Flask, consider using Quart[1] instead[2], which aims to be Flask with better async.

1. https://quart.palletsprojects.com/en/latest/

2. https://flask.palletsprojects.com/en/stable/async-await/#asy...

Re: BlackSheep: Fast ASGI web framework for Python

#9

What is the plus value vs a 'classical' equivalent like FastAPI ?

So as far as I can tell, this is basically a more modern Flask. It pulls in design lessons from FastAPI, but it's still more batteries included such as templating (jinja2) and authentication.

Neat, but tbh I am very bearish on Python's future beyond APIs - templating html in Python is a terrible idea for anything larger than a hobby site, when you can have an API-first app with a React+Typescript frontend.

And if you need more than FastAPI, you might as well use django-ninja and get the full Django ecosystem at your disposal.

Re: BlackSheep: Fast ASGI web framework for Python

#10
post #4

I was trying to see the value of this as well, but I don't know Python well enough. Maybe there is no ASGI for python? And I assume Python cannot handle it's own HTTP server (using threads, similar to Javalin's virtual threads)? I always cringe when a programming language needs to find another solution/language to handling its processes. I understand why you will need a load balancer, but for small, simple projects,…

Python has had threaded, multiprocessing and such web servers for 20 years now e.g. in the form of Apache's mod_wsgi. The async movement is recent, and optional in Python. There are benefits for async, but obvious downsides line coloured functions.

There is no true function colouring in Python. You can do `asyncio.run(async_function())` inside almost any sync function, or provide your own async shim.
Post reply on HN