Hacker News new | past | comments | ask | show | jobs | submit | kylerush's comments login

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 Django? E.g. it looks like currently you have to manage database schema and migrations outside of FastHTML.

3. Perhaps not in scope for this, but it seems to me making LLM API requests in the FastHTML backend could cause some scaling problems since these i/o operations can take a really long time and tie up the same threads required to render web pages. Any thoughts on that?

EDIT: Added third question.


1. I don't think we mention conda afaict? We suggest pip since it's already available and works fine, and most people are familiar with it. uv works fine too, but we always like to show how to do things the way with the fewest steps and that the most people will already know about.

2. We plan to include batteries in situations where it results in something better than just using some pre-existing project. So for DBs for instance we created Fastlite (a thin wrapper around sqlite-utils) since that particular API works best with FastHTML projects. You can use `transform` for simple migrations BTW. For more complex ones, we're planning to add support for sqlalchemy/alembic and other systems

3. We recommend using async for LLM API requests (which is supported by FastHTML, thanks to ASGI/Uvicorn/Starlette), although you can also use threads. uvicorn supports running multiple workers too. So there's lots of scaling options


1. The conda recommendation is in the JS App Walkthrough documentation page:

> A Python package manager: we recommend conda or pip

2. Makes sense! Something like sqlalchemy/alembic would be cool for PostgreSQL support.

3. Ah, this is interesting. Will read up on the different ASGI implementations. I had just assumed that having LLM workloads, async or not, on your main web server would be a problem (memory and/or i/o), but maybe not. To do date I’ve been moving LLM i/o workloads to background jobs on different machines with Celery, but it’s a bit more work and also makes streaming impossible. I recently did a Qwik + Celery stack for heavy LLM use, but have wanted a pure Python solution.

Thank you!


I possibly misunderstand your q3 -- if so apologies.

You shouldn't generally run your AI model directly on your web server, but instead run it on a dedicated server. Or just use an inference service like Together, Fireworks, Lepton, etc (or use OpenAI/Anthropic etc). Then use async on the web server to talk to it.

Thanks for pointing our the JS app walkthru mention - I'll update that to remove conda; we don't have have FastHTML up as a conda lib yet! I also updated it to clarify we're not actually recommending any particular package manager.


I've added fasthtml (and its dependencies) to conda-forge, so it's available in conda/mamba now.

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

There seems to be a libertarian slant to a lot of the comments on this. It reads as if most people believe they have an inalienable right to extend Apple’s products. In other words, it doesn’t matter what I do, what I say, or how I treat Apple, I have an inalienable right to extend their platform. A pretty bold take in my opinion.


It's not Apple's platform. It's mine. My device, my platform. I allow Apple to install software on my device, but it's my device. I own it, full stop.

This whole idea that a company can sell you a product but still retain exclusive ownership and decision making over that thing that they sold you needs to die. It's such an abusive relationship and deeply anti-user.


> deeply anti-user.

You mean anti-owner, since you really own the device


i mean, sounds fine? if i buy a physical product, i must be able to do whatever i want to do with it, no? who are apple to decide what i do with a device once i own it?


I assume using this large of a context window instead of RAG would mean the consumption of many orders of magnitude more GPU.


> I started offering my experience as a database consultant to help teams them fix their performance problems.

How much of this did you do and for how long? I’d love to self publish a book, but from your post it sounds like a full time gig. Essentially take off a long time without pay, focus full-time on the book, then pray you make some good money.


I've been helping devs for 2 years to work better with databases. Switched to full-time consulting this year.

The book took a very long time to create. Everything calculated together about 400 hours. So yes, I couldnt have done this in my free time. I just took the time this year as this year was planned as some kind of programming sabbatical - a do whatever I like thing. That it was such a great success and paid off all my time is just a bonus.


Racism tells us that the white race is superior to all other races. If you reject that, you expect to see that white people (or “model minorities” like Asian race) are not disproportionately receiving access to opportunity or disproportionately controlling the wealth. In the USA, it’s the opposite.

You can invent whatever system you want, like the one you proposed here, but if the outcome is disproportionate then it is, by definition, a racist system.

Why? Because race is a construct. It’s fake. Factually speaking, the only differences between these constructed racial groups are things like hair texture and skin pigmentation. Anyone saying otherwise is lying to preserve the construct.

If your values include a rejection of racism, you need to create a system that achieves the outcome of proportionate access to opportunity and proportionate control of wealth. Affirmative Action is the system that got the USA closest to achieving that outcome.


