Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



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.


"async def" is literally function colouring


> 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...


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.


Starlite rebranded to Litestar btw, to avoid confusion with Starlette. It’s really nice too.


It has dependency injection


ASGI, and WSGI before it are standard interfaces for python web traffic.

it allows you to write an application (or in this case a framework) and have it work with multiple application webservers. I don’t know if java has an equivalent, but imagine if you could switch from tomcat to something else without changing any application code.


it's been a while ( 25-30 years ) but i think that was the whole point of Java servlets. Tomcat was the reference implementation but there were other application servers out there with more features that, in theory, you just upload your war file to and the application runs. I think one was named Glassfish but it's been a while...


from the README:

> BlackSheep belongs to the category of ASGI web frameworks, so it requires an ASGI HTTP server to run, such as uvicorn, or hypercorn.

but uvicorn and hypercorn are both Python libraries

so no need to cringe




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: