Live data from Hacker News

FastHTML – Modern web applications in pure Python

fastht.ml

71–80 of 229 posts

Re: FastHTML – Modern web applications in pure Python

#71

Frameworks like this are really next-gen, but I wish people would think in terms of the bigger Python ecosystem and not just their own framework. This is about the fifth web framework which are not compatible with each other: Streamlit, ReactPy, FastHTML, Dash, Shiny, etc.. I created a truly reusable Python component framework which is just a a string generation library and can be used for ANY existing Python web fra…

That looks super interesting, congratulations. I would suggest you do write lots of documentation, a more elaborate readme on github and generally push your approach. As it stands, the repo looks somewhat unfinished and inactive, unlikely to make people spend their time and energy digging into it. I hope you drive it forward!

Re: FastHTML – Modern web applications in pure Python

#72
post #54

Are there any UI libraries developed for this? Or other ecosystem stuff.

It was just launched today so the ecosystem is just what we've built so far. I've create initial starting points for UI libs for boostrap and flowbite, and we have examples showing how to use daisyUI.

Re: FastHTML – Modern web applications in pure Python

#73

One check I always like to do with a new Python-based framework is this - does it support the creation of a dynamic number of components at runtime, AND each having their own component state? Most frameworks I've tried support one or the other, but not both. Is there an example that demonstrates something like this in FastHTML - user provides a number n at runtime, n cards are generated, each card has its own text fi…

Yes lots! The "idiomatic" todo app is a nice simple example: https://github.com/AnswerDotAI/fasthtml/blob/main/examples/a...

Re: FastHTML – Modern web applications in pure Python

#74
post #68

Sorry, but I hate server-side "helper" functions that generate HTML. For one thing it's never the same as what eventually gets shown on the page. 99.9% of the time you're missing attributes when needs to be hacked around. Debugging is a nightmare. Refactoring is hell. And css programmers have no clue what to do with this. Maybe I'm missing something here. Why not a templating engine?

In this case, it's a 1:1 mapping to what's on the page, so your concern doesn't apply here. Debugging and refactoring is far easier with Python functions than templates, and CSS programmers just use CSS the usual way. To answer your question, I'll quote from https://about.fasht.ml : Templates were originally created for web development in the 1990s, back when web design required complex browser-specific HTML. By usin…

I disagree. But ... I am somebody who listens and am able to change my mind. I'll experiment with this.

Re: FastHTML – Modern web applications in pure Python

#75

Python is fast compared to something? Maybe fast enough to generate HTML.

ROI is more important than silly benchmarks.

https://www.tiobe.com/tiobe-index/

But, we can play the benchmark game, if that tops your morning cereal.

Competes with Go. Blows most popular TS frameworks out of the water.

https://www.techempower.com/benchmarks/#section=data-r22&hw=...

For you: https://gprivate.com/6chku

Re: FastHTML – Modern web applications in pure Python

#76

Nice work! I think the Python community definitely needs something like this. The thought never occurred to me to use HTMX w/Python for both server rendered HTML and dynamic behavior in the browser. I have a few questions for you. 1. Why do you recommend conda or pip and not uv? Is this because the plug and play deployment platforms are configured to use pip? 2. Do you plan to make this “batteries included” like Djan…

The asyncio runtime should suspend while waiting for a LLM API response, not block

Re: FastHTML – Modern web applications in pure Python

#79

Frameworks like this are really next-gen, but I wish people would think in terms of the bigger Python ecosystem and not just their own framework. This is about the fifth web framework which are not compatible with each other: Streamlit, ReactPy, FastHTML, Dash, Shiny, etc.. I created a truly reusable Python component framework which is just a a string generation library and can be used for ANY existing Python web fra…

This sounds exactly like what I was looking for. I settled on htbuilder[1], but it certainly does not feel right as it requires a fair bit of wrangling in order to fit with Django.

I'd love to help you with documentation and such; hit me up at smart.tent1246@fastmail.com if you'd like a partner(:

[1] https://github.com/tvst/htbuilder

EDIT: Actually, scrolling further in this thread, it looks like https://htpy.dev fits the bill? It has explicit integration with Django, which is what I was looking for.

Post reply on HN