This is an extremely simplistic take on a very complicated topic.

While race may be a social construct, it has correlations with a number of other, less artificial factors. A random sample of people with the characteristics we associate with Asian race will tend to have more ancestry that traces back to Asia than would a random sample of people with Caucasian characteristics. This ancestry brings with it cultural and genetic factors that do affect outcomes and are in no way artificial.

This isn't to say that we can just shrug and say that people are different and therefore there's no racism. We absolutely need to be trying to actively eliminate racism. But it's absurd to try to claim that all people are essentially identical across all ethnic groups, and it's frankly offensive to a lot of people who take pride in their culture and ancestry.


However, for the class in question - African-Americans - is it not the case that they have been in America for generations, and so these cultural 'characteristics' would have been far more influenced by their experience in America (at the hands of the ruling white population) than anything that they might have brought with them over the Atlantic?

Unless you think the 'characteristics' have a strong genetic component, and so we are back to racism.


African Americans have retained a pretty distinct identity throughout this time. There are a lot of shared cultural artifacts to be sure, but the existence of a completely distinct dialect of English with its own distinctive grammar is solid evidence that the cultural overlap is not complete.

I resent the implication that any claim of genetic differences amounts to racism. We need to be able to have a reasonable discussion about genetics that doesn't come with all the value judgments that people assign to different genotypes. It's a bald fact that there are genetic differences, and that shouldn't be controversial. The inferences we draw from that fact can be racist, but the fact itself is just a fact.

The only conclusion that I'm arguing for is that people are born and raised differently, and we should expect to see different outcomes as a result. It's pretty obvious that we have not yet reached the point where the differences in outcomes are due exclusively to different choices, but we should expect to eventually reach such a point! People prioritize different things in their lives, and sometimes people prioritize things that the majority doesn't believe are important. That doesn't make them flawed people.


The point you’re making is that some cultures devalue educational achievement and success? So much so that we should expect to see members of those cultures disproportionately lacking access to opportunity because they “don’t want it?”


You're putting words in my mouth and, once again, oversimplifying. I'm saying that measurable economic outcomes are tightly wound up with personal identity, and personal identity is an extremely complicated mosaic of many different factors, and many of those factors are cultural. What we believe about the world, ourselves, and other people has a profound impact on the way we live our lives.

It's not simply "some cultures devalue educational achievement and success", because that implies that there is some discrete unit that can be measured called "success". My point is that what "success" means varies dramatically from person to person. When you claim that any variance in numeric results must stem from racism, you are attempting to distill humans down into numbers that can be sorted on a linear scale, and denying the amazing amount of cultural diversity in the world.


I did not claim "any variance in numeric results" is racism. I said the specific "variant" of numeric results that show non-white races disproportionately lacking access to opportunity and wealth is racism.

The amazing amount of cultural diversity in the world is not the reason non-white racial groups disproportionately lack access to opportunity and wealth and you know it.


It's possible I misunderstood this line:

> You can invent whatever system you want, like the one you proposed here, but if the outcome is disproportionate then it is, by definition, a racist system.

> Why? Because race is a construct. It’s fake. Factually speaking, the only differences between these constructed racial groups are things like hair texture and skin pigmentation. Anyone saying otherwise is lying to preserve the construct.

I read this as saying that any difference in outcomes is due to racism. My understanding of your argument is that if it were not for racism then all outcome curves would be identical across all racial categories, because there are no real differences between racial groups.

If that was misunderstanding, I apologize!


Yes, probably a misunderstanding then. The line you quoted says disproportionate. It’s not saying “difference in outcomes” it’s saying “disproportionate outcomes.” And it’s not any outcomes. It’s outcomes that specifically control what is deemed as valuable in the society, in this case education, which is widely understood to be a gateway to success/wealth/improvement/empowerment/power/etc.

I understand that there are differences between cultures. But saying that a culture difference is the reason that a culture disproportionately lacks access to the things deemed of value in the society is blaming the disadvantaged for their disadvantage. That is literally racism. “You do not have the same access to education that white people do because your black culture prevents you from having it.” That is obviously preposterous. What prevents none-white races from having proportional access to education (or anything of value in the society) is the racist system. People do not inflict racism onto themselves. It is inflicted onto them by the race in power.


You'll notice that I've never argued that we reached the point where racist factors in outcomes have been eliminated—I've only ever argued that when we do reach that point, I expect to still see disproportionate outcomes in the way that we currently measure them, because we will still value different things across different cultures. And that's okay! I think a lot of our definitions of success are fundamentally flawed, and cultures prioritizing other things have a lot of value!


