We Need More Pessimistic Games - <AUTHOR> https://waypoint.vice.com/en_us/article/gynd8y/pessimistic-games-melancholy-silent-hill <comment><USER2> Why the hell would anyone want that? I've already spent most of my life feeling like I'm slowly drowning, I don't need a two-bit piece of unity shovelware to help me explore the feeling of being trapped within a doomed world of banal everyday evil.

<comment><USER3> You could make the same argument about books... why the hell would anyone _want_ to read 1984?

I'm glad we don't live in a world where all of the books, movies, and video games have been sterilized and sanitized and pumped full of diazepam.

<comment><USER2> 1984 is more than just pessimism, it's a warning that Orwell wrote because he hoped that there was time to change. Games like Mirror's Edge have a similar message: dark times are ahead if we don't take action. I read and play them in the spirit of preventing disaster and I can't imagine other people are much different.

Kunzelman writes that "pessimism, crucially, does not see a way out." The world cries out for a way out of global warming, food insecurity, nuclear proliferation: does it do any good for us to paralyze ourselves with imagined impotence?

<comment><USER3> Pessimism and optimism are different lenses to view the world, I don't think there's a solid case to be made that privileges one over the other. Looking at the world through either lens distorts what we see. Take global warming as an example. If I am optimistic, I could believe that we will curb carbon emissions and convert the world to use clean energy. If I am pessimistic, I could believe that we'll face severe ecological devastation and food shortages.

"Hope for the best, expect the worst" is only possible if you are capable of seeing both the optimistic solution to a problem and the pessimistic consequences for failing to solve a problem. If you limit yourself to only an optimistic or only a pessimistic viewpoint, you are crippling your ability to deal with problems rationally.

</comment></comment></comment></comment><comment><USER4> I've recently played Dark Souls 3 and it's depressing, as is Bloodborne; both games (spoilers etc) feel kinda meaningless in the end. The premise of Dark Souls 3 is that there's a cycle of light (fire) and dark, and the objective - not just for the individual instalments, but for the world as a whole - is to link the fire, so that the age of fire lasts for a little longer - but the other side, the age of dark, is inevitable (and optionally you can cause it). The world is old, every civilization has fallen and/or decayed, and there doesn't seem to be any way for it to get back to normal given how everyone's either undead or dying.

Bloodborne is a bit less hopeless, in that it feels like there's a pretty normal world outside of the game area. However, it's depressing in all three endings; spoilers again, the first ending is probably the least depressing one, where after defeating the final boss, you just kneel down in front of your guide / master (so to speak), accept your fate, and choose to forget all of the events. You just wake up in the morning as if nothing happened. In the second one, you fight and defeat your master, buuut an eldritch monstrosity that masterminded the repeating cycle comes in and eats you, turning you into the replacement of the guide. The final ending is where you defeat the eldritch monstrosity and are reborn yourself as an eldritch monstrosity, again (probably?) repeating the cycle.

No real happy endings there. It's all just bleak and meaningless.

<comment><USER5> One interesting thing about Dark Souls is that there is quite a bit of ambiguity around what the "age of dark" actually implies, and there's a lot of hints that it might actually be a beneficial state for humanity.

Personally I found Bloodborne to be even more hopeless. It's all based on a Lovecraftian view of the universe, where we're completely insignificant next to these higher order beings and concepts. There are also almost no happy endings for any of the NPCs, which contrasts with Dark Souls a bit. But again, that's a really good translation of Lovecraft into video game form!

</comment></comment><comment><USER6> While I agree that pessimistic games are essentially non-existent, there's good reason for that. Why would a video game developer make a completely depressing, humdrum, everyday office worker game? Game designers and gamers want something more flashy, fun, intriguing, competitive. They want to escape daily routine, not return to a virtual version of it.

<comment><USER7> Video games always have the additional move that the developer can't remove: "Turn The Game Off". If your game can't compete with that, you're going to have very "selective appeal".

Not that I need every game to be a maximally-empowering dopamine releaser to compete, but if you're going to present me with something that's actually bleaker and more draining than my own real life, you're not going to last long.

Other forms of art have their own additional ways of compensating for that sort of thing that I don't see being options in video games, although, even then I'd suggest the appeal is fairly selective. French movies in black and white about existential crises and the fundamental meaninglessness of life don't compete very well with $MARVEL_MOVIE at the summer box office.

<comment><USER8> Selective appeal is fine. Black and white existential French films don't need to compete with the latest MCU flick because they weren't filmed on a $200Mil budget.

Similarly, making a AAA video game title about ennui is stupid, but small indie studios doing $10-20 releases for a 5-10 hour gameplay art-game is a thing.

</comment></comment></comment><comment><USER9> I probably like pessimistic games a little too much:

