kjosib / kali

Simple, reliable, single-threaded HTTP service in Python. Aimed at serving web application to localhost as alternative to desktop application development.
MIT License
0 stars 2 forks source link

Should template stuff be in own submodule? #1

Open kjosib opened 4 years ago

kjosib commented 4 years ago

Probably. The protocol service can rely on it for built-in/generic error/status messages. I'd feel more comfortable if the iolist stuff wasn't so tightly tied to the idea of serving a HTTP response, though. For the moment it doesn't impact the API.

kjosib commented 4 years ago

Just a thought: the template stuff was originally conceived to be little more than string.format(...) with some smarts about the fact we're dealing in HTML (most of the time). It's grown a few bells and whistles over time. It's at about that level where I wonder if a bunch of simple hand-coded string manipulations and regex library calls remains the right approach. I certainly wouldn't want to add many more features this way.

Adding complexity and texture to the template language can and has lead to a more comfortable style of working, but to avoid a stinky knock-off of django and actually try to advance the art, I'd rather draw the semantic boundaries in a completely different manner. The basic idea:

Anyway, this is going to simmer for a while.