Just make sure that when talking about cultural differences (specifically in regards to race) you don’t imply that “some cultures” (you know which ones) don’t value prosperity/wealth. It comes off as … you know what.


But it could be cultural. All the facts point to that being the cause. If there is so much racism against black people how could Nigerians and Carribean Blacks be some of the most prosperous ethnic groups in the US?


Before you decide to do any filter/treatment it is a good idea to get a lab test.

Testing water can get a little complicated and expensive. Ideally you’d test at the water source (where it enters your home) and at the point of use (where you pour it into your cup to drink it). This way you know the quality of the source water and the quality of the water after it flows through your pipes.

Testing this way can get expensive though. Also, ideally you’d test about once a year to see if there are changes.

Once you get the test results you’ll know what specifically you need to do to treat the water. You may not need anything.

I would suggest using Tapscore for the testing. I’ve used them in the past. https://mytapscore.com/

One final bit of advice, if you do want to get something like a reverse osmosis filter, go to a company that makes RO filters and send them your test results. I learned the hard way that there was too much radon in my water to work with the very expensive RO filter that I bought.


Thank you!


I’m reminded of comments from Allen Holub on Twitter. The very nature of writing code is social. If you write code, you intend for someone to use it, or read it, or modify it, etc. GitHub is an excellent example.

But even if you don’t use GitHub, almost all organizations require collaboration on code. At the very least you need someone else to review your code.

So I don’t really understand how lone wolf could ever truly work in software engineering. I worry that letting the idea have any oxygen at all sets you up for failure.


I live an hour drive north of New York City in a small, rural town of about 2,000 people. Large lot sizes, not much going on pollution wise. The lowest my CO2 has been so far is 659. This is when I open the windows for 30 minutes. I haven’t tried anything more aggressive than that. Either our rural, small-town air is worse than NYC for some reason, or the NYC air isn’t that bad? Very interesting.


Try opening your window for an entire day (e.g. when you're away) and see the result. If it's still above 600, my guess is that the sensor is crappy. Also, apparently some sensors recalibrate themselves against the lowest level they've seen in the past X days - so ventilating heavily may recalibrate it.


I recently started measuring CO2, Radon, PM (particulate matter) 1.0, PM 2.5, VOC, humidity, temperature, and air pressure with the Airthings Wave connected device.

I have learned a lot while using it for a couple weeks. First, making a fire in your fireplace is great for ambiance but drags air quality down substantially. It eats up oxygen a lot and make the CO2 increase sharply. It also causes very high spikes in particulate matter (both 1.0 and 2.5 micron) from putting the burned byproducts into the air.

I also started improving the energy efficiency of our heating system by fixing spots in the house where cold air comes in. While this results in less energy used to heat the home, it causes CO2 to increase because there isn’t anymore large holes to bring fresh air in. This device helped me learn that CO2 is and energy efficiency are circular problems. The tighter my house is, the more I need to focus on ventilation - exhaust out and fresh air in. It sounds complicated but for me it just means opening windows throughout the house for about 15-30 minutes per day. That alone makes a major difference on everything - Radon, PM 2.5, PM 1.0, CO2, etc.

Lastly just want to mention that it’s amazing to me how fast CO2 levels can rise with just my husband and I in our living room watching a movie. Good ventilation is something I definitely recommend everyone start measuring and working on.


> It sounds complicated but for me it just means opening windows throughout the house for about 15-30 minutes per day.

Not very useful when it is -10C (or colder) outside.

Current building science best practice can be summed up in the saying "Build tight and ventilate right.".

* https://www.energy.gov/indianenergy/articles/build-tight-ven...

* https://www.nrel.gov/docs/fy03osti/26458.pdf

Building tight prevents conditioned (heated in winter, cooled in summer) inside air from escaping, causing you to lose/waste money. It also prevents bad outside air (bugs, pollen, dust, car pollution, too humid/dry/cold/hot) from coming in.

Ventilating right means taking stale air from bathrooms (humidity) and kitchens (cooking VOCs) and exhausting it, and at the same time bringing in fresh air from outside on your terms: through filters and tempered to match inside conditions. This is usually done with HRV/ERVs.

Harder to do with older homes that need to be renovated, but now part of the building code for new builds in many areas (ASHRAE 62 defines ventilation volume/rate requirements).


If it's -10C, then open the windows for 5 minute intervals, not 15-30, that's what I do.


So I've just paid money (and probably created a bunch of carbon emissions) to heat my home, and now I'm supposed to throw that money away?


Not exactly. What you heat is the inside of your rooms, and a significant part of that heat can be felt as infrared radiation. When you ventilate in a quick and intensive manner, you exchange the air, which becomes cold for a few minutes but you do not cool down the room - because that takes longer. And the cold air has very little mass, so it is easy to re-heat again, and will be warmed by the walls etc.


> […] can be felt as infrared radiation.

Yes, I'm aware of mean radiant temperature:

* https://en.wikipedia.org/wiki/Mean_radiant_temperature

That doesn't deal with humidity (and other things like pollen in the warmer months).


The energy stored in your walls is much higher than the energy stored in the air. Swapping out all the air for cold one will reduce the total energy stored in your house very little. The walls will reheat the air. Same with letting AC air escape for a minute or two.


Buy a co2 meter. You have to have windows opened for much more than 5 minutes. Aaaand you have to open them every 40 minutes, even when you sleep. Good luck with that.


Or you could stick a fan next to the window to increase air flow.


For smaller homes switching from convection to infrared heating helps a lot, heating the surfaces instead of the air, means that letting the air mix by opening a window is less of a problem.


Perhaps it would be useful to hear your experience with CO2 assuming you have already implemented these measures in your home?


There's a ventilation technique that uses heat exchangers to warm the air coming into your house and vice versa (can't think of the correct name for it right now). Something to look into to have the best of both worlds.


