▲ | iLoveOncall 5 days ago | |||||||||||||||||||||||||||||||||||||||||||
I'm not sure there's anything "impossible" about how small this is. You don't really need a lot of lines of code to support routes, request and response and nothing else. If anything, 765 lines of code for this is quite a lot. It also uses libraries for most "extensions" that are available, defeating the purpose and bending the claim that it's 1,700 lines of code including the extensions. Just jinja, one of the dependencies, is 18,000 lines of code. If that counts my Nanodot server which calls flask.app.run() is one line... | ||||||||||||||||||||||||||||||||||||||||||||
▲ | miguelgrinberg 5 days ago | parent | next [-] | |||||||||||||||||||||||||||||||||||||||||||
To clarify this, note that the extensions are entirely optional, and unlike what you are saying, most do not require any dependencies. The only two extensions that use dependencies are the one that adds template rendering, and the one that implements secure user sessions. For templates, you can use Jinja on CPython (where you wouldn't normally have space issues), or the uTemplate library (https://github.com/pfalcon/utemplate) on MicroPython, which is quite small. For secure sessions, on CPython you have to add PyJWT. On MicroPython you need to add the HMAC and JWT modules from the MicroPython standard library, which are not installed by default. These are also very small. | ||||||||||||||||||||||||||||||||||||||||||||
▲ | illegally 5 days ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||||||||
Yeah, it's an over exaggeration to say "impossibly small", it's a pretty normal size for a minimal routing class... | ||||||||||||||||||||||||||||||||||||||||||||
▲ | motorest 5 days ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||||||||
> I'm not sure there's anything "impossible" about how small this is. You don't really need a lot of lines of code to support routes, request and response and nothing else. If anything, 765 lines of code for this is quite a lot. How do you explain why virtually all frameworks end up requiring an order of magnitude more LoC? | ||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||
▲ | 5 days ago | parent | prev [-] | |||||||||||||||||||||||||||||||||||||||||||
[deleted] |