I wrote a library a little while ago which is intended to be the simplest possible expression of this idea: https://github.com/j4mie/hotmetal/ The core implementation is only 85 lines of Python, and has no imports at all, so works nicely on minimal/alternative Pythons like Micropython. I'm using it on a medium-sized side project and it's shockingly productive compared to string templates. I don't think anyone is usin…
Ludic: New framework for Python with seamless Htmx support
51–60 of 107 posts
Re: Ludic: New framework for Python with seamless Htmx support
#52Earlier quoted context omitted.
How have you been burned? What kind of bugs did you have, and in what way was it difficult to debug?
Here's a bug I ran into with Python async: https://stackoverflow.com/q/78036302/265521 I've written about 200 lines of Python async code in total, so to run into a bug like that so soon was not encouraging. I suspect it's just not a very popular feature and so it doesn't get a lot of use and debugging. And it's Python so it really needs a lot of ton of real world use to detect bugs. Anyway I'm not going to waste my t…
Re: Ludic: New framework for Python with seamless Htmx support
#53Earlier quoted context omitted.
Myself I built an RSS reader using aiohttp and then forked the code to make an image sorter. I had a lot of people tell me I was crazy to write aiohttp servers because of the problems the previous poster mentioned but I had a long run of it working pretty well. On the other hand I’ve frequently had the experience of writing something in Python that falls apart like a tower of Jenga blocks the moment somebody else tou…
> Once I started serving images along with the text and using the app over a 2Mbps link it seemed to me the aiohttp server was getting a little unreliable. Does that imply that it was due to images being heavier, and thus if you were to stream something like video from aiohttp it would not go so well?
Currently for my case the worst problem is head-of-line blocking, the system could be downloading 50 large images but to put a tag on a gallery it needs to load a small HTML page for a modal dialog, then it has to populate a dropdown box after a tag category is selected, then process the form request.
Since all these images are queued to download, the system has trouble prioritizing the HTML requests. The best answer to this for me is to build that thumbnailer to get the image size down, but I am also thinking of putting images on an entirely different port.
Re: Ludic: New framework for Python with seamless Htmx support
#54I wrote a library a little while ago which is intended to be the simplest possible expression of this idea: https://github.com/j4mie/hotmetal/ The core implementation is only 85 lines of Python, and has no imports at all, so works nicely on minimal/alternative Pythons like Micropython. I'm using it on a medium-sized side project and it's shockingly productive compared to string templates. I don't think anyone is usin…
Re: Ludic: New framework for Python with seamless Htmx support
#55I wrote a library a little while ago which is intended to be the simplest possible expression of this idea: https://github.com/j4mie/hotmetal/ The core implementation is only 85 lines of Python, and has no imports at all, so works nicely on minimal/alternative Pythons like Micropython. I'm using it on a medium-sized side project and it's shockingly productive compared to string templates. I don't think anyone is usin…
Apart from the simplicity, I like the fact you can "install" it by copy-pasting the code at the top of your script, or running:
curl -L https://raw.githubusercontent.com/j4mie/hotmetal/main/hotmetal/__init__.py >> myscript.py
which is nice when you want a self-contained file.I think I'll be using this in the future.
Re: Ludic: New framework for Python with seamless Htmx support
#56I don't know, every time I see people sneaking html into Python feels weird and wrong to me...
Here is an example of a HTML page layout written with the DOMinate [1] library for example, in a "JSX-like" way:
https://github.com/olivierphi/zakuchess/blob/main/src/apps/w...
It may hurt your eyes at first sight, for sure... But similarly to technologies like Tailwind CSS, it's mostly a matter of getting used to it - and after a while it end ups feeling very natural to use :-)
Re: Ludic: New framework for Python with seamless Htmx support
#57Generating `HTML` from lisps has poisoned any other approach for me, see for example https://www.neilvandyke.org/racket/html-writing/ , https://reagent-project.github.io/ , and https://edicl.github.io/cl-who/
Re: Ludic: New framework for Python with seamless Htmx support
#58Earlier quoted context omitted.
By React-like component approach, do you mean using functions instead of templating language?
I think it is somewhat similar to React, for example, you can create a Link component like you can see in the README.md Now you can use it in f-strings, and well, other components. The idea from the beginning was to integrate it with htmx.org, so to me, it feels kind of similar when you are writing endpoints using these "components". But I understand why you are raising this question, I also didn't know how to name i…
Re: Ludic: New framework for Python with seamless Htmx support
#59I wrote a library a little while ago which is intended to be the simplest possible expression of this idea: https://github.com/j4mie/hotmetal/ The core implementation is only 85 lines of Python, and has no imports at all, so works nicely on minimal/alternative Pythons like Micropython. I'm using it on a medium-sized side project and it's shockingly productive compared to string templates. I don't think anyone is usin…
https://github.com/weavejester/hiccup https://github.com/JuneKelly/sneeze
Re: Ludic: New framework for Python with seamless Htmx support
#60I encourage anyone looking to do htmx to consider Kotlin and it's excelent kotlinx-html DSL. Lets you do stuff like this: https://github.com/corlaez/kotlin-htmx/blob/master/src/main/... Disclaimer: Not my code, just an example I found.