* HRV: heat recovery ventilator (temperature only)

* ERV: energy† recover ventilator (temp+humidity)

† Actually "enthalpy", but few understand that concept, so for marketing reasons "energy" is used.


It might help if “enthalpy” as used by HVAC people was closer to what “enthalpy” means in thermodynamics. The closest I can come is that HVAC enthalpy is the enthalpy of the air plus the enthalpy of vaporization of the water vapor in the air.

This is an oddly named but somewhat useful concept for air conditioning because water that condenses onto an A/C coil delivers its enthalpy of vaporization to the air conditioning system. So you can add “latent heat” to “sensible heat” and get a sensible answer.

But this is all a bit silly in the winter. In the winter, the primary consideration is not the energy cost of vaporizing the water in the air. It’s the amount of water in the air, how to get it there, how to keep it there, and how much humidity is safe for the building envelope. I doubt anyone measures humidity in units of BTU/cubic foot.


Mechanical ventilation with heat-recovery - MVHR.


>It sounds complicated but for me it just means opening windows throughout the house for about 15-30 minutes per day.

In practice what our mothers and grandmothers did, without having ever sampled air.

Some old reference:

https://news.ycombinator.com/item?id=25332981


I believe the media has recently (ca 2020) taken to call it "German Lüfting" as it was temporarily celebrated as a solution to the ongoing pandemic.


My local contacts in Berlin have called it Lüftschlag — air punch.

(Although, who knows, that might just be a weird localism, just like “Guten Nacht, schlaf gut, träum süß von sauren Gurken.” which I was taught in Köln and nobody else I’ve talked to anywhere in Germany recognises, though when I say I learned it in Köln they all go “Oh, Köln, yeah, they’re all crazy like that”.)


As a Kölner by birth that localism does ring a faint bell though I wouldn't have said it's a Cologne thing if you had pushed me on it. We do have plenty of localisms due to the historical proximity to France though, and it always amuses me that "Plümo" (duvet) for example is completely unheard of in most of the German-speaking world and is usually replaced with the far less graceful and to me frankly confusing "Oberbett".

But the general term, as a verb, is "Lüften" or specifically "Stoßlüften" for the shorter form that is often mandatory for apartments with modern insulation but lacking a proper vent system to prevent mold.

On a sidenote: an interesting folk etymology exists for the Rhineland word "Fisimatenten", meaning something like "shenanigans", deriving it from French "visite ma tente", literally "visit my tent": the claim is that mothers would advise their daughters to avoid "Fisimatenten" because French soldiers during the Napolean occupation might invite them (in French) into their tents for, well, shenanigans.


> But the general term, as a verb, is "Lüften" or specifically "Stoßlüften" for the shorter form that is often mandatory for apartments with modern insulation but lacking a proper vent system to prevent mold.

Exactly that.

To add, problems with mold are often due to insufficient insulation in some patches of the wall (like near windows), combined with humid air and insufficient ventilation. A properly insulated house should not form mold. But it is necessary to get humidity out, that's correct.