Papers, Please - [http://www.papersplea.se/](http://www.papersplea.se/)

This War of Mine - [http://www.thiswarofmine.com](http://www.thiswarofmine.com)

Beholder - [https://beholder-game.com/](https://beholder-game.com/)

The Castle Doctrine - [http://thecastledoctrine.net/buy.php](http://thecastledoctrine.net/buy.php)

Orwell - [http://fellowtraveller.games/games/orwell/](http://fellowtraveller.games/games/orwell/)

Headliner - [http://unboundcreations.com/games/headliner/](http://unboundcreations.com/games/headliner/)

We Become What We Behold - [https://ncase.itch.io/wbwwb](https://ncase.itch.io/wbwwb)

Some survival games have a dystopian (therefore, pessimistic) premise, but might not be pessimistic enough according to the article:

There Are Billions - [http://www.numantiangames.com/theyarebillions/](http://www.numantiangames.com/theyarebillions/)

Frostpunk - [http://www.frostpunkgame.com/](http://www.frostpunkgame.com/)

Plague Inc. - [https://www.ndemiccreations.com/en/22-plague- inc](https://www.ndemiccreations.com/en/22-plague-inc)

Even 'Dwarf Fortress' in fortress mode almost always ends with your fortress being overrun - [http://www.bay12games.com/dwarves/](http://www.bay12games.com/dwarves/)

<comment><USER10> Those are some pretty sad games!

Just wanted to add two games that straight up left a void in me for a while after I was done

Shadow of the Colossus - Is on PS2,PS3, and PS4 and I really can't recommend it enough. Even if it technically ends with a hopeful ending its pretty pessimistic.

Life is Strange - The first two episodes make is seem like a pretty goofy teen drama but the last two episodes definitely become exponentially more existential.

</comment></comment><comment><USER11> The premise seems to miss the point that people generally don't want to invest time and money into things that make them sad or frustrated. The appeal of games is exactly that they reward players for their efforts --that the obstacles can be overcome. Art piece games that exist to convey some kind of an experience that _isn 't fun_ are fine. The reward is just having the experience, like a book or tv show. I'm just not sure they should be considered games.

<comment><USER12> > The appeal of games is exactly that they reward players for their efforts

While I agree with the general comment, this part made me laugh a little. I find that games are incredibly easy nowadays, there is little "effort" to actually reward.

To me it's a worse trend than the lack of "pessimistic games". Building a culture of "what do you mean I didn't succeed after the second try? But I'm entitled to make it to the next level!!!!!"

I might be very cynical, but I think it hurts society a lot. Kind of similar to all these TV shows where the main character transitioning from being a waiter to sales executive or director of marketing in 2 or 3 seasons.

<comment><USER13> > I find that games are incredibly easy nowadays, there is little "effort" to > actually reward.

While I agree with the general comment, this part made me laugh a little. Games (and TV/movies) are designed to cheat your brains reward system and make you feel like you are achieving something. This is why they're fun to play/watch.

I would argue that it's more insidious to require more work out of the player because it's prolonging the inevitable realization that you're not actually accomplishing anything. Games that cut right to the chase and reward you from minor accomplishments allow you to get that quick rush you were looking for then get back to your life.

Think about people playing World of Warcraft (especially vanilla days), sinking untold days of play time into grinding out gear/rep/gold. What are they actually getting from this? Versus just about anything else they could be doing with that time? The easier games make it to be rewarded, the more honest they are as a game. You could argue that you want a game to feel like a job because you can't get that satisfying sense of hard work paying off in real life, but I seriously doubt anyone would be happier with a productive, rewarding game life than a productive, rewarding life-life.

</comment></comment></comment><comment><USER14> This seems way off base for me. Games are meant to empower you and help offset the desperation of everyday life. Not grind you down further.

<comment><USER8> Counterpoint: Some games are art, and are meant to make you feel something. These games are also important and/or have a place in the world.

I don't think that I would want to dump 200 hours into "that dragon cancer" but knowing that it exists and is as powerful as it is means something. Playing that game makes you feel something important that blasting aliens with laser pistols doesn't.

Being heroic isn't always saving the planet. Sometimes it's just waking up the next day and going to work.

<comment><USER15> > Being heroic isn't always saving the planet. Sometimes it's just waking up > the next day and going to work.

Going to the cubicle and banging out TPS Reports day in and day out isn't being heroic, it's being passive, living life on auto pilot. I hate it. And so do most people who are aware of what it's doing to them.

<comment><USER8> Without getting to deep into the philosophical point I was trying to make as an afterthought in my comment:

"Given the choice between the sweet simple release provided by the revolver, and continuing the Sisyphean task of just living, I consider the human race heroic for simply being"

<comment><USER15> It's those deeper philosophical questions that we struggle with, and once we have the right 'question' the search for the answer is what drives most people. But those answers are mostly elusive or non-existent. And that makes people very unhappy.

</comment></comment></comment></comment></comment><comment><USER16> It's very easy to dismiss _life_ as an exercise in masochism. Take the idea up a few notches and question what underwrites your physical existence: murder and theft, involving the demise of countless plants and animals and theft of their carcasses as a personal fuel source (old India Vedic/Buddhist observation added for shock value). Very suckey. Then here by extension it would seem subordinating yourself to the synthetic distractions of psychopathic video games or maudlin RPGs as temporary anxiety outlets ultimately tends in idle moments to reinforce that sense of futility. And then why would you want to essentially 'sublimate' that synthetic psychopathic stimuli by replacing it with a process of being jerked-around by scripted pessimism? Doubt that it has to be that way. As old Milton pointed out in 'Paradise Lost': _the mind is a world in itself and in itself it can make a heaven of hell or a hell of heaven_. Since it's unlikely anybody is going to make the personal world that YOU would want for you, maybe a practical excursion into _gnothi seauton_ (know yourself) then follow-up with scripting your own suitable world.

</comment><comment><USER17> > is possible that we do not have pessimistic video games. I do not mean that > we don't have games with a down tone or with a general sense of negativity. > I mean that video games, for whatever reason, have a hard time committing to > the hell of life. They can be depressive, but they have a hard time letting > go of the thought that there might be something good at the end of all this > difficult.

I don't know if I agree with the premise. Spoilers ahead.

The Dark Souls series is, in my opinion, essentially about futility. It could be said that many of the gmaes monsters are just other players who eventually gave up. Its implied that the world goes in cycles and no matter waht you choose, ultimately nothing really changes. Bloodborne is about cosmic horrors that are beyond our comprehension and that we cannot do anything about. The Last Of Us ends with the entire quest having been for nothing. The Last Guardian ends with the kid and the creature both getting severely injured, getting separated and never seeing each other again. Shadow of the Collossus ends with you killing solitary (and harmless to the world) creatures, freeing the big bad and getting killed in the process, before you ever get to see the princess revived (which was the entire reason you were on the quest to begin with).

Many games tie up their stories, but don't particularly end on a high note exactly. Many games are pretty damned bleak. Hell, I've been finding that what I really want to see is more games that are more upbeat and are about more mundane things. For example, I loved the mundane (before the main plot kicks in) aspects of Night in the Woods, just because they were so normal and didn't involve some dark, bleak, depressing story nor did it involve murdering people. I actually wish that the plot didn't happen in that game.

</comment><comment><USER18> 1v1 multiplayer games kind of mirror the always-someone-better hopelessness of the daily grind, StarCraft being perhaps the ultimate example.

<comment><USER19> I play Dota 2 against bots because playing against actual humans is cause to weep in despair.

</comment></comment><comment><USER20> You're as likely to get a major game developer making a pessimistic game as your are to get Disney funding the next Bela Tarr film. You're only going to get someone doing it recreationally to any kind of well developed level if they have absolutely huge personal involvement (e.g. That Dragon Cancer).

The issue isn't even that there needs to be more pessimistic games, they're being made and they're gradually getting to a point where they're not pathetically behind other mediums in terms of emotional depth. What there needs to be is an easier means of developing interactive experiences so people can explore different vibes without feeling a need to attain some kind of fiscal reward from their efforts.

</comment><comment><USER21> Tetris, Paper's Please, Nidhogg, Skifree, etc.

>and sinking 200 hours into World of Warcraft isn't going to do anything other than entertain me and make Blizzard Activision's pockets one one billionth of a percentile deeper.

Is that not pessimistic gaming?

<comment><USER22> Well said. All these loot box games are astounding upfront pessimistic, many of them even parodying themselves as they try to extract the next nickel using their Skinner box. I occasionally play them, and am always left with this weird mix of dopamine and existential despair.

</comment></comment><comment><USER23> I'd love to see a game that takes us through the choices and options available to a homeless person - and especially get the feeling that nobody cares about you and spits on you. I don't think the general population realizes this aspect of life. So start there but make sure there is something to attain. Like a homeless person that could be rewarded 1 million for saving the life of a kidnapped teen. But after the reward is given, even then mistrust happens and people think you kidnapped the kid... Would be fun for me if not depressing at times.

Also in the style of GTA obviously.

</comment><comment><USER24> I feel like The Stanley Parable falls into this category. The game's ability to account for seemingly every deviation a player may want to take from the as-narrated story means that any attempt on the player's part to exert free will won't actually succeed; at best, you'll end up at a stalemate between you and the narrator. And yeah, there are "happy" endings, but none that make you really feel like you've "won".

</comment><comment><USER25> The author would probably enjoy Pathologic.[0][1]

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

[1][https://www.rockpapershotgun.com/2008/04/10/butchering- patho...](https://www.rockpapershotgun.com/2008/04/10/butchering-pathologic- part-1-the-body/)

</comment><comment><USER26> There are plenty of pessimistic games that portray the hell of life. This guy is either desensitized to it or has only played Nintendo his whole life.

<comment><USER8> The longer this post has been up, the more I'm realizing that there are a ton of games that fit this mold. There's no massive $100Mil+ budget games that really do it, and that's fine. These games aren't meant to be massive money makers, but more expand on the types of stories you're able to tell in the medium.

</comment></comment><comment> Const-me Max Payne 1 and 2 tell a story of man revenging after his wife and newborn daughter are brutally murdered.

Grand Theft Auto 4's main protagonist has survived a civil war, and it shows. The story ain't particularly optimistic either.

"This War of Mine" tells a story of group of civilians trying to survive in the warzone.

"Hellblade: Senua's Sacrifice" main protagonist has severe schizophrenia.

These are amazing games, despite overly pessimistic and even depressing.

</comment><comment><USER27> Detroit become human is an amazing example of storytelling and emotional character involvement.

The game takes no prisoners and the decisions you make can mean a rather bleak end to your characters and more importantly your story arc. There is no going back, what happens happens.

There is however an opportunity for glory (depending on your perspective of glory).

This is what games should capture, the bitter and the sweet.

</comment><comment><USER28> There are pessimistic and great books, pessimistic and great movies, pessimistic and great music, so there is zero reason to reject the idea of pessimistic game. I think I would like that. I used to like all the above, so I think the game would fly too.

Btw, Nihilumbra is pretty good pessimistic game.

But also, I think that if one looks closely into various niches, pessimistic games will be found.

</comment><comment><USER29> "Need" aside, someone has to pay for those pessimistic games. In the end, that's the biggest impediment to experimental games. Games simply cost more time and money to make than a book, and sometimes more than a full blown movie.

If you want more pessimistic games, you will need to fund them, somehow.

</comment><comment><USER30> I love these sort of games, there are a number just now and available on many platforms by indie artists & studios, even on Steam. On the other hand, blockbusters mainly provide fun, escapism or special effects, they are tailored on the masses and rightly so.

</comment><comment><USER31> How about making life more like games, instead of making games more like life? Can we do this somehow?

I've been pondering this a bit recently. We immerse ourselves in stories because, good or bad, they're _more interesting_ than real life. The protagonists, the antagonists, the NPCs - they all (are written to) feel their role is important, unlike us real-worlders, struggling with ennui and the role of a cog in a machine (or a single cell in a large, multicellular body). We've built a civilization and economy that diminishes the role of an individual, and yet our brains crave the feeling of being a hero of a story.

I remember Eliezer had some smart observations on the topic; I guess it's time to re-read his "Fun Theory" sequence[0].

\--

[0] - [https://www.lesswrong.com/posts/K4aGvLnHvYgX9pZHS/the-fun- th...](https://www.lesswrong.com/posts/K4aGvLnHvYgX9pZHS/the-fun-theory- sequence)

</comment><comment><USER32> Far Cry 5? I mean the game ends by you being trapped for the rest of your life with a creepy guy you tried to defeat for the previous 30 hours. Also all the people yoy've been helping in the main/side quests are dead.

</comment><comment><USER33> There's enough games out there to fill about every genre and emotion. Why do we "need" to decide anything about something as large as games? Let the market decide what people want.

</comment><comment><USER34> Are there any games out there you play through seemingly as the hero only to find out after x hours of 'saving the world' that you were, in fact, not? Something like the film Memento?

<comment><USER8> Knights of the Old Republic had a pretty great twist. You still wind up being the hero, but it's still a real pull the rug out moment.

</comment></comment><comment><USER35> Talking about pessimistic games, are there any good simulations/games about fighting climate change in the next century or so? Seems like it would be a very interesting topic.

<comment><USER36> Not sure, AFAIK there really isn't one.

SimEarth can be made to simulate global warming, but it is very dated (and the Gaia hypothesis is wrong).

Some versions of Civilization can somewhat simulate AGW, I believe, too.

From the recent ones, Eco and Block'n'hood have ecological themes. Haven't played the first, the second is only local ecosystem.

</comment></comment><comment><USER37> Some great pessimistic games:

\- Papers, Please

\- Oregon Trail

<comment><USER23> But in Oregon trail you can win, so I'd call it a normal game.

<comment><USER37> I was just joking a bit, on account of how easy it is to die or have family members die for horribly realistic reasons :)

<comment><USER23> Oh that is true I suppose :)

</comment></comment></comment></comment><comment><USER38> Just play Nethack.

</comment><comment><USER39> I think the author meant to say meaningful rather than pessimistic.

Something meaningful may necessarily have some pessemism in it.

Games today are not meaningful

<comment><USER40> > Games today are not meaningful

Where does that come from? Top of my head: some meaningful games below:

\- Deck Nine released Life is Strange in 2015, Before the Storm in 2017 ; Life is Strange 2's first episode was released on September, 27th.

\- Mass Effect makes you think about your place in a very, very vast Universe, the consequences of choices, even though you're a "hero" (2007, 2010, 2012).</comment></comment>


Speculative Execution Exploit Performance Impacts - <AUTHOR> https://access.redhat.com/node/3307751 <comment><USER2> Isn't that only for Meltdown?</comment>


The Seven Stages of Expertise in Software Engineering (1998) - <AUTHOR> http://www.wayland-informatics.com/The%20Seven%20Stages%20of%20Expertise%20in%20Software.htm <comment><USER2> At what stage do you question if the bears need to be hunted?

I know the comparison is meant as tongue-and-cheek, but if these stages are really universal, then the ability to question and even reject a field of expertise or approach must be included.

Of course, thinking that through also applies to meta-level expertise, like being able to recognize that a given direction isn't the right path to go.

But since we're talking bear hunting, we can leave it at the concrete level. When do whalers agree it's time to stop whaling? Buffalo hunters? CFC producers? Designers of new nuclear weapons?</comment>


Control Malfunctions and Flight Instrument Anomalies (1997) - <AUTHOR> https://www.youtube.com/watch?v=WfNBmZy1Yuc <comment><AUTHOR> Somehere around 35 minutes there is an incredible incident description.</comment>


Zynga Was PayPal's Second-Largest Merchant in 2009   - <AUTHOR> http://www.insidesocialgames.com/2010/03/18/zynga-was-paypals-second-largest-merchant-in-2009/ <comment><USER2> Doesn't come of as a big surprise to me. Having worked for a social game publisher, I can vouch for the fact that it's a growing industry _still_ in its infancy. The internet is the new TV and having easy access to +300 million users in one place (Facebook) has obvious benefits.

<comment><USER3> Is the industry here to stay or are they manufacturing fads? Virtual pet rocks?

<comment><USER2> It's definitely here to stay. Take for example Facebook gifts. Priced at just $1, if 35,000 people buy an FB gift everyday (out of 400m and growing), it translates into $1m of additional profit every month. We're talking about massive economies of scale. Whoever gets on the boat now has a chance to enjoy a near monopoly for sometime to come.</comment></comment></comment>


India Supreme Court rejects Novartis' right to patent new version of cancer drug - <AUTHOR> http://www.foxnews.com/health/2013/04/01/india-supreme-court-rejects-novartis-right-to-patent-new-version-cancer-drug/ <comment><USER2> Important context, and if you didn't RTFA:

India recognizes patents just like anywhere else. What they don't recognize is when drug makers trivially re-formulate their drug upon patent expiration in such a way that the old medicine cannot be made generically without also infringing on the new patent. India called BS on that, and rightfully so. Now millions of people in India don't have to die because even though a drug company made several multiples on their investment already, billions in exclusive profits per year still isn't enough.

Edited to add: This is informally called "Evergreening". I'm not an expert in that field but you can read more at <http://en.wikipedia.org/wiki/Evergreening> and linked sources.

In this case, they wanted to charge Indians $2600/month, and the generic is $175/month. If you have this condition and do not take this drug, you die.

<comment><USER3> As an aside, the evergreening process has taken on frightening new faces in recent years. Drugs have been repatented with the same formula for 'new' purposes. Case in point is BiDil, an active ingredient repatented for race- specific use in African-Americans without alteration to a previously patented drug formula (the case of repatenting is in and of itself an interesting study, many in the field contest the trials that validated the repatenting as well as the concept of a race-specific drug, as there is no drug-relavent biological basis for race.)

[1] - [http://en.wikipedia.org/wiki/Isosorbide_dinitrate/hydralazin...](http://en.wikipedia.org/wiki/Isosorbide_dinitrate/hydralazine) (BiDil)

[2] - <http://www.nejm.org/doi/full/10.1056/NEJMoa042934>

<comment><USER4> If they paid for the clinical trial then there should be some sort of protection for the person who paid. Otherwise it will be impossible to expand what a drug is used for after the patent expires.

<comment><USER5> Doctors may just use the drug off-label. If the patient responds then they use the drug, otherwise they try something else. A formal trial really helps very little in these cases.

If a bunch of clinicians find that the drug is effective against the condition, they can (as has happened so many times) make their own study to popularize the usage.

Remember: The safety of the drug is not in question, just the efficiacy.

<comment><USER6> But how do physicians know it works if trials aren't run? You can't go by anecdotal evidence.

Hell, look at the huge niacin trial that Merck ran. Doctors have been prescribing it for 30 years and you know what? It doesn't help. Unless a massive clinical trial was run, you'd never know whether it was worth prescribing.

</comment></comment></comment></comment></comment><comment><USER7> Thank you, India.

Let me tell your my story. I am on a pill called Colchicine that I have to take 3 times a day for life. The pill's formula is hundreds of years old and would cost me pennies. That was until a company convinced FDA to ban the generics and only allow its own brand. The same pill that used to cost 10 _cents_ now costs $5/pill to me here in the US. Meanwhile in India, it still costs pennies.

I wish US would take a page from India.

<comment><USER8> Interesting about Colchinine[1]. Apparently the FDA does 3-year exclusive agreements with companies in exchange for conducting new clinical trials.

The idiotic thing here is that by raising the prices, it cost Medicare $49M more a year for apparently a ~$100M investment into research.

I don't know why the government wouldn't fund it directly in this case. Or in general, why they don't add a tax onto the drug in question and do the research themselves. It seems like an odd, public-damaging way to go about things.

[http://en.wikipedia.org/wiki/Colchicine#Marketing_exclusivit...](http://en.wikipedia.org/wiki/Colchicine#Marketing_exclusivity_in_the_United_States)

</comment></comment><comment><USER9> If a private company has the duty to maximise profits, shouldn't a sovereign state have the duty to maximise the benefits to its citizens while fulfilling its minimum international treaty obligations.

The cost of gleevec/year is $36,000. The average per capita income is $1219[1]. If patented about 99% of people who need this drug can not afford it. Why should any state keep 99% of its people away from a life saving drug, if it doesn't have a legal obligation to do so.

Property rights are a means to an end. Even if all of Asia and Africa refused to recognize Novartis patents, they would still have enough incentive to continue developing cancer drugs.

1\. <http://en.wikipedia.org/wiki/Income_in_India>

<comment><USER10> Do you have a citation for that drug price (for Indians)? Another post cited a price more than an order of magnitude lower.

<comment><USER11> The article says it costs about $2,600/month. Cheaper than $36,000/yr but not by an order of magnitude.

<comment><USER12> This drug is expensive at $2600/month. A fresher software engineer salary in IT company is about $500/month. Average Indian income is way low than that possibly less then $100/month.

</comment></comment></comment></comment><comment><USER13> To put this in perspective, Novartis Glivec is the beta crystalline form of 'imatinib mesylate' - an already known compound which went out of patent. Novartis failed to establish that the new form has demonstrable efficacy over non-crystalline form. As per section 3 (d) of Indian Patent Law designed to prevent Evergreening - inventions that are mere "discovery" of a "new form" of a "known substance" and do not result in increased efficacy of that substance are not patentable. Indian patent law follows guidelines set forth by WTO under TRIPS agreement. So Novartis has exhausted all their legal defences. Novartis did not get even one favourable verdict in the entire legal battle which played out in 3 different courts of law.

<comment><USER14> Would the crystalline form even be a viable drug? Don't drugs have to be soluble in order to circulate in the blood stream?

Is the beta cystalline form the same chemical formula as the soluble form?

<comment><USER13> Beta crystalline form has the same chemical formula as the non-crystalline form and is soluble.

</comment></comment></comment><comment><USER6> Why drugs cost so much isn't really that hard to figure out.

Drugs cost a lot of money to develop. On average it costs somewhere between $250M (for an orphan disease) to $1B (for a primary care drug). The problem is that most drugs fail during development and when you take that into consideration, it's typically over $1B to develop a drug.

Where does that money come from? Just like money for anything else, it comes from the marketplace. People (not unlike readers of HN) take their money and put it into investments that get them an optimal return. If you eliminate patents, you eliminate the mechanism to get a return on R&D dollars invested. No patent (or at least a mechanism to get a return on an R&D investment) and you have no drug.

<comment><USER15> The issue here isn't getting a patent to cover the R&D costs, it's a case of the patent expiring, the drug company reformulating the drug slightly and then applying for a "new" patent on what amounts to a slightly modified version of the previous drug.

<comment><USER6> No, that's not the issue here.

In India, the only patent you can get is the initial "composition of matter" patent. These patents are typically obtained very early in the R&D process (right after the drug is discovered).

For most drugs you can't just give the drug to a patient, it has to converted to a salt (this is why most drugs have "hydrochloride" or "sulfate" after their name). The right salt to use is usually determined a few years after the drug is discovered. The company typically gets a patent on this as well.

Since India doesn't recognize patents other than novel "composition of matter" patents, Bayer can't rely on their formulation patent to extend their market exclusivity. The patent in question is NOT a new formulation, it's the original formulation. The patent in question would only extend their market exclusivity for a few years.

<comment><USER8> I looked up the drug in question and apparently it was patented in 1993. That's 20 years. Even if the second patent was filed in 2007 it's still quite more than "a few years".

</comment></comment></comment></comment><comment><USER16> Seriously? You want to start a company under the pretext of making humans' lives better, but only worsen it for them?

I will justify my sentiments:

By worsening, I mean, nothing is terrible in life than knowing there is a solution/cure to your problem, but you have to die just because you can't afford it.

India is a developing country, even something as moderate as $100 is actually a luxury for many people - Remember, we are talking about a country where millions slog their lives to death for $0.01 to $0.5 per hour (even in call centers, etc) and anything between $100-200 is NO JOKE for them.

Just don't put barriers to such things - Everybody has the same blood inside them and has a right to live on this planet irrespective of having enough money or not. You want money? Don't charge the peasants - Charge the R&D departments of the billion dollar companies that want to sponsor you and compete for fame. These peasants are already selling their blood (literally) to make their both ends meet, and this should be the last thing they should die to pay for - Their very own life.

<comment><USER17> Diet is a huge factor in quality and longevity in life. "Good" food is a lot more expensive than processed horse muck. So even there a financial divide exists. Unless we want to lean over to a more socialist way, that sort of divide will always exist. Poor people will usually die before richer people, mostly its down to food and water and sanitation, even fitness. I'd rather get those things right first, then worry about funky cancer drugs. Might need less cancer drugs if these things were addressed. Might need less drugs in general.

<comment><USER18> Not much money to be made in healthy foods, much more money to be made in processed foods and cancer drugs. I don't think there is some grand conspiracy and huge collusion. I just think the profit factor is so huge in giving people crap foods. Then there is tons of money to be made selling them exotic drugs. Healthy foods means someone cooks fresh vegetables a few minutes before you eat it, can't store that in a warehouse.

<comment><USER19> There are many profitable businesses going after the healthy / natural food market. You just need to change your business and marketing to go after that segment.

Additionally it's not as simple as "you can't store that in a warehouse". If you do the have the time to buy fresh vegetables (y'know every day or 2)and if you don't have the time to make them, then you can't eat that form of diet.

</comment></comment></comment></comment><comment><USER20> I believe this is where India has got it's patent system right. I am not a lawyer, but as I understand it, the Patent Office (Controller General of Patents Designs and Trademarks) rejects patents that are obvious and not a genuine invention.

Furthermore, you can only patent a __process __not an idea or a product. This was the key reason that you have so many generic alternatives for otherwise patented medicines. The process encourages competition and its the consumer who wins.

Perhaps this is something that US can learn from.

<comment><USER21> Didn't India introduce product patents quite some time back?

<comment><USER20> They did. But I believe it's still somewhat a gray area. They are more in the form of Geographical Patents (such as Darjeeling Tea) [http://en.wikipedia.org/wiki/Indian_Patent_Office#Geographic...](http://en.wikipedia.org/wiki/Indian_Patent_Office#Geographical_Indications_tags)

</comment></comment></comment><comment><USER22> And this is why medical research should be directly funded by goverments, exactly like they fund military research, the cost shared among the developed nations, and directly throw away the patent system.

<comment><USER23> Throw the baby out with the bathwater? I speak from an Indian perspective. Almost everything the government touches leads to crippling corruption. Including the police force. I have colleagues from government-run research centers, and I've heard enough stories from them to never wish to deal with one.

<comment><USER22> No. Research would still be done by private companies. But we would pay them directly with money, instead of with an artificial monopoly. It's not free market anyway.

These companies could focus on pure research, and leave manufacturing to others. Their income would be more predictable too.

Cost could be shared among countries, proportional to their wealth. Research is very expensive, but it's a fixed cost. No reason to reinvent the wheel twice.

No more "convincing" doctors with "gifts" to use their products. No more money wasted on publicity. No more fake studies to boost sales.

Effort could be aimed towards deadly, rare or specially awful diseases, instead of profitable ones.

I guess patent lawyers would lose.

This system is far from perfect, as we know there is a lot of corruption in getting government contracts. But I still think it would be an improvement on what we have today. Medical research is already very difficult. No reason to make things worse with an outdated, inefficient and sometimes just outright evil funding mechanism.

</comment></comment></comment><comment><USER24> Question remains, if they had gotten a new patent. Wouldn't the old version still be open for the public?

<comment><USER25> I'm not a patent lawyer, but I fail to see why this would be the case.

If the old version was held by someone else, would it then also be open for the public ?

As far as I can tell, patents pretty much stand on their own.

<comment><USER24> They were wanting a new patent for a slightly improved version of their drug. They held the patent for the previous version which expired.

Since they were fighting so hard for a new patent, I was wondering if such a patent would affect a generic drug made from the pervious version.

</comment></comment></comment><comment><USER26> "We certainly do not wish the law of patent… to develop on the lines where there may be a vast gap between the coverage and the disclosure under the patent; where the scope of the patent is determined not on the intrinsic worth of the invention but by the artful drafting of its claims by skilful lawyers; and where patents are traded as a commodity not for production and marketing of the patented products but to search for someone who may be sued for infringement of the patent." said by Bench of Justices Aftab Alam and Ranjana Desai.

Well! This says it all

</comment><comment><USER27> An hypothetical question is : Would Brian Drucker apply at <https://www.microryza.com> ?

As I understand, all hue and cry from Novartis is - they have invested big in R&D and yet not reaped reasonable returns. Also, they claim that this dents their effort to come with better drugs in future as profitability is at stack and such judgements are demotivating for any actual R&D to take place. Just wondering with crowdfunding gaining acceptance would this be a relevant argument ? What are real chances of getting a life saving drug as good as Imatinib seeing light of the day. What are practical challenges ?

</comment><comment><USER28> It might be worth mentioning that India has a large generic pharmaceutical manufacturing industry. Many generics sold in the US and around the world are manufactured in India.

</comment><comment><USER29> I would love such a provision in US law for patents if it does not yet exist. I'd hate to see someone patent linked lists where the "previous" node pointers are at the top of the data structure and the "next" node pointers are at the end. Or some other silly re-structuring.

</comment><comment><USER30> Bravo india Bravo. hope USA learn something from you

</comment><comment><USER31> Why would you patent a cancer drug?

<comment><USER32> Why haven't you, personally, dedicated your life to making cancer drugs?

The people that do so would rather like to be compensated for it. You may think it's an imperfect system but until you personally start making cancer drugs for the world for free maybe you should think a little deeper on the subject.

<comment><USER33> I only regret that I have but one vote to give for bringing this comment out of the gray (apologies to Nathan Hale).

And, I would add: talent, on average, goes where the money is. We've seen it in sports, and it's true in academic pursuits.

Plus, it takes a helluva lot of money to get these drugs to market. Nobody gives that money to a company without a fair shot of getting it back. Hence, for the time being anyway, patents are a requirement in that field.

<comment><USER34> I would like to discuss this claim that it takes a lot of money to bring a drug to market, and this is why drugs are currently so expensive.

This seems to be common wisdom in this thread, but I note an extreme lack of actually cited sources, so I decided to go dig some up.

I remember reading a book in 2004 discussing what percentage of medical industry profits went towards research and development, verses what percentage went towards marketing. While I cannot recall the title (I have read thousands of books since then), the idea did stick with me, and a bit of quick Googling produced some results:

First, and perhaps most shocking: <http://www.bmj.com/content/345/bmj.e4348>

Here is a copy of this research without the paywall: [http://www.pharmamyths.net/files/BMJ- Innova_ARTICLE_8-11-12....](http://www.pharmamyths.net/files/BMJ- Innova_ARTICLE_8-11-12.pdf)

According to the pop-sci summary of this article in the HufPo, what these numbers translate to is that Pharma companies spend 19 times as much on self- promotion as they do basic research: [http://www.huffingtonpost.com/2012/08/09/pharmaceutical- comp...](http://www.huffingtonpost.com/2012/08/09/pharmaceutical-companies- marketing_n_1760380.html)

If you assert that drugs are so expensive because of the cost to develop them, and yet I have demonstrated that the R&D budget is a small percentage of the money which the drug companies are spending, do you withdraw your assertion? Given the aforementioned lack of sources in this thread I somehow doubt it.

Ah: I found a review/summary of the book which originally sparked this comment. It's The Truth About the Drug Companies, and is by Marcia Angell, the first female editor of the New England Journal of Medicine. The review is available at: [http://www.nybooks.com/articles/archives/2004/jul/15/the- tru...](http://www.nybooks.com/articles/archives/2004/jul/15/the-truth-about- the-drug-companies/?pagination=false)

More: [http://www.slate.com/articles/business/the_customer/2011/03/...](http://www.slate.com/articles/business/the_customer/2011/03/the_makebelieve_billion.html)

<comment><USER6> The author of the article you posted, Donald Light, has done a pretty poor job of supporting the numbers he has come up with.

If you want to see what drugs cost to develop, just ask the scientists who develop them: [http://pipeline.corante.com/archives/2012/08/09/getting_drug...](http://pipeline.corante.com/archives/2012/08/09/getting_drug_research_really_really_wrong.php)

His numbers don't even pass the sniff test. If you want to find out how much it costs to develop a new drug, there is nothing stopping you from calling a CRO and asking how much they charge for phase III trials (they are all in competition, so they'll freely give you a quote).

The average cost for a phase III trial is approximately $15,000/pt/yr. 1000 patients is a pretty average size trial, so now you are at $15M for one trial and the FDA requires at least two phase III trials.

And that's just the cost of phase III trials which doesn't include: phase I, phase II, manufacturing, regulatory costs, etc. Donald Light's claim that drugs cost $45M to develop is laughable and the could only come from someone with no understanding of drug development.

<comment><USER34> I am somewhat confused by the term "article you posted" in your comment. I had believed that I had posted a variety of different articles from several different sources, one of which was written by Marcia Angell, former editor of the New England Journal of Medicine and presumably someone who knows how much a drug costs to develop.

<comment><USER6> The article I was referring to was the BJM article.

Oh yes, I know all about Marcia Angell. She has been rallying against the pharma industry for over a decade. The link I posted also goes into some of the outrageous things she has said that are completely unsupportable.

Here is another article talking about Marcia:

[http://www.forbes.com/sites/johnlamattina/2012/12/14/marcia-...](http://www.forbes.com/sites/johnlamattina/2012/12/14/marcia- angells-attacks-on-pharma-have-lost-all-credibility/)

Does pharma do bad things? Yes! But claiming there is a pharma conspiracy to drive down "target" cholesterol levels so they can sell more drugs is laughable. It ignores all the scientific evidence (most of it NOT from pharma companies), much of it published in her the journal she works for.

</comment></comment></comment></comment></comment></comment></comment><comment><AUTHOR> What's the legality (in US) for a Kickstarter model R&D and clinical trials for new drugs?

</comment><comment><USER35> I you find this stuff interesting I found Bad Pharma an interesting read (Random Review: <http://boingboing.net/2012/11/06/bad-pharma-account-o.html> )

They talk about tricks like mirror versions of a drug can then be patented after the first drug expires. Then the company can push them over the original, which is not necessarily bad, mirror versions can be better or sometimes worse.

</comment><comment><USER36> I do not understand the hoopla. When the patent on the old version expires, anybody can make it for pennies a day. An expensive new formulation hurts no one, since they are free to huy the cheap one.

<comment><USER8> First, sometimes they try to get a new patent that will cover some aspect of the old process, too.

Secondly, a lot of effort goes into getting people on the newer formulation. Look at Concerta versus Ritalin. Both are methylphenidate, but I've met several people that think Concerta is a totally new drug and that "Ritalin didn't work for me". I've even talked to doctors that thought they were different chemicals. Not the drug company's fault, but it still "hurts someone".

<comment><USER36> Hurts? Immediate release methylphenidate has a half-life of 2-4 hours, while Concerta has a duration of effect of 12 hours. Given the narrow therapeutic window of methylphenidate and the harsh wthdrawal syndrome, they _are_ different drugs.

</comment></comment></comment><comment><USER37> this is India playing with fire. and it is not about securing access to important drugs to Indian patients - it is about boosting the native Indian generic pharma industry. while India itself does not provide any significant output in R&D spending in pharma.

so yeah, big pharma is evil and greedy, however no one else takes 1bn$ to try out a new product and have it fail in front of the FDA - which is the usual scenario, as most(!) new products get denied.

how many other industries out there need to PROVE that their products are not only safe but also have an actual benefit? as this is HN, let's see all those fancy task/email/collab/social apps _prove_ their usefulness in scientific trials - and get denied if they fail to be better than notepad.

so yeah, awesome, let's kill pharma's business model without any alternative in sight.

how about having generic makers pay a fixed % of their revenue into a R&D fund? without it they are just leeching off.

<comment><USER38> Read about evergreening first. The issue is not that India is denying some novel invention - but a slightly modified version of an already expired patent.

<comment><USER37> see, and this is why nerd-news is so frustrating. one article, plus one cool term 'evergreening'. super, let's hit wikipedia and whoa i can spout internal sounding knowledge.

problem being that here we have a larger pattern in india's behavior which is not neatly laid out in a few linked articles. so no way to quickly read up on it, you need to be in the industry or closely following it.

so yeah, evergreening, awesome. same with roche, bayer?

and in novartis case: you know that the original molecule was never patented in india? india only started recognizing patents issued after the early 90s. you know that novartis already gave away 95% of this particular product for free in india? right?

this new item is a trainwreck, just like the pycon thing. problem that far fewer people here will recognize that.

<comment><USER39> Oh, well, if your problem is that people are on India's side without the due knowledge to make an informed opinion, how's this: I have a degree with honours in Biochemistry, and I worked for Novartis for eight years in clinical safety.Glivec was one of the drugs we handled all the reports for. I have no axe to grind with Novartis, it's a good place to work and it'll be a long time before I'm as well-off as a programmer as I was when I was working for them.

I'm of the opinion that India got it absolutely right.

<comment><USER40> Almost on par with:

<https://news.ycombinator.com/item?id=35079></comment></comment></comment></comment></comment>


India's ISRO conducts key crew escape test for human space mission - <AUTHOR> https://english.manoramaonline.com/news/nation/2018/07/05/isro-conducts-key-crew-escape-test-for-human-space-mission.html <comment><USER2> Note the early parachute detachment at 1:24. Capsule freefalls into the ocean from that point.

Unclear if this was intentional — I've yet to see a statement from ISRO mentioning it.

[https://www.isro.gov.in/flight-test-of-crew-escape-system- te...](https://www.isro.gov.in/flight-test-of-crew-escape-system-technology- demonstrator-lift-of-video)

<comment><USER3> Youtube video: [https://www.youtube.com/watch?v=qyJEcLgzRqM](https://www.youtube.com/watch?v=qyJEcLgzRqM)

<comment><USER4> Why cant ISRO release high def videos?

<comment><USER5> Quite simply it's a lack of ₹₹₹, alongwith some routine government incompetence.

</comment></comment></comment></comment><comment><USER6> This is great. The more nations can lift humans to space, the better.

<comment><USER7> why? sure it is a technical achievement. but how does it improve our life?

<comment><USER8> It improves many lives in many significant ways. Atleast for Indians, it's a huge milestone for a variety of reasons.

1\. Some technologies used in space flight are under severe sanctions from other developed nations, to slow down the development of missile technology of lesser developed nations (developed in the context of military technology). There is a lot of impetus to research and develop those technologies in-house. This leads to a huge gain to India in terms of technical skill, research infrastructure, research know-how, experience, etc. This leads to "down-the- hill" technological advantages in related fields (for ex. medical, industry, etc.). Since the research is public domain, related technological improvements are available for cheap. (A recent example is the opening up of Li-Ion battery technology by ISRO for interested parties in the Industry)

2\. Launching a rocket, especially a manned one, is only the tip of the iceberg. There is a huge amount of work that goes into making that happen, a lot of which is Research & Development. Rocket technology directly leads to better and advanced missile technology. This ensures (though some may argue otherwise) a credible deterrent to enemies, ensuring longer periods of peace. This directly improves lives of the citizens.

3\. There are numerous examples of technology developed to enable space flight trickling down to medical and industrial uses.

In fact, the same can be seen in Formula 1 races. Many technologies we take for granted in modern mass market vehicles (ABS immediately comes to mind, several safety features, crumple zones, etc) are the result of extensive developments in F1 racing scenes.

Even in management, having two teams competing with each other to solve a particular problem, almost always leads to an explosion of ideas and generally a better final solution to the problem at hand. Case in point is in the development of the iPhone, etc.

<comment><USER9> I'm not really here to argue one way or the other, as trying to quantify these things usually leads to science funding being reduced. But saying the ISRO (or any space org) will improve lives should be met with some skepticism, no matter how popular that justification is. There is also some fact-checking to be done:

> This leads to "down-the-hill" technological advantages in related fields > (for ex. medical, industry, etc.)

That's not clear at all, and even if it does happen, it is usually more of a happy accident than a regular thing. An effective counter-argument is that funding those fields directly should then be as effective or more.

> Since the research is public domain

I could not find any indication this is the case, but I'm limited to English. They do have a list of technologies that they have transferred on their website, but seems to indicate you need a license, and hasn't been updated since 2016: [https://www.isro.gov.in/isro-technology- transfer/technologie...](https://www.isro.gov.in/isro-technology- transfer/technologies-transferred). I'll refrain from judging how applicable and ground-breaking those technologies are.

> This ensures (though some may argue otherwise) a credible deterrent to > enemies, ensuring longer periods of peace. This directly improves lives of > the citizens.

That it "directly improves lives of the citizens" is purely propaganda, and easily disproven by the number of peaceful nations that do not have space programs/long-range missiles. Looking at history, disarmament is more effective for peace than an arms race.

> There are numerous examples of technology developed to enable space flight > trickling down to medical and industrial uses.

It should be easy to list them then. It is true that e.g. NASA has successfully spun off several technologies used daily and in the medical field: [https://en.wikipedia.org/wiki/NASA_spinoff_technologies](https://en.wikipedia.org/wiki/NASA_spinoff_technologies) / [https://spinoff.nasa.gov/Spinoff2017/index.html](https://spinoff.nasa.gov/Spinoff2017/index.html) (as an aside, NASA's publications are a joy).

On the other hand, the ESO seems, well, less impressive. Although at least their page on technology transfer is somewhat comprehensible by a lay person: [https://www.eso.org/public/industry/techtrans/develcontract/](https://www.eso.org/public/industry/techtrans/develcontract/)

> In fact, the same can be seen in Formula 1 races. Many technologies we take > for granted in modern mass market vehicles (ABS immediately comes to mind > [...]

Ironically, ABS + F1 isn't a great example of this. ABS' history is interesting and varied, but the most apt analogue might be Concorde, which used one of the first - if not the first - electronic anti-lock breaking system to avoid needing braking parachutes. (Concorde of course being funded by the British and French governments. Whether the money invested into Concorde was worth it, hard to say.)

In terms of improving peoples lives, I imagine F1 is probably closer to a colossal waste of money than a net gain for humanity (I would argue the sport agrees based on e.g. the proposed budget cap). But that doesn't make great PR. (Also doesn't mean F1 should be banned, just that it isn't a great example.)

<comment><USER10> The lastest tech transfer information can be found here [http://www.sac.gov.in/SAC_Industry_Portal/index.html](http://www.sac.gov.in/SAC_Industry_Portal/index.html)

</comment></comment></comment></comment></comment><comment><USER11> Another detailed article: [https://www.nasaspaceflight.com/2018/07/isro-pad- abort-test-...](https://www.nasaspaceflight.com/2018/07/isro-pad-abort-test- indian-human-program/)</comment>


Ergonomica – A cross-platform shell written in Python - <AUTHOR> https://github.com/ergonomica/ergonomica <comment><USER2> Cool project.

How much does it converge / diverge w/ Xonsh ([http://xon.sh/](http://xon.sh/))?

Besides the obvious fact that Xonsh is (from what I can tell at first glance) a Python-like shell scripting language, and Ergo a bash-like shell language written in Python.

<comment><USER3> I would love to drop bash/zsh for some other python-based shell like xonsh. I tried it already a few times, and having access to the python language and built-ins right from the prompt is amazing. The way the found to mix both command prompt and python syntax seems really smart. Nevertheless, the effort to update all my (quite extensive) zsh setup, as well as the cognitive effort to re-educate my brain, is huge. So I want to have to do it only once. This means it should be A) a project that has chances to survive in the long term, so not dependent on a single developer, and B) that has chances to become the reference one, gathering most of the users/contributors.

I don't know about the current craving for such technologies -- if it is a good idea or not -- nor the place of xonsh in all this. My main concern with xonsh is a blog article (Nov 2015) [1], that implies some issues regarding the management and the direction of the project.

Does anyone have opinion/experience on these python-based shells, the existing alternatives, and more specifically about xonsh?

[1] [http://www.skepticism.us/2015/11/xonsh-is-no-longer-a- possib...](http://www.skepticism.us/2015/11/xonsh-is-no-longer-a-possible- replacement-for-zsh/)

<comment><USER2> Regarding the blog post: Xonsh now has 125 contributors on GH, is tested by Travis, Circle & Appveyor, and is analysed by Lanscape ([https://landscape.io/github/xonsh/xonsh/2936](https://landscape.io/github/xonsh/xonsh/2936)). I see the Landscape score is not that great, but also that lots of the errors reported are false positive.

So IMHO there are some serious QA efforts going on on Xonsh, and the concerns reported by the blog post you are citing are probably past history.

<comment><USER3> Thanks for the review! Indeed it seems that this criticism is part of the history now.

</comment></comment></comment></comment><comment><USER4> Watching the screen share it's apparent they don't use efficient terminal movements.

Ctrl-A/E,end of line beginning of line, and Alt-B/F, move forward and backward by word are your friend.

Lots of innocent keyboards abused for no reason.

<comment><USER5> That was the first thing I noticed too. No CTRL+U? It looks like a cool project, but I'll hold off until there are better navigation options (unless there already are, and the video producer simply wasn't using them).

<comment><USER6> the navigation options are currently whatever your terminal application uses; haven't gotten around to making custom navigation bindings

</comment></comment></comment><comment><USER7> Huh, neat project, but it points me towards asciicinema, which is a really neat service/idea I've never heard of before. What a good lil niche service.

<comment><USER8> Their name is actually spelled asciinema, which they really should not have chosen. I keep misreading it as 'ascii enema' :\

</comment></comment><comment><USER9> [https://github.com/ergonomica/ergonomica/wiki/Installation](https://github.com/ergonomica/ergonomica/wiki/Installation) the installation is somewhat weird.

</comment><comment><USER10> The 'Homepage' link to [https://mtklabs.github.io/ergonomica](https://mtklabs.github.io/ergonomica) 404s.

<comment><USER11> This one works: [https://ergonomica.github.io/](https://ergonomica.github.io/)

</comment></comment><comment><USER12> hmm, it's pretty strange. I don't understand why it was implemented in Python, not in JavaScript.

<comment><USER13> OK, I will bite. Why JavaScript? What would it bring to an interactive environment that Python does not?</comment></comment>


Surveillance Blimp to Launch Over Maryland - <AUTHOR> https://firstlook.org/theintercept/2014/12/17/billion-dollar-surveillance-blimp-launch-maryland/

<comment><USER2> _And while the blimps may never stave off a barrage of enemy missiles, their ability to spot and track cars, trucks and boats hundreds of miles away is raising serious privacy concerns._

Yeah, that was my first thought when I saw the title. I guess it's only a matter of time before we don't just have the threat of dispersed/aggregated surveillance from thousands of small-range cameras, cell towers and toll booths to count on for our "protection" \-- but overt, 24x7, top-down surveillance from above as well.

</comment><comment><USER3> I don't understand how Americans can take all that as if it was normal.

<comment><AUTHOR> That $2.5B didn't dissappear into thin air. A lot of it (not all of it, but a lot) went into the pockets & local economies of 63,000 Raytheon employees. That's enough money to make an awful lot of people look the other way.

Also, this is billed as a massive defense project, and people look at it like an overpriced security blanket. Not enough people are paranoid enough to think of their own government abusing power against millions of people at a time. That's something _bad_ people would do, and this is America!</comment></comment>


Ask HN: Simple tool to schedule cloud resource scale up/down? - <AUTHOR> I'm looking for something which can allow setup/automation of cloud resource scaling schedules or rules.  Ideally, it'd be cross-provider and allow something like:
- At 6am, if service tier of resource X is less than Y, increase it to Y
- From 8am-1pm, unless usage % of resource X is greater than 25%, decrease service tier to Z
- Override rule 2 if it's the weekend..
I guess, some system for evaluating and executing scaling rules, based on some criteria, scheduling, and priority.
I've done some digging and can't find such a thing.  It's obviously possible with scripts and jobs, but I'd like the advantages of some kind of web UI.  Anyone using (or built) anything like this? <comment><USER2> [I'm assuming you're not managing nodes using a container orchestration tool like Kubernetes.]

Have you looked at something like Auto Scaling Groups (AWS) / Autoscaling Groups (GCP)?

You can customize the auto-scaling policy for how the nodes scale up / down. You can define the auto-scaling policies around load balancing at some level (e.g., CPU utilization, HTTP load balancing, network load balancing) which is discussed in more detail in the docs below [1].

You can also create arbitrary metrics and arbitrary policies for those metrics and scale with a combination of policies. From [2]:

> The autoscaler handles multiple policies by calculating the recommended > number of virtual machines for each policy and then picking the policy that > leaves the largest number of virtual machines in the group.

Usually auto-scaling config is tied to a particular service provider; while I haven't done cloud-agnostic auto-scaling policies before personally, I would guess it could be achieved with a bit more effort using something like Terraform (examples: AWS [3], GCP [4]).

[1]: [https://cloud.google.com/compute/docs/load-balancing-and- aut...](https://cloud.google.com/compute/docs/load-balancing-and-autoscaling)

[2]: [https://cloud.google.com/compute/docs/autoscaler/multiple- po...](https://cloud.google.com/compute/docs/autoscaler/multiple-policies)

[3]: [https://www.terraform.io/docs/providers/aws/r/autoscaling_po...](https://www.terraform.io/docs/providers/aws/r/autoscaling_policy.html)

[4]: [https://www.terraform.io/docs/providers/google/r/compute_aut...](https://www.terraform.io/docs/providers/google/r/compute_autoscaler.html)

</comment><comment><USER3> Not cross provider obviously, but EC2 autoscaling has supported this for years: [https://docs.aws.amazon.com/autoscaling/ec2/userguide/schedu...](https://docs.aws.amazon.com/autoscaling/ec2/userguide/schedule_time.html)

</comment><comment><USER4> >I'm looking for something which can allow setup/automation of cloud resource scaling schedules or rules.

Terraform + chron/some timing script

>but I'd like the advantages of some kind of web UI

Set up a Jenkins instance on $CLOUD_PROVIDER_OF_YOUR_CHOICE (~20 min) to run Terraform on a specified schedule</comment>


Jon Udell: Hacking the Noosphere - <AUTHOR> http://jonudell.net/talks/cusec/cusec.html

<comment><USER2> It may have been interesting to hear this talk in person but on the web it reads like a long rambling stream of consciousness. He never quite gets anyplace I think he's trying to go.</comment>


Is Programming "epistemologically challenged" - <AUTHOR>

I was reading this item from HN:

    http://news.ycombinator.com/item?id=1489867
 which refers to this article:

    http://www.info.ucl.ac.be/~pvr/decon.html
 entitled:

    How to Deconstruct Almost Anything --
    My Postmodern Adventure
 I found it an interesting read, although I concede that many would not.
However,  I found in it this statement:

  The Pseudo Politically Correct term that I would
  use to describe the mind set of postmodernism is
  "epistemologically challenged": a constitutional
  inability to adopt a reasonable way to tell the
  good stuff from the bad stuff.
 That made me think.
In programming we often talk about "Good Code" and "Bad Code".  Even code that works can be described as "Bad Code" when it's, well, when it's what, exactly?  What is "Bad Code"?
I'm assuming for the moment that we're only talking about working code - code that performs a task and does so correctly.  I'm even assuming we're talking about relatively efficient code, so that precludes, for example, the bogosort.
There is code that despite working, and despite being efficient, practising programmers would call "Bad Code".  But how do we know?
"Good Code" should be clear as to its purpose, clear as to its operation, clear that it does what it's supposed to, and maintainable.  But how do we assess these things?  How does a novice gain the expertise to glance at code and either nod approvingly, or shudder.
What is "Good Code".
How can you tell? <comment><USER2> That's why we have the concept of values.

You can't tell whether something is good or bad until you hold it against some value like... speed of execution, or intuitiveness, or least code. Once you do, judge away.

That's why postmodernism is especially challenged, it can't decide what about life is valuable.

<comment><AUTHOR> We have values - code is good if (in no particular order):

\+ It's clear from its text what it is doing

\+ It's easy to modify to enhance it, without damaging its clarity

\+ It's concise without being opaque

\+ It's corrrect

The problem is creating an objective means of assessing code against these values.

</comment></comment><comment><USER3> Aren't the epistemological challenges of programming merely a reflection of the epistemological challenges of mathematics in general? For example, you can derive numbers (and number theory) from Combinatory Logic or Lambda Calculus or Set Theory. Apparently, you can derive Set Theory from Lambda Calculus and vice versa. Tarksi proved that you can't derive "truth" from inside a given formal theory. So why should we have the ability to decide "good" or "bad" code from inside a programming language?

</comment><comment><AUTHOR> Links:

\+ <http://news.ycombinator.com/item?id=1489867>

\+ <http://www.info.ucl.ac.be/~pvr/decon.html></comment>


TikTok and the Great Firewall of America - <AUTHOR> https://www.coindesk.com/tiktok-and-the-great-firewall-of-america <comment><USER2> I'll now need a new VPN to access sites _in_ China, just as I do to access sites outside of it...

</comment><comment><USER3> Great firewall?

My expectation is that our lovely centrally backdoored cellphone platforms will forcefully uninstall the app on command.

No need for any firewall.

</comment><comment><USER4> to be honest, I will not start talking about the so called firewall of America as long as extreme examples like Chinese firewalls exist. Everything pales in comparison. you want to object to this , ok fine but there is a monster size censorship of Chinese firewalls that should consume 90% of any censorship and firewall discussion

</comment><comment><USER5> I like how this article claims not to be whataboutism, and then proceeds to go "but whatabout american companies"

Like I'm on board with the fact that if we're going to be "protecting the privacy of American citizens" we need to protect our privacy from American companies and also the government as well.

This article doesn't really make that argument though, it says "(this) won't be solved by putting more data in the hands of US companies" but doesn't make the argument that this is what banning tiktok does.

<comment><AUTHOR> That's precisely the argument the article is making. It talks about the fact that US companies are just as bad, and worse than TikTok, so moving data from TikTok to a US company doesn't actually help anything.

</comment></comment><comment><USER6> China is a modern day Nazi Germany.

<comment><AUTHOR> I think you misspelled USA there</comment></comment>


Reversing Bits in C - <AUTHOR> http://corner.squareup.com/2013/07/reversing-bits-on-arm.html <comment><USER2> This article overlooks a major factor in bit-twiddling performance on modern CPUs: saturation of the execution ports in a CPU core.

An Intel i7 core has six execution ports, three of which are ALUs of various types. Depending on the specific instruction and the dependencies between instructions, the CPU can execute up to 3 simple integer operations _every clock cycle_ mixed with operations like loads and stores at the same time. For most algorithms, particularly those that are not carefully designed, multiple execution ports may be sitting idle for a given clock cycle. (Hyper-threads work by opportunistically using these unused execution ports.)

Consequently, algorithms with a few extra operations but more operation parallelism will frequently be faster than an equivalent algorithm where the operations are necessarily serialized in the CPU.

Furthermore, the compiler and CPU may have a difficult time discerning when instructions in some algorithms can be executed in parallel across execution ports. Seemingly null changes to the implementation of such algorithms, such as using splitting the algorithm across two accumulator variables and combining them at the end when any normal programmer would just use one variable to achieve the same thing can have a large impact on performance. I once _doubled_ the performance of a bit-twiddling algorithm simply by taking the algorithm and using three variables instead of one. The algorithm was identical but the use of three registers exposed the available parallelism to the CPU.

<comment><USER3> This is an excellent point, however, there are a few things to keep in mind: first, compilers can (and do) perform this optimization for you (ignoring details about re-associating floating-point since we're talking about bit twiddling).

Second, bit-reversal never exists in a vacuum. There are other operations taking place around it, which will fill in unused execution resources, thanks to out-of-order execution. (And as you note, hyper threading will take advantage of them too).

Third, even though there are six ports (actually, 8 ports and 4 ALUs in Haswell![1]), that i7 can still only _retire_ 4 fused uops per cycle, so in practice one thread cannot saturate all of the execution ports, no matter how cleverly it is optimized.

All of this combines to mean that the fastest bit-reversal in isolation may not be the fastest bit-reversal _in situ_ , which is much more important. Actually evaluating that is much more complex, but it does tend to tip things away from chasing too much ILP slightly more than isolated timing does.

[1] [http://www.anandtech.com/show/6355/intels-haswell- architectu...](http://www.anandtech.com/show/6355/intels-haswell- architecture/8)

<comment><USER2> Both GCC and Clang are surprisingly mediocre at this kind of optimization. I write a lot of extreme performance integer algorithms and those compilers only seem to find "obvious" parallel instruction schedules about half the time even in isolated contexts.

Fortunately, it is pretty simple to induce the desired optimization from the C code without resorting to much cleverness. The compilers miss these optimizations often enough that I frequently double check if I care. Still, it requires fairly detailed knowledge of the microarchitecture.

I do not do microarchitecture optimization work very often. The last time I did, it was to design a faster, better hash function to replace Google's CityHash (and the result was faster and stronger). For most codes, memory behaviors dominate with respect to performance.

<comment><USER4> Have you published your hash function?

<comment><USER2> Not yet but will soon. It is not just one function but an entire family of functions with some interesting aspects beyond just the algorithms.

The hash functions were algorithmically optimized around a scaffolding I designed that guaranteed certain performance characteristics and easy analyzability. It has literally produced many, many thousands of high quality hash functions. Tens of thousands of CPU hours have been burned on the optimization process, which is still running, and the ones that have been put into use so far were early samples pulled out of that process but the hash functions still being processed in the pipeline are statistically more robust than the earlier versions. Much easier than trying to design them the old fashioned way. At some point soon, since the optimization is converging, I will evaluate the most promising parts of the phase space to select the strongest and most aesthetic functions and publish those into the public domain.

<comment><USER5> how does it compare to, say, tabulation as in

Mihai Patrascu, Mikkel Thorup: The Power of Simple Tabulation Hashing. J. ACM 59(3): 14 (2012) [http://doi.acm.org/10.1145/2220357.2220361](http://doi.acm.org/10.1145/2220357.2220361) (free version: [http://arxiv.org/abs/1011.5200](http://arxiv.org/abs/1011.5200))

or also

Mihai Patrascu, Mikkel Thorup: Twisted Tabulation Hashing. SODA 2013: 209-228 [http://knowledgecenter.siam.org/0236-000005/](http://knowledgecenter.siam.org/0236-000005/)

</comment></comment></comment></comment></comment></comment><comment><USER6> The multiplication trick reminds me of this StackOverflow answer[1] where an SMT solver (z3) is used to derive mask and multiplier to extract chosen bits from a byte.

[1] : [http://stackoverflow.com/questions/14547087/extracting- bits-...](http://stackoverflow.com/questions/14547087/extracting-bits-with-a- single-multiplication/14551792#14551792)

<comment><USER7> That's really interesting, and an approach to such problems that I'd never considered. I was excited that a "Code generator for bit permutations" ([http://programming.sirrida.de/calcperm.php](http://programming.sirrida.de/calcperm.php)) exists, but using a theorem prover is really another level of possibility. Now I need to figure out how to apply it to the problem I'm currently thinking about: [http://stackoverflow.com/questions/17880178/how-do-i-sum- the...](http://stackoverflow.com/questions/17880178/how-do-i-sum-the- four-2-bit-bitfields-in-a-single-8-bit-byte/)

<comment><USER8> We can use the exact same approach used in the bit reversal trick of the article:

      ((x * 0x01010101) & 0xC0300C03) % 1023

This is probably not gonna be faster than the naive approach, though.

<comment><USER8> Thinking a little further about this, I believe using PSHUFB is the way to go, at least for when the count is large. This is because we can do 2 iterations in essentially one go (haven't tested the code, it's mostly a sketch):

      vmovdqa xmm0, [0, 1, 2, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6]
      vmovdqa xmm15, [0x0f, 0x0f, ..., 0x0f]
      vmovdqu xmm7, [rdi]
      _loop_body:
      vpand   xmm8, xmm15, [rdi]
      vpsrlw  xmm9, xmm7, 4
      vpand   xmm9, xmm9, xmm15
      vpshufb xmm8, xmm0, xmm8
      vpshufb xmm9, xmm0, xmm9
      vpaddb  xmm8, xmm8, xmm9

      vpshufb xmm7, xmm8, xmm8 ; since sum <= 12, we already have the next sum in the vector!
                               ; xmm7[0] = xmm8[xmm8[0]]
      vpaddb  xmm8, xmm8, xmm7 ; add it

      vpextrb eax, xmm8, 0
      vmovdqu xmm7, [rdi + rax]
      add rdi, rax
      sub esi, 2
      jnz _loop_body

This is likely extendable to 32-byte vectors with AVX2; have not thought much about that case.

<comment><USER7> This is exciting, but I think I may have tricked you on a couple of details. The actual distance to the next 'key' is 'sum + 5': 00 represents a 1 byte encoding, not zero, so the minimum offset to the next 'key' is 5. Thus the maximum offset is actually 17, which means one can't depend on having two keys within a single 16 byte vector. I'm trying to figure out if there is some way to compensate for this without halving the performance.

<comment><USER8> Oh, I missed that. That makes things trickier, but I think we can still get away with something like

      vmovdqu xmm7, [rdi + rax + 5 - 1]
      vpinsrb xmm7, xmm7, [rdi + rax + 0], 0

without too much of a performance penalty. The adjustments to offsets then can be put into the shuffle tables, so there should be no further significant performance loss.

<comment><USER7> Yes, I think that should work to guarantee two per vector. I hadn't previously considered trying to do that, and appreciate the suggestion and the sketch. I think I have a slightly faster (7 cycle) approach doing one at at time using a 64-bit register as a lookup for the sum of the middle two fields, but this has good promise. Especially if we can get out one farther ahead, so instead of having the vector reload on the critical path, the unused portion of the current vector and a preload can be 'slid' into place. Do you know if there is a good way to simulate a PALIGN but with a non-immediate operand? This might get down to 9-10 cycles for two keys.

<comment><USER8> I have no idea how to simulate a variable PALIGNR on Intel chips without making the loop extremely slow.

On AMD (with XOP), it can be done using VPPERM, which can shuffle from 2 sources. We can do variable alignment like this:

      vpperm xmm0, xmm1, xmm2, [[0..31] + offset]

On second thought, we can possibly do something similar on Intel using 2 pshufb and a blend.

<comment><USER7> _On second thought, we can possibly do something similar on Intel using 2 pshufb and a blend._

I tried for a bit, but haven't figured out how to make that work. PSHUFB needs a different XMM operand for each 'rotate'. Loading this operand would take 6 cycles, and I haven't thought of a clever way of generating it in less.

I do greatly appreciate your help, though. Thanks!

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER9> The author seems to misunderstand the idea of asymptotic complexity. All of the reversal operations are O(1) because the number of bits being flipped is a constant. If he were concerned with flipping the bits in an arbitrary precision number, then his different solutions might deserve "Big-O" classifications.

Second point: The reason that the original solution is slow is because a mod operation by a number that is not a power of two involves a floating point divide, or several multiply accumulates at extended precision. Either of those two operations are slower than any of the other methods.

</comment><comment><USER10> Interestingly, while x86-64 does not seem to have a single opcode for reversing bits in a byte, it has a function to arbitrarily shuffle around the 16 bytes in a 128bit SSE register [PSHUFB]. It just blows my mind how much data those SIMD instructions process or move around in relatively few clock- cycles.

[http://stackoverflow.com/a/9040426](http://stackoverflow.com/a/9040426)

[http://www.intel.com/content/www/us/en/processors/architectu...](http://www.intel.com/content/www/us/en/processors/architectures- software-developer-manuals.html) (it's on page 1256 of 3251).

<comment><USER3> It's actually shocking how _long_ it took Intel to add PSHUFB to SSE. Altivec (PPC) had the even-more-powerful vperm (arbitrary shuffle mapping 32B to 16B) way back in 1999.

<comment><USER11> The VAX (circa 1977) had polynomial evaluation as an instruction[1]. What is your point?

[1] [http://en.wikipedia.org/wiki/VAX](http://en.wikipedia.org/wiki/VAX)

<comment><USER3> Like my sibling posted, the crazy CISCy instructions aren't comparable because in general they were no faster than an equivalent sequence of simpler instructions. That's not the case for permute; there are no "simpler" instructions that let you build an efficient permute. It's one the fundamental building blocks for efficient vector code -- that's why it's shocking that it was added to SSE so late.

</comment></comment></comment></comment><comment> daniel-cussen In the GA144, lookup tables are pretty painful, so the way I implement reverse there is:

reverse: a! 16 push . 2 dup . . begin +x 2* 2* unext +x 2* a . + nip ;

In Intel x86/64, the fastest way I know of is to use SIMD instructions, and break the 64-bit word into 16 nibbles (4-bit pieces), and use PSHUFB to perform a parallel lookup against another 128-bit xmm register. Then you aggregate the nibbles in reverse order, using inclusive or and variants of the shuffle instruction.

<comment><USER12> This does an 18 bit word, right?

<comment> daniel-cussen Yep. I thought this would be a huge issue when using this, but first, it's really necessary for the instruction set, and second, a lot of hardware uses 18-bit, including FPGA's (often packed w/ 18x18 multipliers and 18bit SRAMs, in order to support 8b/10b SERDES) and 72-bit DDR3.

</comment></comment></comment><comment><USER13> The article makes the point that the lookup table version is fast because the table fits in D$, and that if the table were evicted it would be slower. This is true, but the more interesting point is that by loading this table into D$, you're potentially slowing down other operations.

It's an important conundrum of optimization that if you had 20 similarly complex functions in a critical path, implementing and benchmarking each individually with a lookup table could show excellent performance while globally performance is terrible. And worse, it's _uniformly_ terrible, with no particular function seeming to be consuming an inordinate amount of the runtime or, for that matter, D$ misses.

<comment><USER3> If you had 20 similar functions, the tables would occupy 5k in total, using only 1/6th of the L1 D$ on a typical "big" CPU. In actuality, temporal locality is such that you don't often stride through all table entries uniformly, so the actual cache pressure is even less.

The point that you're going after is a good one, but its important to keep in mind how enormous modern memory hierarchies are. It often is very reasonable to trade memory and cache pressure for speed.

</comment></comment><comment><USER14> I'm glad they noted that the lookup table's speed relies on it being in cache, which most "benchmark magic bit-fiddling operations" posts ignore. (Although it's temporal locality, not cache coherence, that's important for this.)

</comment><comment><USER15> Along the same vein, Andrew Dalke wrote up an interesting series of blog posts benchmarking different implementations of population count (counting the number of set bits in a word):

[http://dalkescientific.com/writings/diary/archive/2008/07/03...](http://dalkescientific.com/writings/diary/archive/2008/07/03/hakmem_and_other_popcounts.html)

[http://dalkescientific.com/writings/diary/archive/2008/07/05...](http://dalkescientific.com/writings/diary/archive/2008/07/05/bitslice_and_popcount.html)

[http://dalkescientific.com/writings/diary/archive/2011/11/02...](http://dalkescientific.com/writings/diary/archive/2011/11/02/faster_popcount_update.html)

The Stanford Bit Hacks page linked in the original article is also very interesting reading for folks into this sort of stuff.

</comment><comment><USER16> A great companion to this sort of thing is the book Hacker's Delight by Henry S. Warren, Jr:

[http://www.hackersdelight.org/](http://www.hackersdelight.org/)

[http://www.amazon.com/Hackers-Delight-2nd-Edition- ebook/dp/B...](http://www.amazon.com/Hackers-Delight-2nd-Edition- ebook/dp/B009GMUMTM/)

</comment><comment><USER17> _" Intel x86/x64 processors don't have this instruction, so this is definitely not a portable solution."_

This stuck out to me. I know that RISC vs CISC is basically a meaningless distinction nowadays, but I still naively expected that x86 would be more-or- less a strict superset of ARM.

<comment><USER8> Strictly speaking, AMD's XOP extensions do have an instruction that is close enough: VPPERM. It allows to not only shuffle bytes, like the already mentioned PSHUFB, but also reverse bits within each byte. Therefore, a single VPPERM instruction can reverse up to 128 bits at a time.

</comment></comment><comment><USER18> Very interesting, though you shouldn't be surprised by small differences between O(1) and O(N) algorithms when N is only 8.

<comment><USER3> If N is 8, then O(N) _is_ O(1). For that matter, so is O(f(N)), for any function f.

<comment><USER19> Is that true? I would agree that the time is bounded by a constant, but Big O only makes sense at all as the size of the input increases without bound.

<comment><USER20> If you define N<=8 from the beginning, then there exists some constant that is the maximum time the function will take. That makes it O(1).

<comment><USER21> So every terminating function is O(1) since your computer has only a finite number of possible states!

The real question is whether the input is big enough that the cost is dominated by the asymptotic behavior, and not the constant coefficient. The O(N) "obvious" algorithm was faster than the O(1) "3 ops 64 bit algorithm," so I think the answer is no, it is not big enough. N=8 sufficiently small that the asymptotic complexity is irrelevant.

<comment><USER22> I think the logical way to look at algorithmic efficiency starts by picking a reasonable N. "Number of bits in a byte" is something that very rarely changes, and never reaches high values, so it makes a bad N. The flip side of this is that something like "number of bits in main memory" is very flexible and reaches extremely large numbers, so it shouldn't be a constant.

If I wasn't making a point about different methods to flip bits, and I was just naively classifying these byte flippers, I would probably call all of these O(1). Or perhaps O(N) where N is the size of input in bytes.

</comment></comment></comment></comment></comment></comment><comment><USER23> Great analysis, although I'm curious how the idea that doing a bunch of 64 bit ops in order to accomplish byte arithmetic came about to begin with - was the function in question not written by a firmware guy?

<comment><USER24> I think this one goes back to PDP days and wasn't necessarily written to be the fastest possible implementation. The PDP could do 36*36 multiply into 72 bits. Not sure how the modulo instruction performed but there was a DIV instruction.

<comment><USER25> Down the rabbit hole says this came from HAKMEM No. 239 in 1972!

[http://www.inwap.com/pdp10/hbaker/hakmem/hacks.html#item167](http://www.inwap.com/pdp10/hbaker/hakmem/hacks.html#item167)

</comment></comment></comment><comment><USER26> Interesting. What's the purpose of reversing the bits in a byte?

<comment><USER27> A common approach for performing a Fast Fourier Transform involves reversing the bits in time-domain samples.

<comment><USER3> Expanding slightly, there's a permutation that needs to happen in order to efficiently perform a DFT in-place (and the same approach is often used even when the transform is out-of-place). For power of two sizes (one of the most common cases), that permutation is precisely the same as a bit reversal of the indices.

</comment></comment></comment><comment><USER28> If you've ever dealt with graphics file manipulation code chances are you've suffered the pain of changing the endian-ness of an image file. I never understood why some of these operations are not implemented as machine instructions that can run in one instruction cycle flat. There's nothing to them, I've done exactly that on FPGA's. Yes, they can be a little resource/routing intensive but not that bad.

<comment><USER29> > changing the endian-ness

x86 has had the BSWAP instruction since the 486.

gcc has a __builtin_bswap16, __builtin_bswap32, and __builtin_bswap64 which will presumably take advantage of these built-in instructions on x86 and any other gcc-supported architectures where similar instructions exist (and fall back to a reasonably fast and well-tested multi-instruction implementation where they don't).

You should really RTFM every couple years, just to know what your processor [1] and compiler [2] can do.

[1] [http://www.intel.com/content/www/us/en/processors/architectu...](http://www.intel.com/content/www/us/en/processors/architectures- software-developer-manuals.html)

[2] [http://gcc.gnu.org/onlinedocs/gcc/Other- Builtins.html](http://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html)

<comment><USER28> Oh, I RTFM. Not always working on Intel platforms though. And still:

[http://hardwarebug.org/2010/01/14/beware-the- builtins/](http://hardwarebug.org/2010/01/14/beware-the-builtins/)

</comment></comment></comment><comment><USER30> Oh man this is one of my nits. I've written code like this. For example in some bit counting code I have a block comment in front of all that with 57 lines that are not blank. I have a copy of Hacker's Delight on my bookshelf, but will the person after me know what and how that code works? I really hope that there was a comment before that pointing to one of the hack web pages at least.

</comment><comment><USER11> The difference here between the obvious method and the best method is 55ns. Is there a reason that this problem deserves this much attention for as little a difference in time? (I realize that it is 6.5x more, but if it isnt at the center of some core loop, the multiplicative factor doesnt really matter). What use cases are there for this?

<comment><USER31> I suppose the point was to show that it's pretty bad to resort to copy/pasting clever bit hacks into libraries without taking care of how they work.

The fact that the code isn't necessarily obvious makes me think that whoever used it was hoping for an optimisation of sorts.

Terseness can lead to obfuscation, and that's the wrong sort of optimisation. So we can hope that the developer was going for speed instead, but the results show that was a huge failure.

Maybe this won't affect performance in this particular library, maybe it's called once or twice and it doesn't matter, but if this is part of the innards of a game or a cryptographic function or some low-level network stack, it could have very detrimental consequences on performance.

</comment></comment><comment><USER32> > That's one mathematical operation, but a large number of CPU instructions. > CPU instructions are what matter here, though, as we see, not as much as > cache coherency.

I thought it was also a single CPU instruction, but multiple _clock cycles_.

<comment><USER33> It's not a single hardware instruction on a 32-bit CPU, I believe is the point.

</comment></comment><comment><USER34> Ack! Light grey on white background! My eyes!! Seriously, that's really annoying.

</comment><comment><USER35> Why on earth does this article have so many upvotes? Running time analysis is completely wrong... O(n) vs O(1) and such...tss..don't get me started..</comment>


Wired article on Hyperloop - <AUTHOR> http://edition.cnn.com/2013/07/16/tech/innovation/elon-musk-tube-transport/index.html?sr=sharebar_facebook

<comment><USER2> Odd. It is almost word-for-word with a prior post on this topic but with no credit to the original author.</comment>


Windows 95 – It's now safe to shutdown your computer - <AUTHOR> https://twitter.com/Foone/status/1070093846703304705 <comment><USER2> From the "article":

> This means it only needs memory to read the file once, then it never needs > to store it again. It's only in the VGA framebuffer, which is separate > memory from the CPU's RAM. So how the fuck is it animated?

Color cycling is not the only option available with these constraints. Windows 95 _could_ have also used VGA "hardware accelerated blit" latching to copy animation frames entirely inside VGA framebuffer (one 8-bit x86 read and 8-bit store copies 32 bits of VGA data inside VRAM) had they so decided. No conventional/extended memory needed for the animation frames that way.

VGA has at least 256 kB of VRAM while this screen requires just 128000 bytes. So there'd been ample room to store animation frames instead of color cycling.

And there's even one more option! If the bar could have been at top of the screen, they could have used VGA hardware scrolling for it. Top, because VGA only supports stationary part of the screen on the bottom while using hardware scrolling feature.

VGA could do a lot more than most people knew or still know. Like latching based "blitting", although it's probably only a net win on 286 and some 386 level CPUs and requires both source and destination to be aligned to 4 horizontal pixels. And pixel perfect scrolling _without_ copying the graphics data around with a free (no busy CPU based scanline waiting required), hardware based screen split.

</comment><comment><AUTHOR> Another fun fact from @foone on Twitter[1]:

The "It's now safe to turn off your computer" screen is (sometimes) backed by DOS, meaning you can type in "mode co80" and get the DOS prompt back. You can also type any DOS commands blind, and they'll work, invisibly!

The referenced tweet below also includes a GIF of the behavior.

1: [https://twitter.com/Foone/status/1018973818197430273](https://twitter.com/Foone/status/1018973818197430273)

</comment><comment><USER3> 95 was my first graphical OS. I did not know:

\- The "loading bar" image was loaded into and remained fixed in VGA memory. The animation was achieved by cycling the color palette over the area the bar appeared.

\- Both the loading and shutdown images are 320x400. Conventional VGA is 640x480. The smaller image took advantage of the display to stretch the image into the desired aspect ratio.

</comment><comment><USER4> For such an interesting message, twitter might be the most annoying platform to share article-like posts. Just use a blog so I can just read instead of "read-scroll-scroll-read".

</comment><comment><USER5> The author is talking about doom but the screenshot is Wolfenstein

</comment><comment><USER6> The color cycling part of this thread is really interesting!</comment>


Show HN: QPage.one – End to End AI-Powered Recruitment Automation Software - <AUTHOR> https://www.qpage.one/ <comment><AUTHOR> Hello, We are QPage.

We are an AI-powered ATS and HRM SaaS that is designed to streamline the recruitment process and human resources management by offering a variety of automation services and assessments.

We have been working on our product for a year now. We are in the open beta phase now and it would be really beneficial for us to get critique and feedback.

We are providing a huge variety of services even in our starter free plan such, which right now is the only available plan, as Unlimited User, Unlimited Job vacancy Openings, Candidate Pool, People Page, Org. Chart, Auto Job Description, Auto Shortlisting, Inside email service, Free Job Boards, On- Boarding Module and many more.

Please free to use our system and test the capabilities of our SaaS. We are also planning to provide a lifelong plan for our early adapters when we launch our final version.</comment>