Live data from Hacker News

Ludic: New framework for Python with seamless Htmx support

github.com

1–10 of 107 posts

Re: Ludic: New framework for Python with seamless Htmx support

#2
I've been working on a lightweight framework called Ludic that focuses on web development using Python, htmx.org, and a somewhat React-like component approach. It leverages Starlette for performance and the latest Python 3.12 typing features.

Interested in feedback!

* Docs: https://ludic.readthedocs.io/ * Code: https://github.com/paveldedik/ludic/ * Examples: https://github.com/paveldedik/ludic/tree/main/examples

Re: Ludic: New framework for Python with seamless Htmx support

#3

I've been working on a lightweight framework called Ludic that focuses on web development using Python, htmx.org, and a somewhat React-like component approach. It leverages Starlette for performance and the latest Python 3.12 typing features. Interested in feedback! * Docs: https://ludic.readthedocs.io/ * Code: https://github.com/paveldedik/ludic/ * Examples: https://github.com/paveldedik/ludic/tree/main/examples

By React-like component approach, do you mean using functions instead of templating language?

Re: Ludic: New framework for Python with seamless Htmx support

#7
post #5
post #4

I don't know, every time I see people sneaking html into Python feels weird and wrong to me...

Do you feel the same about sneaking html into javascript? Just curious if it's a Python-specific objection.

same feeling there tbh. Though generally, when it's done in javascript it's done completely in a string, without javascript objects.

Re: Ludic: New framework for Python with seamless Htmx support

#8
post #3

I've been working on a lightweight framework called Ludic that focuses on web development using Python, htmx.org, and a somewhat React-like component approach. It leverages Starlette for performance and the latest Python 3.12 typing features. Interested in feedback! * Docs: https://ludic.readthedocs.io/ * Code: https://github.com/paveldedik/ludic/ * Examples: https://github.com/paveldedik/ludic/tree/main/examples

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 it, and React is a completely different framework. I didn't know how to describe the framework in just a few sentences but wanted to somehow. I might change the description at some point.

I still don't know how useful the framework is, I am playing around with it and I like it. Who knows what other people think, though.

// edit - code block don't work here, removed code sample.

Re: Ludic: New framework for Python with seamless Htmx support

#9

I’ve been burned by ASGI and asynchronous python so much in the past, I wouldn’t touch it again even if someone paid me for it. It’s prone to bugs, hard to debug and for little benefit.

How have you been burned? What kind of bugs did you have, and in what way was it difficult to debug?

Re: Ludic: New framework for Python with seamless Htmx support

#10
post #4

I don't know, every time I see people sneaking html into Python feels weird and wrong to me...

Yeah, I understand that. Now that Python 3.12 has better support for f-strings, I thought there might be a way to make it possible. But I am still not sure it will work. There is a pretty weird hack to make f-strings work while avoiding the possibility of rendering unsafe user input.
Post reply on HN