"Plümo" is definitely used in other cities on the west side of the Rhein. At least in Koblenz and Mainz.


I've usually heard Stoßlüften (shock ventilation), and it's often part of the lease in Germany. It helps avoid condensation and mold.


Berlin native here. My mother (also Berlin-born) said "Träum süß von sauren Gurken". So not a cologne-only thing.


> In practice what our mothers and grandmothers did

Wait, people don't ventilate their home anymore?


Seemingly many people don't usually, I think it depends on the country/tradition/habits, in the thread I linked to:

https://news.ycombinator.com/item?id=25332981

there are quite a few replies of people that reported how they were not familiar with the concept.

And I have to underline how the evolution of building practices (again that depends greatly on different countries/local uses) generally speaking tends to make houses more airtight than before, so that ventilating should be more needed nowadays (with the exception of mechanically ventilated houses).


I wasn’t taught to in the 80s, because we had a drafty home and it wasn’t necessary to do so consciously.


> it causes CO2 to increase because there isn’t anymore large holes to bring fresh air in

Obviously you need the double-entry exchanger: Air comes in at 5°C and is gradually heated at 18°C by the air exiting, which starts at 20° and is cooled down to 7°C. No external energy required, it’s a classic of neutral-passive buildings.


Yes, it is indeed amazing how fast CO2 levels can increase. This is especially a problem in low-ventilated classrooms.

At AirGradient we measure a lot of classrooms and it is not uncommon to see CO2 levels rising to above 4500ppm just within 2 or 3 hours. We wrote a blog post some time ago highlighting this [1].

[1] https://www.airgradient.com/open-airgradient/blog/we-measure...


Irony in the timing of your post as I too bought an air monitor filtering device a few weeks ago given my interest in measuring things I cannot see that may impact my families health. After several weeks of use and no ‘major’ concerns this past Saturday evening the air quality was hovering just below severe for many hours and the house felt 'stuffy' to me. I checked the devices readings and then asked each child and my SO independently how they felt after taking a deep breath and for generalization purposes they all stated 'stuffy' in a greatly shortened term. With a significant delta in temperature outside and in I too opened all the external doors and we had a slight wind that was then blowing through for about 5 minutes. Within seconds the air quality began to improve and after closing the house back up the air quality for the remainder of the weekend, and even now, has been optimal and everyone has felt much better. It is very interesting to measure something one can otherwise not see, such as one's air quality, and then take action to improve upon that thing which we never before quantified against how we felt which clearly has impacted our health in ways we may never know. Yet again, what you cannot see matters most!


+1 for Airthings wave.

I learned a lot about the ventilation situation at my place by tracking CO2 buildup. I now know that the time I should leave a window open to get CO2 levels indoors to approximate equalize to outdoor levels is 10x longer than what my intuition suggested.

I also discovered that every time I felt the air was “stuffy” and I needed some fresh air, it actually corresponded to a spike in VOx levels. When mom was visiting over summer, we discovered she is also sensitive to VOx levels.

This is my first winter with airthings wave. I’m curious to see how humidity levels are impacted by trying to keep my house warm.


Open fireplace rather than a wood stove, yes?


Not GP, but I assume either is going to be noticeably worse than no fire at all, a closed log burner better than open. It's not going to stop me enjoying a fire though.

I think they're way under-appreciated, by my calculation they're almost at gas boiler prices in terms of £/kWh of effective heat (currently paying 6p/KWh of gas) - and perhaps particularly as someone living alone, 'spot heating' is great - so cosy by the fire in the evening, way hotter than I'd want to heat the whole house (room even) with gas. I just wish I had one in my bedroom (& perhaps bathroom) too, I wouldn't even need central heating (well, maybe I shouldn't be so confident before Jan...).


Yep. We have been wanting to get a fireplace insert which would be a major improvement in air quality, managing temperature, and how fast we burn through wood. The estimates we got were $2k for the insert and $2k to install. Still looking into it, but given the cost it’s not something we can move in immediately.


SAP is primarily an Enterprise Resource Planning (ERP) product. Salesforce does not have an ERP product.

ERP’s are operational efficiency tools that companies use. Core components of ERPs are financial (automating accounting), inventory, transportation management (finding the best route to get physical products from China to the USA for example), amongst other modules.

Some ERP companies have CRMs (Oracle Netsuite I know for sure does), but again Salesforce doesn’t.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: