Replacing butter with vegetable oils does not cut heart disease risk (2016) - <AUTHOR> https://www.theatlantic.com/health/archive/2016/04/is-vegetable-oil-really-better-healthier-for-your-heart-lower-cholesterol/478113/ <comment><USER2> It obviously does not because there are whole populations, such as Tibetans, who consume butter on daily basis and are still alive and well, without any cardiovascular epidemic.

What is a risk, by the way? How it is defined, apart from a personal lifestyle, diet, habits, current set of disorders and chronic illnesses of a particular person? It is a likelihood? An average of some imagined population of which some non-representative sample is treated according to some abstract, disconnected from reality model of a few selected unproven factors in a complex multiple causation individual phenomena? How the value of that number related to anything meaningful? It passes peer-reviews because it conforms to a socially constructed consensus (the current set of memes) but no one does a review of logic and causality.

<comment><USER3> The classic example, since modern nutrition research started in the '50s, is Inuit/Eskimo. They eat a lot of whale blubber, yet have very low rates of heart disease.

A good book that presents the case against nutrition research is "The Big Fat Surprise: Why Butter, Meat & Cheese Belong in a Healthy Diet."

<comment><USER4> I wonder if the Tibetans and Inuits benefit from the fact that their dietary fats come from animals who lived healthy, whole lives. Much of the US consumes dairy and meat that comes from animals who were shoved into dark, overcrowded, stressful, unnatural habitat and fed strange feed that they'd normally not eat such as corn and grain.

<comment><USER5> To argue that, you'd have to demonstrate that the fats in animals raised on what you call healthy food differ chemically from the fats you'd find in animals fed otherwise.

Related example: The glucose from sugar beets is chemically identical to and indistinguishable from the glucose from sugar cane or corn. Animal fat tends to be a more complex mix, but while no expert I suspect there's only so many different lipid compounds produced and stored in animal cells. After all, the energy currency in any animal's bloodstream is mainly glucose - the source information is lost.

There are excellent _ethical_ reasons not to mistreat animals as is today often the case. I'm not sure that there are chemical reasons related to nutrition.

<comment><USER6>
      glucose from sugar cane or corn

Is there meaningful mass production of _glucose_ (or dextrose) from corn? Corn _syrup_ is higher in fructose, which is metabolized very differently from glucose.

<comment><USER5> Absolutely! The glucose mix initially produced from corn is about 50% glucose and 42% fructose, which is roughly the same ratio as you get from beets or cane. You can then _optionally_ raise the percentage of fructose to 55, 65 or even 90% fructose. The 90% stuff is usually diluted/mixed before use.

HFCS is just sugar syrup with an intentionally elevated level of fructose. There's nothing that specifically ties corn to high amounts of fructose, other than that corn is heavily subsidized in the US while other sources of sugar are hit with import tariffs. So corn is what US sugar producers will tend to use as a source.

</comment></comment></comment></comment></comment></comment><comment><USER7> Cholesterol isn't bad, it's in fact very important for the production of testosterone among other things. The problem comes from the inability to use it because the body isn't healthy. Polyunsaturated fats will produce bad byproducts when it breaks down and over time makes the body sick.

We crucially lack magnesium and potassium in our diet. There are tons of studies showing the benefits of magnesium against heart disease. And it's not just the heart, cholesterol can obstruct the liver and a sick liver will cause a whole lot of problems.

<comment><USER8> The grey matter in your brain is mostly cholesterol. I've personally lost 10 pounds in 10 days eating a high fat, low carb diet, with light excercise about 3 days a week. Kerrygold is my #1 choice for butter, because it comes from grass-fed cows.

<comment><USER9> The problem with ketogenic diets is not the weight loss. The diet works for weight loss, that is undisputed. The problems are in the longer term with elevated cholesterol and increasing insulin resistance.

Example: [https://www.ncbi.nlm.nih.gov/pubmed/24703903](https://www.ncbi.nlm.nih.gov/pubmed/24703903)

There's however tons of this. Most keto bloggers will try to tell you that increasing LDL-C is okay for different reasons (depending on who you read). That is however just not true. The link between LDL-C and heart disease is very strong and has been proven over decades.

<comment><USER10> > The problems are in the longer term with elevated cholesterol...

From your link:

> These differences were not significant at 24 months.

\</comment></comment></comment></comment><comment>-----

> and increasing insulin resistance.

I'm going to need to insist on sources on this.

<comment><USER9> Insulin resistance: [https://www.ncbi.nlm.nih.gov/pubmed/20427477](https://www.ncbi.nlm.nih.gov/pubmed/20427477)

As for the cholesterol, the study I linked was probably not a very good example - sorry. Saturated fat does raise cholesterol however - so unless you are on a vegan low carb diet, you will see it rise. (IF you keep your weight steady, weight loss almost always lowers cholesterol)

<comment><USER10> Counter source: [https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4264021/](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4264021/)

<comment><USER9> Losing weight, especially fat does wonders for insulin sensitivity, though.

The low carb group lost 6.2 kg of fat. That is a lot. I do wonder what happens if you look at insulin sensitivity when weight and fat mass remains mostly neutral. I do not know if there are studies done on that (in humans). I will have a look around.

<comment><USER10> > Losing weight, especially fat does wonders for insulin sensitivity, though.

Agreed.

> The low carb group lost 6.2 kg of fat. That is a lot. I do wonder what > happens if you look at insulin sensitivity when weight and fat mass remains > mostly neutral. I do not know if there are studies done on that (in humans). > I will have a look around.

Sure, but if it's purely weight dependant, then high fat isn't a factor. And if it's not, why did it increase sensitivity?

I'm not trying to say that fat is the one solution to everything, but I'm definitely saying it's not the one cause for everything. I can cite multiple studies showing the various detriments of carbs, and likewise the pitfalls of fat, but when the circumstances are key, then isn't that simply the answer?

Don't be afraid of butter and eggs, don't be afraid of rice and carrots. Eat everything in moderation. Maybe stay away from sugar and deep fried treats?

</comment></comment></comment></comment></comment><comment><USER11> In fact the trend to replace butter with vegetable oils has led people to ingest more trans fats which are provably more dangerous than saturated fat.

<comment><USER12> I thought no reputable vegetable oil brand uses trans fats anymore.

<comment><USER13> As far as I know, that shift has only occurred in the past decade or so, after the FDA started requiring trans fat to be listed on the Nutrition Facts label. It might be too soon to look for the effects of that change on long-term risks for cardiovascular disease.

<comment><USER14> The sad thing is that the FDA first had to be convinced to allow trans fats to be listed. Later it required them to be labeled.

<comment><USER15> Also, FDA labeling allows "0g trans fat" for food with 0.5 g per serving, and listed serving sizes are often laughable, so I wonder. This article I just found claims "0.56% to 4.2% trans fats" in "soybean and canola oils found on store shelves in the U.S." ([https://authoritynutrition.com/6-reasons-why- vegetable-oils-...](https://authoritynutrition.com/6-reasons-why-vegetable- oils-are-toxic/)) Dunno how much weight to give it; I try to avoid those oils anyway.

<comment><USER16> I've always been taught that after olive oil, canola is the best to use for cooking. What am I supposed to use?!

<comment><USER17> Interesting. I've been taught the opposite due to the low smoke point of olive oil.

I use Avocado oil; it has a high smoke point and seems healthier. Other oils are OK if you don't cook on high heat (use medium heat or lower).

<comment><USER18> Olive oil comes in many varieties, and some of them have a smoke point comparable to canola, or even higher. Even the unrefined varieties tend to have a fairly high smoke point. So unless you're searing, olive oil is just fine for cooking.

[https://en.wikipedia.org/wiki/Smoke_point](https://en.wikipedia.org/wiki/Smoke_point)

[https://www.oliveoilsource.com/page/heating-olive- oil](https://www.oliveoilsource.com/page/heating-olive-oil)

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER19> I try to avoid eating vegetable oil. I understand that the polyunsaturated oils are preferentially stored to protect the body from these unstable oils.

The Center for Science in the Public Interest needs to eat some crow.

<comment><USER20> The entire nutrition science industry needs to start reporting confidence levels associated with studies. Almost all nutritional advice is based on small studies. That's why you see them contradict each other on a frequent basis.

You need a 5 sigma result to discover a new particle. Discovering new particles doesn't kill people.

<comment><USER8> You are 17,600 times more likely to die from heart disease than from a terrorist attack. Yet the only president talking about nutrition and GMO is Putin. Crazy based russians. [https://www.rt.com/business/324605-russia-putin- healthy-food...](https://www.rt.com/business/324605-russia-putin-healthy- food/)

<comment><USER21> [deleted]

<comment><USER8> Not an argument.

</comment></comment></comment></comment></comment><comment><USER22> There is nothing wrong with butter. Oils can become rancid. Clarified butter or ghee is even better as they have longer shelf life.

<comment><USER23> It's an animal product with the obvious ethics problems and cow methane boosting the co2 footprint.

<comment><USER24> > It's an animal product

For which you don't kill the animal.

> with the obvious ethics problems

This may or may not be "obvious" decades or more in the future, but I _think_ people who hold this idea are in the minority at the moment.

> cow methane

Point taken.

<comment><USER25> > For which you don't kill the animal.

Milk cows are continually raped for the duration of their lives: [http://www.humanemyth.org/happycows.htm](http://www.humanemyth.org/happycows.htm)

<comment><USER26> > _Milk cows are continually raped for the duration of their lives_

This is misleading and utter bullshit (no pun intented). By that reasoning, every routine examination at the gynecologist or proctologist would constitute rape.

We have no reason to suspect that a cow feels "raped" during artificial insemination, or anything more than slight physical discomfort.

<comment><USER25> Your argument is basically "if it feels good, it's not rape." Disgusting and you should be ashamed of yourself.

<comment><USER26> > _Your argument is basically "if it feels good, it's not rape."_

No, you're misreading my post. My argument boils down to "Stop projecting complex human emotions onto bovines without evidence."

</comment></comment></comment></comment></comment></comment></comment><comment><USER27> How about olive oil? The oils they name there already got a bad rap in the press here for not being very good for you. But olive oil persists.

Also; you have to wonder about these tests... Anecdotal, but too many times I see people take cola light, a light sugar substitute for their tea and veg oil based butter with their 3000 kcal burger & fries & chocolate sunday.

Also, the more I read up about it, I think stress is far more involved than food in a lot of cases. And if you feel you have a lot of stress (some people can handle tons and feel nothing, other get burn out with comparitively little, so it is personal) then I do not think food matters a lot: exercise probably does. Just looking at food is not enough there; weight, stress, genetic factors and exercise have to be equal for all individuals.

<comment><USER28> > How about olive oil? The oils they name there already got a bad rap in the > press here for not being very good for you. But olive oil persists.

Sorta an apples and oranges comparison. Olive oil is primarily a monounsaturated fat. The article covers polyunsaturated fat. Olive oil is more stable than linoleic oil, but still less than any decent saturated fat.

I think it's kinda funny the article references cholesterol levels. My suggestion: They could try and measure the subjects' midichlorian levels.

<comment><USER27> Ah, I read vegetable oils. I do not know the difference between polyunsaturated and monounsaturated, but will read up on it. In our region they use olive oil for everything hence I was curious.

<comment><USER29> Some important differences, as I understand it:

\- polyunsaturated fats are the category that includes omega 6 and omega 3 fatty acids. Even further, omega 3's can be ALA (from plants) or DHA (e.g. salmon) variety. Omega 3's and in particular DHA have been shown to have anti- inflammatory and other health properties. Which is to say even within polyunsaturated fats there is a wide variety of alleged health effects, but when talking about cooking oils and processed foods we're almost certainly talking about other types than the type known to have health benefits.

\- polyunsaturated fats can be hydrogenated which makes them solid at room temperature. So replacing butter with margarine typically means these types of fats. It was discovered relatively recently that trans fats (which are often the by-products of this) are almost certainly bad for you.

\- polyunsaturated fats are the least stable, meaning they're more likely to break down into things that are probably not good for you (e.g. if deep frying with them).

\- highly-processed foods tend to be high in polyunsaturated fats, and omega 6's in particular. This is the same category regular vegetable oil (e.g. soybean oil) falls in.

\- olive oil is high in monounsaturated fat, is generally thought to be pretty healthy, and it doesn't have these same kinds of "gotchas" that polyunsaturated fats can. Historically the main reasons we think olive oil is healthy are that populations with less heart disease (e.g. Mediterranean populations) eat a lot of it, I don't know how much more recent research there is actually proving causation here.

\- saturated fat is the other type, which can occur in plants like coconuts (healthy) or in butter, fatty meats like bacon and steak, etc. The history here is pretty fascinating, but through lots of misplaced assumptions of correlation/causation these are traditionally viewed as unhealthy (thus why people are doing these studies like replacing butter with other fats). AFAIU this debate is still ongoing, there is some evidence these really do raise your cholesterol but also some evidence that the particular kinds of cholesterol they raise aren't necessarily bad, in otherwise healthy people. I'm a bit unclear of this aspect.

I've concluded for me personally, this stuff is still so unknown that your best bet is just to keep your total calories under control and not worry about types of fat, with the exception of not eating any trans fats and prioritizing fatty fish if you can.

<comment><USER28> Good comment. A few things:

>\- polyunsaturated fats are the category that includes omega 6 and omega 3 fatty acids. Even further, omega 3's can be ALA (from plants) or DHA (e.g. salmon) variety. Omega 3's and in particular DHA have been shown to have anti- inflammatory and other health properties.

You missed EPA which is also in fatty fish. ALA doesn't convert very well in humans to DHA or EPA. So eating lots of flax to get Omega3 is pretty useless.

Opinion: The conclusion I came to a few years ago is that we have too much PUFA in our foods, of which Omega-6 is just one form. Eating fatty fish and cutting down on vegetable oils high in O6 help to restore a more natural ratio that humans are more tolerant to. But ultimately saturated fats are intended to be the primary fuel.

<comment><USER29> Good point on PUFA, that was probably worth making it into my conclusion too.

In my home cooking I've started using macadamia nut oil (similar profile to olive oil, it's high in monounsaturated fats) in place of vegetable oil. You can get it on Amazon and it has a more neutral, slightly nutty flavor and a higher smoking point than olive oil, so it's great for slightly higher temps or cooking foods that you don't want to taste like olive oil.

<comment><USER30> How does macadamia nut oil compare to olive oil on price per liter? Is it within a factor of 10?

<comment><USER29> There's such a range of olive oils, but I think it's roughly the same price for a similar quality. It's just kind of hard to find.

This is the one I buy (it's been prime before, looks like right now it's not) so $0.52 an ounce.

[1] [https://www.amazon.com/Macadamia-Bottles-Cold- Pressed-100/dp...](https://www.amazon.com/Macadamia-Bottles-Cold- Pressed-100/dp/B00LWFLXTE)

<comment><USER30> Thanks. That isn't unreasonable.

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER31> I think that generalizations on fats in diets don't work for analyzing different diets because of other factors like how much processed foods, sugar, and meat are in a person's diet.

My wife does well eating lots of butter and more meat. I do well by eating lots of vegetables. The only thing our diets really have in common is the avoidance of packaged/processed foods. It is some work, but people need to pay attention to how eating different foods make them feel, and over a long period of time.

<comment><USER32> You inadvertently seem to be avoiding grains and carbs. Every livestock farmer knows nothing makes fat mammals quite like high grain intake.

Government dietary recommendations on grain intake have increased with excellent correlation to very little other than re-election donations by grain farmers.

<comment><USER31> I frequently eat quinoa and brown rice, but only very small portions. Also, some veggies contain a lot of carbs.

</comment></comment></comment><comment><USER33> Like almost all nutritional studies, the evidence here is circumstantial and should be read with significant skepticism. Stephen Pauker, a professor of medicine at Tufts University and a pioneer in the field of clinical decision making, says, "Epidemiologic studies, like diagnostic tests, are probabilistic statements." They don't tell us what the truth is, he says, but they allow both physicians and patients to "estimate the truth" so they can make informed decisions.' (Excerpt from Do We Really Know What Makes Us Healthy by Gary Taubes [http://www.nytimes.com/2007/09/16/magazine/16epidemiology-t....](http://www.nytimes.com/2007/09/16/magazine/16epidemiology-t.html))

If you look at the larger body of evidence beyond this study, there are major reasons why institutional wisdom continues to advocate for the consumption of mono and polyunsaturated fats over saturated fat. For example, a larger 2016 cohort study of 115,000+ participants concluded high dietary intakes of saturated fat are associated with an increased risk of coronary heart disease ([http://www.bmj.com/content/355/bmj.i5796](http://www.bmj.com/content/355/bmj.i5796)).

Eating healthier is all about what categories of food replace current calories. If similar studies continue to show vegetable oil consumption is not protective against heart disease, it will probably make more sense to advocate replacing vegetable oil calories with fatty nuts and avocados that are much more nutritiously dense than oils (my preference for where to get fats). To jump to the conclusion we should all eat more butter based on this one study of n=9,423, however, is bad logic.

<comment><USER34> I would normally agree with you, but did you actually read this study or the article? This is not the usual "epidemiologic" nutritional study. This was a "rare randomized controlled trial." It was in fact a double blind randomized controlled study: [http://www.bmj.com/content/353/bmj.i1246](http://www.bmj.com/content/353/bmj.i1246)

<comment><USER33> You make a fair point on the quality of the research technique. I did skim through the study and conclusions and don't deny double blind randomized control trials are historically the golden standard of scientific evidence ([http://ebm.bmj.com/content/early/2016/06/23/ebmed-2016-11040...](http://ebm.bmj.com/content/early/2016/06/23/ebmed-2016-110401.full)). Other randomized control trials have found polyunsaturated fat in place of saturated fat reduces Coronary Heart Disease events (see this meta-analysis of 8 randomized control trials, n=13,000+ [http://journals.plos.org/plosmedicine/article?id=10.1371/jou...](http://journals.plos.org/plosmedicine/article?id=10.1371/journal.pmed.1000252)).

It's no doubt an interesting study and makes me question recommendations to consume oils. Still, based on current scientific evidence, there is good reason to be cautious about consuming more butter / saturated fats as is being advocated in numerous comments on this thread. As a reminder to those reading, there is strong evidence to supports nuts are a much better source of fat for health than both oils and saturated fat. Here's a meta-analysis of two cohort studies of 110,000+ that found nut consumption is inversely associated with total and cause-specific mortality ([http://www.nejm.org/doi/full/10.1056/NEJMoa1307352](http://www.nejm.org/doi/full/10.1056/NEJMoa1307352)).

</comment></comment></comment><comment><USER35> That whole myth will inevitably be revealed as a coup by the soybean industry, right? Right up there with the hogwash of the food pyramid.

<comment><USER36> And big sugar and corn.

<comment><USER37> It's a giant cornspiracy.

</comment></comment></comment><comment><USER38> What you really need is a study comparing saturated fats, ideally from butter AND from coconut oil, with monounsaturated fat which is the plant fat recommended as healthiest (olive oil, avocados, almonds), not polyunsaturates that no-one claimed was particularly healthy to begin with. It also needs to looks at all cardiac events, not just death (having cardiac events can reduce life quality).

If you read the wiki about saturated fats [https://en.wikipedia.org/wiki/Saturated_fat_and_cardiovascul...](https://en.wikipedia.org/wiki/Saturated_fat_and_cardiovascular_disease_controversy) it's clear that there's no benefit from saturated fats, but potential downfalls.

A more useful headline: "Replacing butter with vegetable oils high in monounsaturated fatty acid reduces risk of cardiac events and neurological disorders" [https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3705810](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3705810)

So much butter confirmation bias here.

</comment><comment><USER39> One of the most remarkable snacks I've ever had was served on a trawler in the North Sea - a large number of butteries (pastries from the North East of Scotland which, as the name suggests, are made with a large amount of butter) layered in a deep baking tray and covered with a couple of pounds of salted butter and then baked until nice and hot.

Possibly the most delicious thing I have ever consumed NB (it was shared among the crew of 6 or so).

<comment><USER9> That sounds really delicious. But what does it have to do with heart disease risk?

<comment><USER39> Well, means _my_ heart attack risk is lower :-)

</comment></comment></comment><comment><USER40> What would certainly help is adhering to the WHO recommendation of having a maximum of 25g (0.9 ounces) of sugar daily.

</comment><comment><USER9> Isn't the Omega-6 to Omega-3 ratio one important measure of how heart-healthy a diet is? This could at least in part explain increasing heart disease risk.

I assume using lots of Omega-6 oil would push the ratio to even more unhealthy levels than what a standard american diet has.

</comment><comment><USER41> I've stopped eating oil, and it's helped me significantly. So here are a few articles about no oil diets:

[http://www.nomeatathlete.com/oil/](http://www.nomeatathlete.com/oil/)

[http://engine2diet.com/the-daily-beet/no-oil/](http://engine2diet.com/the- daily-beet/no-oil/)

[http://www.theglowingfridge.com/top-3-reasons-to-reduce- or-e...](http://www.theglowingfridge.com/top-3-reasons-to-reduce-or-eliminate- oils-in-your-healthy-diet/)

[http://www.miaminewtimes.com/restaurants/oil-free-plant- base...](http://www.miaminewtimes.com/restaurants/oil-free-plant-based-diets- extreme-or-extremely-necessary-6581738)

</comment><comment><USER12> What about coconut oil? :)

<comment><USER28> The article is focusing on polyunsaturated fat, linoleic oil.

Probably fine sticking with saturated fat coconut oil (and butter, lard, ghee, etc)

</comment></comment><comment><USER42> But what does it reduce the risk of what we DO NOT KNOW is happening to us? Perhaps a disease or affect that is difficult to measure immediately, but is affect-ing us ul-tim-at-ely.

</comment><comment><USER43> what about replacement with coconut oils?

Would love to see a comparison.

</comment><comment><USER44> It does reduce cow deaths though

</comment><comment><USER6> blogspam of:

[http://news.unchealthcare.org/news/2016/april/did-butter- get...](http://news.unchealthcare.org/news/2016/april/did-butter-get-a-bad- rap)

(from April 2016)

ADDENDUM: It was also covered in _The Atlantic_ at the time, for a more general audience:

[https://www.theatlantic.com/health/archive/2016/04/is- vegeta...](https://www.theatlantic.com/health/archive/2016/04/is-vegetable- oil-really-better-healthier-for-your-heart-lower-cholesterol/478113/)

<comment><USER45> Ok, we changed the URL from [http://sciencebulletin.org/archives/460.html](http://sciencebulletin.org/archives/460.html) to the Atlantic article you mentioned, since it gives better context.

(We won't change the title because of the Betteridge trigger.)

<comment><USER46> What's the Betteridge trigger?

<comment><USER21> [https://en.wikipedia.org/wiki/Betteridge's_law_of_headlines](https://en.wikipedia.org/wiki/Betteridge's_law_of_headlines)

</comment></comment></comment></comment><comment><USER47> I'm a software engineer with a huge ego and thus an opinion on this.

<comment><USER45> Please stop posting unsubstantive comments to Hacker News.

Edit: actually, you've done this so much already that we've banned this account for trolling. If you don't want it to be banned, you're welcome to email firstname.lastname@example.com and give us reason to believe that you'll follow the rules in the future.</comment></comment>


Using enzymes to break down and recycle plastic waste - <AUTHOR> https://www.nature.com/articles/s41586-020-2149-4 <comment><USER2> Very interesting!</comment>


Aerial ropeways: automatic cargo transport for a bargain - <AUTHOR> http://www.lowtechmagazine.com/2011/01/aerial-ropeways-automatic-cargo-transport.html <comment><USER2> It was common for larger manufacturers up till the 1950's to have aerial systems like this to move things from the main stores to the manufacturing plant and back, even in little Perth Western Australia.</comment>


32TB of Windows 10 internal builds, core source code leak online - <AUTHOR> https://www.theregister.co.uk/AMP/2017/06/23/windows_10_leak/ <comment><USER2> Looks like the story is misleading, as a forum post on the source indicates [1].

[1] [https://www.betaarchive.com/forum/viewtopic.php?t=37282](https://www.betaarchive.com/forum/viewtopic.php?t=37282)</comment>


The Four Month Bug: JVM statistics cause garbage collection pauses - <AUTHOR> http://www.evanjones.ca/jvm-mmap-pause.html <comment><USER3> _I don 't know exactly why the Linux kernel does this, but the pauses do not seem to occur for reads, so the Linux kernel is marking these pages read-only. A friend suggested this is the kernel's way of reducing the write I/O rate under overloaded conditions. If you know exactly why the kernel is doing this, I would love to hear it._

What is happening is that the JVM is dirtying a previously clean page (this also happens in your test program, because the dirty pages in your mmap'ed file are being regularly written out - and therefore made clean - <USER2> background writeback).

If, at this point, the global dirty limits are exceeded (/proc/sys/vm/dirty_bytes and /proc/sys/vm/dirty_ratio) then the task will be paused to throttle the generation of dirty pages.

</comment><comment><USER4> This is by design, these are called "stable pages".

In some circumstances, the kernel has to ensure that pages aren't modified between initiating and completing the writeback for that specific page.

Btrfs is a copy-on-write filesystem, so it ends up needing to use this guarantee more often than the others. This is something the btrfs developers are actively working on improving.

Here's a good article describing this in a bit more detail: [https://lwn.net/Articles/442355/](https://lwn.net/Articles/442355/)

EDIT: Fix a typo

</comment><comment><USER5> BTW, I'm pretty sure that this blocking behavior is the best choice (among bad choices). If I memory map a file, I can set bits in that buffer at a much higher rate than the kernel can write those bits to disk... So the choices are: block the writing thread until the kernel can catch up, or simply drop some of those writes... At least with blocking my writes, I have a chance to notice the issue (in my application, this would cause a chain reaction of threads to backup and ultimately block resulting in me dropping network packets)...

<comment><USER6> The writes block? How can that be?

The only guarantee when you write to an mmaped page is that your wrote to the memory, whether or not it makes it do disk is up to many different things. So before you can write to the memory, it needs to have the right contents, that can mean a read has to finish, it can also mean pages have to get murdered to free up for you to have the memory to read in to. I can't think of how the write itself can actually block unless a read is required which hasn't finished (like the file is in read/write mode or something) in fact, other than a pagefault, there is no way it can be a blocking operation, the pages are stitched in to the processes page tables. At least I can't think of how it can block on a write right now, I've had a couple glasses of wine with dinner though. [edit] m_time update makes some sense, that blocks though?

In write only mode there are optimizations to not require the read.

<comment><USER7> > I can't think of how the write itself can actually block unless a read is > required which hasn't finished (like the file is in read/write mode or > something) in fact, other than a pagefault, there is no way it can be a > blocking operation, the pages are stitched in to the processes page tables.

You've almost got it. The mmaped pages may be in the process page table, but they may be in the page table as read-only: if the process tries to write to the page, the process traps into the kernel. If there are few dirty pages, the kernel will mark the page dirty, make it writable from the process and make the process runnable again. Apparently, if there are a lot of dirty pages, the kernel will not fill the request immediately, it will wait. While it's waiting the process is not runnable (other processes with the same memory space would continue to be runnable)

<comment><USER8> So a page fault

</comment></comment></comment></comment><comment><USER9> You know, it is pretty funny that some people on Reddit linked to a talk from aaronsw (AKA tenderlove) about Ruby on Rails performance issues and performance regressions. In the middle of the video he cracks up and points out he went down a tangent path because that Ruby profile was built of a gem that called into Ruby MRI's C API. So he worked his way through the gem developer, and then the Ruby dev who wrote the C API. Neither knew what was going on.

[https://www.youtube.com/watch?feature=player_detailpage&v=JM...](https://www.youtube.com/watch?feature=player_detailpage&v=JMGmaRZtgM8#t=1450)

Turns on the profiling data where there was a discrepancy between CPU times and Wall times was only OS X because of a problem with a trap() call on OS X specifically, not any other platform. His moral of the story: even profilers have bugs.

[https://www.youtube.com/watch?feature=player_detailpage&v=JM...](https://www.youtube.com/watch?feature=player_detailpage&v=JMGmaRZtgM8#t=1608)

I think I am seeing a pattern today.

<comment><USER10> ps I think you got some aarons mixed up

<comment><USER9> Yes, I did get the Aarons mixed up. Thanks to both of you for noticing.

</comment></comment></comment><comment><USER11> Wonder if it deals with dirty write back. That is a Linux behavior for writing dirty pages to disk. If writes come in at a high enough rate, Linux will hard block the writing thread until pages are written to disk.

Before that usually it spawns a bunch of pdflush processes to flush data out in the background, but if those can't keep up then it moves to blocking the process. On older systems and older spinning drives, blocks could take seconds even.

See /proc/meminfo for these two entries:

       Dirty:                 4 kB
       Writeback:             0 kB

Dirty are the current dirty pages, and writeback is the current amount being written out.

</comment><comment><USER12> Good catch.

This would make a good case study in Heisenbugs. GC delays that only happen when you're collecting GC statistics.

<comment><USER13> I had a hand-assembled binary that was always crashing on out-of-bounds memory access. But whenever i loaded it in the debugger, it was always perfectly fine.

That was the day i learned about _NO_DEBUG_HEAP !

</comment></comment><comment><USER14> I have not seen any link to a bug report at [http://bugs.java.com/](http://bugs.java.com/)

What is reported?

</comment><comment><USER15> Debuggers, profilers, monitoring tools, etc. have an associate overhead.... how is this a bug?

</comment><comment><USER16> If Hotspot didn't require global safepoints all the time this wouldn't be such a big deal.

I have been wondering if Zing handles threads blocked in memory mapped files better.

</comment><comment><USER17> Would -XX:-UsePerfData also work?

I noticed jankiness in my eclipse and adding that flag seemed to help.

</comment><comment><USER18> Direct reclaim shines again!

<comment><USER19> This has to do with the JVM's monitoring, which, among many other things, monitors memory allocation/deallocation, which just happens to be automatic. It has nothing to do with automatic vs. manual memory management.

<comment><USER18> Direct reclaim is the precise name for what the linux kernel is doing in the case called out by the article.

[http://lwn.net/Articles/396561/](http://lwn.net/Articles/396561/)

But thanks for the snark anyway!

<comment><USER19> No snark, but I did completely misunderstand your comment[1]. In any case, I apologize, and I learned something new!

[1] BTW, if you're mentioning a term that isn't widely known, it's helpful to link to a definition.

<comment><USER18> Right on, my comment could have been much more clear, I will do so in the future :).

</comment></comment></comment></comment></comment><comment><USER20> Talk about perseverance... Really is inspiring.

</comment><comment><USER21> I blame oracle

<comment><USER22> While oracle is certainly to blame for a great deal of things in life, your comment would benefit from some explanation / background regarding this specific issue, otherwise it's value is debatable.</comment></comment>


Show HN: My second Android app, looking for critques - <AUTHOR> http://rocketships.ca/blog/android-thing-for-saving-money-on-springs-and-avoiding-math/

<comment><USER2> Congratulations on finishing your app. It's targeting a very very very specific user base, but it's neat all the same. I'm not sure you'll get much love on HN...

Maybe you could add some bulk with more mechanical equations for real world usage, then flesh it out into a mathematics-for-engineers application of some sort. I'm sure no one remembers all their Mechanical formulae off the top of their head!

One thing I would say is have a look at Holo UI. The cupcake/donut styles are looking a bit worse for wear nowadays.

Code on!

<comment><AUTHOR> Thanks for the tip on holo! And yeah, my end game is to kind of get together a bunch of apps that are useful for racecar builders. All of them together, well tested and well explained, might be worth someone paying for.

</comment></comment><comment><USER3> Congratulations on finishing. I'd agree with jonsherrard, try to upgrade to Holo UI when you get a chance. Your app will instantly look better. Also if you learn something about android graphics maybe you could provide a dynamic image of the spring that changes as you enter values so people know if they're making a mistake (sounds hard, but possible).</comment>


Chrome's JavaScript challenge to Silverlight - <AUTHOR> http://news.cnet.com/8301-1001_3-10034365-92.html <comment><USER2> I guess the author's spell check doesn't work for JIT-ed (the article kept saying "jittered")</comment>


I've spent five years writing a JavaScript framework - <AUTHOR> https://medium.com/@jcormont/ive-spent-5-years-writing-a-javascript-framework-on-my-own-af1201f4075c <comment><USER2> A priori I'm not too crazy about the architecture and nomenclature, but I have to say that having zero dependencies is a goal more projects should have.

The JS ecosystem is pretty fragile because every project depends on hundreds of other projects.

The other day I had to go back to a 2 year old Vue project. I found that many of the dependencies had vulnerabilities so I started updating those. Then nothing worked because the newer versions changed its API or didn't support such and such feature. In the end I had to reconfigure all the project from scratch. And this project was just 2 years old...

<comment><USER3> Devil's advocate here.

If you hadn't used those libraries, you would have had to implement functionality from those libraries in your own code. Presumably, your code would be subject to the same vulnerabilities and probably require even more work to update. After all, API changes are generally easier to handle than design changes.

</advocacy>

I do agree that tiny, insignificant libraries like "left-pad" are bad. Imo, a good dependency is one that significantly reduces the design complexity of a project.

<comment><USER4> The problem is that you need one function and you're pulling an entire library. Also you have some limited use-case (e.g. you don't have to support IE 6), but libraries tend to accumulate all the cruft in the world over the years, so you're pulling and executing lots of unnecessary code. JavaScript is too dynamic to reliably delete unused code, so even approaches like tree shaking, etc do not work well. And left-pad style libraries has its own problems, yeah.

There are universal utility libraries. jQuery for DOM, underscore for general utilities. It's OK to use them, because everyone knows them. But if you miss some tiny function, just write it yourself. DRY principle often brings more harm than good.

<comment><USER5> I would argue whether DRY enforces 3rd party libraries usage. "Yourself" touches the code you wrote, noone asks you to use already written solutions.

</comment></comment></comment></comment><comment><USER6> A lot of C programmers build this "utils" folder that they carry around every project, I'm sure they keep refining the content of this folder through the years with things they find and adapt to their taste, or refinements of their own implementations of different algorithms and data structures.

Seems like you did something similar with regards to building web applications (5 years working on this framework). Good for you! And if you can convince others to use your stuff, all the better!

I'm trying to focus on writing my own tools too for the kinds of projects I work on, including fronted development (instead of always be trying to catch- up with the latest frameworks) [1]. Can't completely ignore the trends or fashions, though, sadly. A hard balance!

1: [https://www.youtube.com/watch?v=VvOsegaN9Wk](https://www.youtube.com/watch?v=VvOsegaN9Wk)

<comment><USER7> I do the same thing, but it doesn't play nicely with the modern JS ecosystem. I have a library of re-usable JS/HTML/CSS components that I can sling around at will. But I can't use them on React of Vue projects so easily.

One of the selling points of React/Vue was that components were portable. But I have seen so few people actually re-use anything in the real world and you didn't need a library to make re-usable components to begin with.

I believe that re-usability isn't a language or framework feature, it has to be a personal or team choice to prioritize it. It could be as simple as a utils folder or as organised as a bunch of modularized git repos but ultimately you have to choose to organise that way.

</comment></comment><comment><USER8> > No revisions to the architecture, ever.

I'd love to have this sort of confidence in my ability to foresee everyone's future needs, but I don't. I mean, I agree that having to do full rewrites every time your framework's version bumps, but promising no changes ever seems more constricting than necessary.

<comment><AUTHOR> Sure this is a major restriction but there are lots of systems out there with architectures that never changed. I think accepting major changes from framework authors is something we learnt over time, from projects with lots of people who have lots of ideas and the project ends up swinging in all directions.

<comment><USER9> Just remember, coming out with a V2 that has no upgrade path, while still supporting and improving V1 and V2 doesn't count. ;)

</comment></comment></comment><comment><USER10> This is a neat project. Personally, I can't wrap my head around 100% code "views". A million years ago, I wrote some (almost) vanilla JavaScript projects where I would do a lot of document.createElement('...') and I never really liked it, but it got the job done, and it only required that I understood JavaScript and the DOM. I could make helper classes in individual libraries that fit my needs. But I would not want them in a framework. Or at least, if I'm honest, I might want them in "MY" framework, but never one that I would think ideologically could be used broadly by a variety of developers.

I like template engines to some degree, and I love binding like you find in Angular. But the first few times I read Angular code, I didn't "get" it, because it seemed like there was some magic somewhere. Some automatic things that happen without being explicit. (This was particularly prevalent in AngularJS, in my opinion.) Never a fan of that. So an explicit coded view would be preferable. But I think it's probably going too far towards trying to make web views in code. Similarly, I dislike React for that reason. I'm not religiously opposed to markup... HTML and CSS from being controlled in your code. But I still struggle with it, and prefer to do what I can to keep them inside templates, as HTML and CSS, and not some abstraction.

I do love TypeScript, so for my purposes, I'll happily use Angular 8, having never lived through the original AngularJS 1.x -> Angular 2.0 transition that made so many developers unhappy. But I appreciate what you've done, as well as respect the work and time you've put into the documentation web site. Cool stuff!

<comment><AUTHOR> Thanks for sharing your views. The way templates are implemented is definitely a matter of personal preference, I personally don't like mixing two different languages, always seemed like kind of a hack to me. With this restriction Typescene is more like Flutter and SwiftUI, these ended up being very similar. Can't really compare to React and Vue or even Angular, but I can see that some people do prefer looking at XML and that's fine :)

</comment></comment><comment><USER11> Sticking to a project for five years and releasing it to the world is not an easy task. I wish you and the project best of luck.

</comment><comment><USER12> Cool project, but I dislike the semi-arrogant tone taken by the author.

> _Have you ever opened a years-old project that used the favorite Web > framework-du-jour, and tried to make sense of it now? Would you be able to > maintain such a piece of software?_

Yes? Even if the answer were no, why would this framework be any different? The author seems to suggest that his perspective on "maintainable" is universal when it's actually just his opinion. Having strong opinions is fine, we all have opinions, but trying to play up your own framework as if it's objectively more maintainable is eye-roll worthy, _especially_ in the context of JS land.

> _Who will remember the (hypothetical) peculiarities of the willUpdate method > in version 14.2.132 of framework X?_

This is a banal criticism that can be applied to any piece of software that introduces breaking changes. The idea that the author will never release breaking changes is absurd, especially on the web.

> _Code shouldn't have to be completely rewritten to be compatible with the > next major version of Typescene_

"completely" and "compatible" are pretty vague caveats. Is it a complete rewrite if I have to rewrite 25% of code? 50%? 60%? I'm sure someone can point out an example of a framework that required "a complete rewrite" in order to be "compatible" with the next major version, but this isn't typical.

> _No-nonsense object-oriented (OO), event-driven approach._

OO is nonsense (someone's opinion).

> _you'll only need external modules to import complex UI components or > application behaviors that aren't included in the framework itself._

You'll only need external modules for complex UI and behaviors that aren't included in a minimalist framework... So, just like every other framework out there.

> _Most importantly, Typescene hasn't been invented overnight, it's not a > Minimum Viable Product that introduces some clever new paradigm_

What is an example of a framework that was "invented overnight" that introduces some clever new paradigm?

I'm not trying to come down on the author, and I'm not making a technical criticism of the project, but the "everyone else's shit stinks but mine smells like roses" is a turn off, for _me_ personally.

<comment><USER13> It didn't really bother me, but I might be reading it more strongly in the context of this being a single-person job. If a project took a strongly hyped tone while also having a large amount of money backing it, I might be annoyed (heck, this isn't a hypothetical, it happens all the time from Facebook/Google/Amazon!), but this is some random individual who is trying to explain why their project has advantages, when other frameworks are mostly backed by large corporations. In that context my reaction is more, "hey, good hustle, we'll see how it pans out". Maybe it's good, maybe it's not, but if it's not, it hardly threatens me, because there's no money and little manpower behind it anyway. There are other strategies to take with a more humble tone, but I'm not really _offended_ by this strategy, and there's a risk that a more modest strategy would result in nobody giving it a second thought even if it _did_ have significant pros. Not that my reaction is correct or anything, just thought I'd add a subjective reply.

<comment><USER12> Sure thing. I'm not suggesting that there is anything _wrong_ with the framework, and just because I find the tone of the blog somewhat arrogant doesn't mean that I'm _offended_ by it; sometimes arrogance has a reasonable explanation, I just don't see that here.

> _trying to explain why their project has advantages_

IMO you can do that without the tacit suggestion that the competition produces unmaintanble code, or at least, explain why this framework is objectively more maintainable and not just one's particular opinion of what is maintainable.

> _if a project took an arrogant tone while also having a large amount of > money backing it, I might be annoyed_

I'm not really annoyed either way, but in my totally subjective opinion a lone developer should take a more humble tone, it's not as if backing by a large corporation correlates with non- maintainability.

</comment></comment></comment><comment><USER14> > the component factory pattern used by Typescene doesn't sacrifice > readability: <foo x="y">...</foo> simply turns into Foo.with({ x: "y" }, > ...).

The JSX version is more readable tho. It looks like HTML. Everybody knows HTML.

<comment><AUTHOR> Not saying that HTML isn't _also_ readable (although... once the number of attributes grows larger I always end up with a bit of a mess, but that might just be me).

The real feat here is getting rid of the hacky way that XML and/or template strings and JS are mixed together in the compiler, without _sacrificing_ readability per se.

<comment><USER15> If it would be 2013 the "hacky" way would be acceptable, but JSX is a de-facto standard that is supported by _all_ tools used in production (incl. TypeScript, Babel, your favorite colorizer, language server extensions, ...).

Imho the proposed way sacrifices readability a lot (what does "with" do? is it like the infamous JS with? what is the first, second, third, ... argument?).

<comment><AUTHOR> Just read it like natural language. Where it says UIButton.with({ label: "OK" }), that's a Button With a Label of OK. Editors with TypeScript-aware autocomplete (e.g. VS Code) will suggest most of the identifiers here, and tell you what the arguments are for so in practice this works better than you might think.

JSX is a de-facto standard, and it might be convenient in the way that PHP is convenient, but that doesn't mean it's not inherently a hack :) ...

</comment></comment></comment></comment><comment><USER16> So many frameworks do this, and I can't understand why [1]:

        onClick: "checkTodoItem()"

Why? What compells people to go ahead and say: yes, we're writing everything in JS/TS which has perfectly fine support for actual functions. That's why we're going to arbitrarily use strings that evaluate to function calls in some parts of our framework.

[1] See views [https://typescene.dev/docs/introduction/overview](https://typescene.dev/docs/introduction/overview)

<comment><AUTHOR> The onClick event handler refers to a method on an object that exists when the component is _rendered_ , not when the template is parsed by the JS interpreter. So, to refer to the method itself you'd need to do something crazy like go through .prototype or something.

Anyway, yes Typescene does let you supply an actual function in place of the string here, but for me that ruins the 'neat' flow of the view and starts mixing views with logic.

<comment><USER16>
       onclick: () => function_to_be_defined_at_runtime()

This also lets you deal with functions that are defined at runtime. Moreover, this actually lets you provide types for the expected callbacks.

> but for me that ruins the 'neat' flow of the view and starts mixing views > with logic.

How is providing a reference to a function "logic"? You still provide a reference to a method, only you do it in an unspecified stringly-typed DSL.

Be sides, you're using these magical strings in so, so many places: [https://news.ycombinator.com/item?id=20310666](https://news.ycombinator.com/item?id=20310666)

This is anything _but_ strongly typed. This is _stringly_ typed.

</comment></comment></comment><comment><USER17> I've read the article and part of the documentation and I still don't have an idea what's the added value?

Looking at the code doesn't seem specially appealing:

      export default UICell.with(
      UICenterRow.with(
        UILabel.withText(bindf("${foo}, world!")),
        UIPrimaryButton.with({
          label: "Do something",
          onClick: "doSomething()"
        })
      )
      )

<comment><USER18> I don't think it's in good taste to use a reserved word like "with" in the API either. And it feels like it's being used in places where a plain function call would suffice (you call a function "with" params).

</comment></comment><comment> pcj-github Where's the app that you built with it? If you have not actually used your own "framework" to build a meaningful app, I'd argue you've spent 5 years poised crouching at the starting block waiting to hear the gun go off. Otherwise, you can't possibly even begin to understand the realities of working with it. This is why popular frameworks tend to come out of large active shops that have real problems to solve.

<comment><AUTHOR> I do mostly non public work, LoB apps in particular.

<comment><USER19> Life of Brian? Lots of Babies? Library of Barcelona? Linux on BeOS?

<comment><USER20> Line of Business I presume

</comment></comment></comment></comment><comment><USER21> I can run Clojure libs that are 5+ years old on the latest clojure with no code changes. I applaud the author for designing a framework that keeps devs off the absolute waste of time that is the upgrade treadmill.

<comment><USER22> This is such a great kept secret. Most people just scoffs of when they see a project on github not updated for a couple of years. Not with Clojure.

<comment><USER23> Even less with Common Lisp, in my experience. There's some rot, sure, and some dependencies that have disappeared — but there's a lot of things that are no longer under development because they're _finished_.

</comment></comment></comment><comment><USER24> Lots of respect for working on a project for 5 years and releasing it to the world. That's really hard.

Question - do you have financial goals with this project, or do you see it as a community / hobby project? If so, what are your plans to do that?

<comment><AUTHOR> I've mostly made this for use with my actual (paid) project work, so the idea was I 'might as well share'. Turned out to be much more work than I anticipated :) Definitely not a hobby project though, I'm hoping eventually a big enough community might pick this up.

<comment><USER25> > I've mostly made this for use with my actual (paid) project work, so the > idea was I 'might as well share'.

Have you made sure you got authorisation to release the code, or that you were in a case where you didn't need such authorisation? Because in a lot of cases the code is not the developer's property, it belongs to the company who paid him to develop it.

<comment><AUTHOR> Yup no worries, I work with my own standard contract and work like this is excluded. Valid point though, thanks.

</comment></comment></comment></comment><comment><USER26> The article sure hypes it up but the code doesn't really solve many problems for you. It's about the same level of a framework as Backbone.js but with way less features.

<comment><AUTHOR> Examples?

</comment></comment><comment><USER27> There's good old KnockoutJS too. I feel like code written in that will still be working in years to come.

</comment><comment><USER28> Is [https://typescene.dev](https://typescene.dev) itself developed using this framework or not ?

<comment><AUTHOR> Not the content itself. There's no need, it's generated by GitHub pages and works fine (and no issues with SEO).

The search popup is implemented using Typescene though.

</comment></comment><comment><USER29> This looks really nice! The class structure reminds me a lot of UIKit in iOS, which I really like. Having that layer of abstraction to build UI components for the web looks quite appealing. Nice job!

</comment><comment><USER30> [https://imgur.com/aJJ3nvD](https://imgur.com/aJJ3nvD)

<comment><USER10> An issue has been logged to the documentation web site, and the creator has been responsive. I'd imagine it'll be fixed in reasonable time.

</comment></comment><comment><USER31> The first commit was 3 years ago: [https://github.com/typescene/typescene/commit/9bc0d9844eed7e...](https://github.com/typescene/typescene/commit/9bc0d9844eed7e14cdc97ab7fce44450e62c1d34)

<comment><USER32> If this started as part of another app, it could have taken 2 years to isolate the framework as a standalone piece of work.

</comment></comment><comment><USER33> > a mission to build the most elegant framework ever

The only elegant thing I find about this framework is that it has no deps. A TypeScript-first framework would be a plus but I find the Typed API particularly inelegant with its usage of static methods to compose the UI which is particularly non idiomatic for JavaScript.

There doesn't appear to be any live examples you can experiment with which is a notable shortcoming for a modern JS framework and the only complete stand- alone example I can find is something called "first project" that was contributed 19 days ago:

[https://github.com/typescene/first- project/](https://github.com/typescene/first-project/)

The name doesn't fill me with confidence and the only example I could find has a webpack dependency which kind of throws out its "no deps" USP. I don't find anything compelling in that example that would entice me to use it over React, Vue or even just Vanilla JS - which I'd prefer to implement this particular example of which I'm not clear what value it adds that would justify adding a dependency to this JS FX.

This file is the most code I could find:

[https://github.com/typescene/first- project/blob/master/src/a...](https://github.com/typescene/first- project/blob/master/src/activities/main/view/index.ts)

It's full of "magic string" APIs where there's no way you could intuitively guess what the values would be, e.g:

       - maxWidth: "100vw"
       - gravity: "center"
       - revealTransition: "fade"
       - borderColor: "@separator"

The benefit of using TypeScript is that all these values could be typed to assist during development and type-checked to validate any runtime errors.

Magic strings are even being used for callbacks that looks like it uses its own unknown DSL in different APIs of which is going to be unknown to anyone but the author:

        - onEnterKeyPress: "addTask()"
        - state: bind("object.complete")
        - onClick: "+ToggleTask"
        - tl("{@text/50%}${todo.nRemaining} task#{/s} remaining")
        - hidden: bind("!todo.nCompleted")

The docs are particularly lacking in working examples of which the bulk looks like an API class dump which isn't a useful onboarding experience for anyone who wants to learn and use the framework.

Honestly if headline didn't say it took "5 years" to implement I would've guessed its a few months effort max - nothing like the refined, battle-tested, real-world validated framework this article proclaims it to be.

</comment><comment><USER34> This looks interesting. Well done on making something and putting it out there!

</comment><comment><USER35> Why provide a layer of indirection between the developer and the DOM? I already know HTML elements and the DOM API, why should I want to learn a hole new framework to construct them?

<comment><USER9> Everything these days abstracts the DOM. Why use _anything_ then?

<comment><USER35> It's not abstraction it's indirection. You're not using <a> or <button> you're using UIButton and UILink and whatever a UIExpandedLabel or a UISelectionController does.

</comment></comment></comment><comment><USER36> > a mission to build the most elegant framework ever

This is where it lost me. Why is elegance a priority? What problem is elegance trying to solve here? Elegance is just a feature, that ill-suits many people who might be better served by others. Also seeing the examples in the homepage don't seem very "elegant":

        // A first Activity, similar to the Controller in an MVC approach
        export class MainActivity extends
          PageViewActivity.with(view) {

<comment><USER37> Examples aside, here's how I think about elegance. Sometimes you run across, or imagine in your head, or accidentally stumble into writing some Especially Good Code. The code just seems to work, extends easily, repels bugs, scales appropriately, etc etc.

I think what's happened in these cases is, typically by luck, you've written code that matches up very simply and beautifully with an undescribed and perhaps indescribable pattern that's present in a larger problem domain. Like poetry, your code expresses the nuances of that problem in a way that prose simply can't (efficiently). You can't always tell or explain what's so great about it, but working with it is a pleasure, and it rarely lets you down. To me, that's the ideal of elegant code.

</comment></comment><comment><USER38> OP is almost definitely an Android developer.

<comment><USER9> Why do you say that?

<comment><USER38> The style, nomenclature, choice of vocabulary are those of someone who has spent a lot of time with Android Java.

E.g. see this:

[https://developer.android.com/training/basics/firstapp/start...](https://developer.android.com/training/basics/firstapp/starting- activity#java)

Compare it to OP's framework documentation.

</comment></comment></comment><comment><USER39> So basically what this does is that instead of writing HTML I can now write everything in Javascript, i.e <buttton> becomes "new Button" and then I can write nested JavaScript code like I write nested elements in HTML.. is that it?

<comment><AUTHOR> Yes, for the View part. There are also other components that handle logic and your data model.

Writing 'new Button' for every single UI component would be really cumbersome, that's why there's also a 'template' syntax which uses static methods (Button.with(...) which creates a button factory).

</comment></comment><comment><USER40> 0 dependancy project! That is a worthy goal. Think all projects should have a live counter of how many dependencies they have and highlight the highest risk ones

</comment><comment><USER41> What does this framework actually do?

The introduction bashes some malpractices of other frameworks, but it doesn't tell me why I would use this framework over Vanilla.js.

<comment><AUTHOR> I guess a good rule of thumb would be if you don't see the benefit of using a framework for your project, you probably don't need a framework in the first place :)

<comment><USER41> I'm not shopping frameworks, I just found it peculiar that the marketing is all about what the framework doesn't do. It seems like you think that the word framework in itself describe the purpose.

</comment></comment></comment><comment><USER42> This seem to fully abstract the DOM and also CSS, so could probably make it compile to "native" like react native.

<comment><AUTHOR> Bingo

</comment></comment><comment><USER18> Where's the TodoMVC?

<comment><AUTHOR> Not quite, but maybe close enough: [https://typescene.dev/docs/guides/first](https://typescene.dev/docs/guides/first)

</comment></comment><comment><USER43> Looks very similar to mithril... with triple the size and no users

</comment><comment><USER44> _Strongly typed_

I would refrain from using this term since it doesn't have a single agreed upon definition.

<comment><USER45> Especially given the other comment here about using strings for handlers in views, which seems crazy TBH

</comment></comment><comment><USER46> Imagine if you spent 5 years trying to make the world a better place or fight cancer.

There is so tremendous time waste in developer world just inventing new langs or rewritting new frameworks that do the same.

<comment><USER47> Imagine if he spent 5 years becoming an heroin addict. There is so tremendous judgmental attitude in your comment. Let me guess, have you been changing the world and/or fighting cancer in the last 5 years?

<comment><USER46> there is no logic in this comparison. you can stare at a wall too.</comment></comment></comment>


Show HN: rtoml – a TOML library for Python written in rust - <AUTHOR> https://github.com/samuelcolvin/rtoml <comment><USER2> I'm interested to find out how you made the decision to use Rust for this project. It seems like it would have been much simpler to use Python directly. Were you trying to learn about the Rust-Python FFI? Was there a performance concern with a native-Python version?

<comment><AUTHOR> Performance was a slight concern, but more important was correctness.

This used the widely used and very stable toml library from rust.

It started because I tried the most popular toml library for python and found significant bugs and poor code quality. Some other libraries had fewer bugs but were very slow. Then I wondered how hard it would be to use the rust library from python via pyo3, and here we are.</comment></comment>


Chrome: plz fix security hole that has been around too long - <AUTHOR> http://www.google.com/support/forum/p/Chrome/thread?tid=42a84be03b8fd809&hl=en

<comment><USER2> I can understand why people would still want this fixed, but if you have saved passwords, someone can reveal them in any browser using just javascript (for example: [http://blog.amwmedia.com/post/3043988338/reveal-hidden- passw...](http://blog.amwmedia.com/post/3043988338/reveal-hidden-passwords-in- all-major-browsers)).

If you're concerned about other users stealing your passwords, don't let them use your profile at all.

</comment><comment><USER3> A Chrome representative said that they weren't going to fix this. I can't find the source. He/she said that they had a few arguments about this, but that they feel that by not showing your password they are creating a false sense of security.

Every browser has to store passwords in a way that's recoverable (as they need to be sent to the server), so if you store them and you lose control of your computer, you WILL most probably lose control of your passwords too, in every browser including IE9 (something this page, [http://www.thewindowsclub.com/chrome-firefox-show- passwords-...](http://www.thewindowsclub.com/chrome-firefox-show-passwords- plain-text-ie9), does not seem to understand).

</comment><comment><USER4> People still save passwords? I just let the cookies hang around. Haven't been logged out of anything for months.

Anyway, it has to be possible to retrieve the password in plain text for Chrome to be able to use it. Even if they remove the functionality to view it, someone could just make a tool - and when someone has access to your computer they could run said tool.

If someone malicious has access to your computer and it's not locked, you're pretty much screwed - that's not the fault of Chrome.

</comment><comment><USER5> For those who actually let their browsers store passwords I recommend looking for extensions that integrate the password storage with the native password management systems such as Mac OS X's Keychain, KDE's KWallet or GNOME Keyring. Some browsers may even support that by default. That at least ensures the passwords are stored encrypted and the browser can't access them without the user's reauthentication.

</comment><comment><USER6> This is a pretty good read on this subject: <http://developer.pidgin.im/wiki/PlainTextPasswords>

</comment><comment><USER7> Why doesn't chrome put in a master password or a security question/answer a user have to enter to reveal sensitive information?

</comment><comment><USER8> Could someone explain how this is a security hole exactly? Being able to access saved passwords is a feature, right?

</comment><comment><USER9> Isn't that why operating systems let you make separate password protected profiles?

Firefox does the same btw except they offer a master password, but what happens when you misplace that password? Chrome seemingly assumes that the profile password is that master password which seems like expected behavior to me, I mean how many nested passwords do you need to be satisfied?

Also if you have access to the machine saved passwords can still be dug up regardless.

</comment><comment><AUTHOR> Anyone with access to your computer can see your website passwords stored in Google Chrome in CLEAR TEXT. Seriously this is redic. Yes, there is a responsibility for a user to adequately protect their computer, but this is just sets people up for identity theft and bunch of other bad stuff. My 60 year old parents use Chrome, your grandparents probably use Chrome. Help them out, at least have a master Chrome pw to protect viewing things in clear text...

<comment><USER6> What do you think of Firefox having the same issue?

<comment><AUTHOR> Was not aware. I don't use FF for browsing. If they have same issue its just as bad. If someone wants to hack your computer they can, I get it. But not adding at least some level of security (profile level pw required to reveal clear text) does not seem right.

Also understand Chrome needs to be able to get at the clear text at some point, and that you can get at it with JS. Adding a session/timeout based master/login password (like ssh keychain for example) to autofill pw, would be one idea to plug some of the holes.</comment></comment></comment>


Grammar: What exactly are our rules comprised of? - <AUTHOR> http://www.economist.com/blogs/prospero/2015/04/johnson-grammar <comment><USER2> >> "just because something is common doesn't make it standard English"

At some level of commonness, surely this is impossible. What else makes something "standard English" besides how commonly it is used?

</comment><comment><USER2> In regarding the Geoff Pullum article mentioned ([http://chronicle.com/blogs/linguafranca/2015/04/13/a-certain...](http://chronicle.com/blogs/linguafranca/2015/04/13/a-certain- closeness/)), turning off automated grammar checking in your word processor is the first thing you should do.

</comment><comment><USER3> I wish I knew what Brad Johnston's idea for correct English pluperfect construction was. The article doesn't explain it, and reading his comments on other websites doesn't give me a good "ground-up" explanation, it only points out where other people are wrong.

<comment><USER4> I'm not sure, but I think it is that where a verb itself refers to a past activity, like develop, putting it in the past tense then adding a modifier is a triple whammy, making it ungrammatical.

<comment><USER5> The past tense is for a past activity. The past perfect tense is more complicated. From an online ref: [http://www.englishpage.com/verbpage/pastperfect.html](http://www.englishpage.com/verbpage/pastperfect.html)

 _" With Non-Continuous Verbs and some non-continuous uses of Mixed Verbs, we use the Past Perfect to show that something started in the past and continued up until another action in the past."_

Which is a more precise statement than it was just in the past.

Languages are full of such corner cases. I was once asked by a non-native English speaker what the differences were between the following phrases:

* I went to the store

* I was going to the store

* I have gone to the store

* I had gone to the store

* I had been going to the store

* I have been going to the store

All of the phrases refer to actions in the past. The differences between the phrases indicate where it was a past event that was one-off, or continuous, or whether it started in the past and continued to the present, or started in the past and ended in the past.

Language tenses exist for a reason. Simply denying them is delusional, IMHO.

</comment></comment></comment><comment><USER6> Looks like the writer listens to NPR: [http://www.npr.org/2015/03/12/392568604/dont-you-dare-use- co...](http://www.npr.org/2015/03/12/392568604/dont-you-dare-use-comprised-of- on-wikipedia-one-editor-will-take-it-out)</comment>


Ask HN: Cheap color copies for flyers? - <AUTHOR>

I need a quick way to get as many color copies of a flyer as possible.  I'm on a college campus with a startup that will benefit from this, but paying $0.50 / copy at kinko's is unacceptable.  Any tips? <comment><USER2> Getting Kinkos to run 1000s of color copies is like getting Pizza Hut to cater for a wedding. They can do it, but their limited capacity and selection can make it expensive and limited in scope.

Instead, find a regular printing company. They won't always be as easy to deal with as Kinkos (they might demand you supply press ready PDFs or the like) but they can quote you for pretty much any reasonable quantity going (any decent printer would be fine up to several thousand flyers with a few days turnaround) and give you a far better price (especially as the printing industry isn't doing so well right now).

For example, one of my clients here in the UK is a printer. They charge $267 for 1000 A4 (roughly letter size) color flyers. So 27 cents/copy but by my understanding printers in the US are _way_ cheaper than here. If you wanted only A5 (or whatever the US equivalent is) size, cheaper too.

<comment><AUTHOR> Thanks, I'll look into real printing companies. I've been trying to bum color prints from different folks and it just does not scale.

</comment></comment><comment><USER3> Search your area for a press company that does gang run printing. Might not be a good choice depending on your media size and layout, but it's often the cheapest thing going. In SF, I know a number of folks who use these guys: <http://www.clubcardprinting.com/>

</comment><comment><USER4> Ask Kinko's how many flyers you need to print to qualify for bulk pricing.

<comment><AUTHOR> i asked kinko's and they basically told me to do it myself, it would be cheaper. i was pretty surprised.</comment></comment>