Amazon's Jeff Bezos on profits, failure, succession, big bets - <AUTHOR> http://uk.businessinsider.com/amazons-jeff-bezos-on-profits-failure-succession-big-bets-2014-12 <comment><USER2> > The Kindle is trying to reduce friction for reading a whole book. It's > working.

Yes, yes it does. At least it does for me. I haven't read as much and bought as many books in decades. A considerable part of my media consumption time has shifted away from series, movies and internet back to books. Mostly because it's so damn easy to get the next book. And the next. Etc.

<comment><USER3> I got a Kindle when I was traveling around the world for 6 months. Buying a book, carrying it around and selling it for a fraction of its price 3 days later got very tiresome very soon. So I bought a Kindle, which weighs the same no matter how many books are on it.

Since then, I read way more than before (about 25 books per year, fiction and non-fiction, sometimes 2-3 in a week, sometimes nothing for a month). I also feel like I read faster.

I mostly read in English, although my native language is German, because translation is so damn easy (just point your cursor in front of a word), because English books are often way cheaper on the Kindle and there's simply a bigger selection, and because I enjoy reading English books in their original language.

<comment><USER4> > which weighs the same no matter how many books are on it

Fun fact: a fully loaded kindle weighs more than an empty kindle, by about 10^-18 grams. So, at a maximum of 50mb per book, each book would come in below 12.5 zeptograms (normally below 0.25 zeptograms).

[http://www.nytimes.com/2011/10/25/science/25qna.html](http://www.nytimes.com/2011/10/25/science/25qna.html)

</comment></comment></comment><comment><USER5> Here is the full interview on YouTube. Bezos is actually a very interesting person to listen to.

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

</comment><comment><AUTHOR> Bezos doesn't give many interviews, so this was interesting to see. I also recommend the book about him and Amazon that came out earlier this year:

[http://blog.liberwriter.com/2014/06/04/review-the- everything...](http://blog.liberwriter.com/2014/06/04/review-the-everything- store-jeff-bezos-and-the-age-of-amazon/)

In some ways, Amazon is the most unusual of the big tech companies; at least it seems that way to me. Microsoft, Apple, Google, and even newer companies like Facebook seem to have a lot more in common with one another than with Amazon.

<comment><USER6> > Amazon is the most unusual of the big tech companies

I believe Amazon is the only company which includes the CEO's message from its first annual report(1997) where Bezos says that its all about the long term.

<comment><USER7> [https://investor.google.com/corporate/2004/ipo-founders- lett...](https://investor.google.com/corporate/2004/ipo-founders-letter.html)

"As a private company, we have concentrated on the long term, and this has served us well. As a public company, we will do the same."

</comment></comment></comment><comment><USER8> This was posted a couple of days ago at [https://news.ycombinator.com/item?id=8746111](https://news.ycombinator.com/item?id=8746111) , though with the given title of "I Asked Jeff Bezos About The Tough Questions"

</comment><comment><USER6> I didnt know that Bezos's invested in Google. Does he still hold the stock?

<comment><USER9> I wouldn't know anything about that. But Bezos did buy a startup (junglee.com) whose founders went on to invest in Google (and become billionaires, and hold board positions there and then challenge Amazon's core business which is e-commerce).

</comment></comment><comment><USER10> "You'll buy anything/unwanted you think the store is losing money on" \--eCommerce business model

</comment><comment><USER11> These aren't really "tough questions". Still, Bezos gives a good interview and makes Amazon sound like a good place to work. He's right-on with this:

 _What really matters is, companies that don't continue to experiment, companies that don't embrace failure, they eventually get in a desperate position where the only thing they can do is a Hail Mary bet at the very end of their corporate existence._

I've seen that first hand. It's ugly, especially because the best people leave companies where they don't get to innovate and own new things, so you're doing that "Hail Mary pass" with a lot of deadwood in your ranks.

That said, I'm having a hard time reconciling his pro-innovation stance with Amazon's use of stack-ranking, which causes divisions to ossify and halts innovation. It seems hard, after a point, to innovate if you don't trust your own people. You'll have a core in-crowd that will toss you ideas for a while, but eventually they run out and lose the ability to keep pace.

That's the question that I would want to see asked: how do you reconcile your ideals (which are admirable) with the reality of a company known to use stack ranking?

<comment><USER12> Stack ranking may, in a sense, exist at Amazon. But as a developer here, it's invisible to me. I write my reviews of some of my colleagues (I choose which), they write reviews of me. All reviews of me go directly to my manager, who will compile them together with his review of me and my review of myself to build a full year-end review of my performance.

Those yearly reviews will factor somehow into my pay, bonuses, etc, but I only see the final result of it. Was I stack ranked?

<comment><AUTHOR> Do people who otherwise did an acceptable job get canned just because they ranked at the bottom? That's the concern about the practice, I think.

<comment><USER13> Yes. That is exactly what us happened. I know a few people who were edged out like that.

Make no mistake, Amazon is not a great place to work. Ok place to work maybe. Good if you have managed to fit in. But even after that, they underpay. Friends with literally a decade of time out in are making relatively low considering their wide areas of responsibility.

<comment><USER14> You can criticize Amazon for a million things, but underpayment is not one of them.

<comment><USER15> You're the first person I've ever heard defend Amazon's compensation. What are your sources?

<comment><USER16> Comparing with my friends over at Microsoft, while the base salary is certainly lower, cash bonus and stock pretty much equalizes compensation, at least as an SDE I. Total compensation is lower than Google/Facebook, but that's a high bar for ANY company.

I think this myth really continues both because people tend to only pay attention to base salary and don't consider cost of living/state taxes, and due to the fact that Amazon does underpay warehouse workers, as evidenced by the current strike in Germany.

I can't speak for higher level positions though. But Amazon tends to strongly favor giving out more stock over more cash, which goes back to the same issue of not comparing total compensation.

<comment><USER17> Recruiters push the "total compensation" idea because it's cheaper than offering real money, but in my experience salary is all that matters.

Stock always comes with a vesting schedule and a forfeit clause, which means that if you accept more stock as a substitute for a better salary, you are implicitly agreeing to let them retroactively underpay you for the last couple years of your tenure, whenever you move on to the next thing.

Don't kid yourself that you're going to stay at the same company long enough that it won't matter, either; the raise you get by switching jobs always dwarfs the raise you get by sticking around and jumping through the perf hoops and trying to get a promotion. So the only way to make the stock pay out is to screw yourself on salary over the long term.

What's more, keeping a large portion of your net worth in your employer's stock is a terrible diversification strategy, so you will probably end up flipping it and investing in something else as soon as it vests. So.... what was gained by accepting compensation in stock, again? I'd rather they just pay me cash money and let me invest it however I want.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER18> What I don't get with Amazon is that they continue to spend whatever they make to capture market share but at what point will they start reaping what they sowed? What happens when there is suddenly no capital around to help this growth but competitors have plenty of cash in their vaults?

<comment><USER19> What happens when there is no capital around?

I'm not sure in what scenario that would happen. Amazon is funding its other growth with cash from its core business, which continues to expand. Your scenario would require that Amazon's core retail business die.</comment></comment>


Apple's Organizational Crossroads - <AUTHOR> https://stratechery.com/2016/apples-organizational-crossroads/ <comment><USER2> Nah. DuPont was selling gunpowder and paint to completely different customers. Apple sells devices and services to the same customers. Furthermore what they are selling needs to be tightly integrated.

<comment><USER3> Apple Services could be sold to very different customers - those on Android and Windows devices.

<comment><USER4> This assumes Apple can get their iCloud working properly. I've avoided pings from them in the past because their is no leadership in this area. ICloud has been a failure for multiple years.

I'm not comparing management, but iCloud reminds me of the non-dropcam part of Nest - basically unable to deliver.

I've been contacted by both for roles and just think why would one want to be part of a dysfunctional after thought?

<comment><USER5> I agree that the iCloud brand has generally been a failure. Does anyone ever proudly use their @icloud.com address anywhere? MobileMe is considered an embarrassing failure by many, but I still see @me.com email addresses from time to time.

But technically, iCloud is not really one "thing". iCal, Reminders, Notes and Photos work pretty well, whereas iCloud Core Data is an unsalvageable afterthought. Working on some parts might still be fun.

</comment></comment></comment></comment><comment><USER6> Well argued rebuttal and counter by John Kirk at Techpinions

[https://techpinions.com/apple-shouldnt-cross-that-road- till-...](https://techpinions.com/apple-shouldnt-cross-that-road-till-they- come-to-it/45209)

<comment><USER7> Thanks for sharing - I wouldn't have found this otherwise.

Is anyone aggregating discussions like this today?

NYT has some opinion pieces and shares rebuttals, but I haven't seen long-form opinion aggregators around.

<comment><USER8> > Is anyone aggregating discussions like this today?

That's something I'd like to see as an official feature on HN or reddit. In addition of normal comments on the article you can also add "additional information from a qualified source" (which can be either a qualified user or another article from another reputable journalist).

But I am not sure if that would work. Perhaps it would be fine on HN, but it would be difficult to enforce and moderate on reddit.

</comment></comment></comment><comment><USER9> The reason why services and devices can't be totally separated as gunpowders and paint is software. Apple's recent software qualities have been facing many challenges and varied user feedbacks, Apple Map, Siri, FinalCut update, New Photos, iCloud hack issues. I doubt their organization structure is the magic fix to their software issues, in fact, a complete separation between devices + services might make some of their software challenges even harder.

</comment><comment><USER10> Is Amazon a good comparison? Amazon Web Services is a separate organization from the consumer side (amazon.com, zappos, etc).

As I understand it, the "jewels" (retail/consumer) do depend on AWS...they supposedly are strong on "eating your own dog food". But, they have roughly equal footing and representation. There is the difference that Amazon's services can be sold standalone, rather than just bundled, I suppose.

<comment><USER11> Amazon and AWS have different markets (consumers vs business), similar to DuPont's paint and gunpowder (consumers vs military). Generally speaking, the markets don't overlap.

As noted in other comments here, Apple's products and services are both consumer-focussed; ideally, you're trying to sell the consumer both of them, so the outcomes for the two are co-dependent. Amazon doesn't really care about how many instance-hours AWS sells; the iCloud team cares a lot about how many devices Apple sells.

</comment></comment><comment><USER12> Services are hardly a unique Apple specific problem though. For a few that get services right you'll find many that suck. It takes a very different collective mindset, culture, processes and iterative improvements - those are a no brainer. Beyond those it also takes unconventional innovation at multiple different levels - look at how HTTP2 happened for example and look at how everything underneath GMail must have improved to make it what it is. Also think of AWS and how many first-have problems they must have needed to solve.

It's hard to get services right and even harder to keep them right. I am of course not saying Apple can't get there but merely separating the hardware and software/services isn't a meaningful first step.

<comment><USER13> I don't know about processes or mindset; I think it's mostly a matter of hiring real Engineers and letting them do real Engineering on your backend. _That 's_ a cultural problem, though, on an organizational level: if you run everything in the "20-somethings burning midnight oil to ship" mode, the experienced Engineers don't want to join you. You'd have to shift your culture into one that has room for them (like e.g. Facebook is continuing to attempt to do with the Engineers from Whatsapp.)

</comment></comment><comment><USER14> This article makes the case Apple should have a dedicated Services division.

Pretty sure Eddy Cue runs a division called "Internet Software and Services" which is iCloud/Maps/Siri etc: [http://www.apple.com/pr/bios/eddy- cue.html](http://www.apple.com/pr/bios/eddy-cue.html)

Article: 0 Fact: 1

<comment><USER15> Yes, but what Ben is proposing is that instead of being a functional division, it would be it's own business unit reporting it's own profit-and-loss. That might even mean having it's own engineering team, it's own design team, it's own sales, etc, etc. Maybe not all of those, but certainly some of them.

</comment></comment><comment><USER16> This is the road that IBM and HP went down, isn't it?

Stop making things and start providing services around the things you used to make.

</comment><comment><USER17> This is dated 4/19, but I would swear I've read this (and seen the same organizational graphics) before. Was this already posted somewhere else? Is this a summary of a bigger work that is getting the summary treatment on multiple sites?

Weird.

<comment><USER17> Ah. Realized it was probably the discussion of Microsoft in 2013 on the same site.

[https://stratechery.com/2013/why-microsofts- reorganization-i...](https://stratechery.com/2013/why-microsofts- reorganization-is-a-bad-idea/)

</comment></comment><comment><USER18> The scary example against the "separation" the author suggests is Sony, having the structure where the different profits and loses produced the results where one Sony makes another Sony worse and vice versa.

</comment><comment><USER19> fascinating thought is what a well-run services Org looks like?

and how that can layer onto a hardware / device Org.. they never seem compatible

</comment><comment><USER20> This post makes the case that Apple is not organized in a way to allow it to effectively run services like iCloud, iTunes, Apple Pay, etc. I haven't worked there in ten years, but back then at least, I'd agree with that. Teams and orgs were heavily siloed and vertical.

However, then it goes on to say a few things that I think are harder to defend. The author talks about how it's hard for Apple to build good services since they're so focused on achieving perfection with a tightly integrated device that has a new release once or twice a year. Basically, the thesis is that since the market penalty for releasing a bad device is so high, Apple has thrown a lot of resources into getting the device right the first time, which makes it very hard for them to think or operate at the tempo you need when operating services:

"You only get one shot to get a device right, so all of Apple's internal rhythms and processes are organized around delivering as perfect a product as possible at a specific moment in time."

This isn't right in a couple ways. First, Apple has released all kinds of sub- par hardware in the past. And will likely do so in the future. Apple says they are looking to achieve perfection, and it sounds noble, but it's more of an iterative process than this article makes it sound like.

Second, many of a device's features, especially the integration that the author lauds, are actually in software. Particularly the integration pieces that make the device seem like magic. And those are updated often as one can see with the release tempo of iOS updates. The pattern has been the same for a long time--release a bunch of new features in iOS X.0, then do point releases to fix bugs, plug security holes, and make minor tweaks to fix annoying things and make the user experience feel more smooth.

The other conclusion I don't agree with is that the author says that in order for them to build better services, they need more accountability, which would be achieved by tracking profit and loss for each service and making the leaders financially accountable. I agree that accountability is something that's required to create strong services, but it's not the primary lever I would use. And I certainly wouldn't bring P&L into the accountability equation since that incentivizes the different service orgs to grow adversarial relationships. It's old company thinking IMO.

Instead, I feel you need to build better services by building a better infrastructure culture. A lot of people look at situations like this and look for punitive or regressive measures to fix the problem, i.e. using the stick instead of the carrot. I think however they would build better services by focusing on other levers like open communication (the heavy siloing meant a lot of duplicated work), being open to criticism (lots of politics and defensiveness meant fiefdoms and grudges were created), a focus on instrumenting and measuring performance of services to have the right picture for how everything is working together (instrumentation and visualization of performance was terrible), a culture of learning from mistakes instead of assigning blame, having embedded SRE-like engineers who focus on production quality and availability instead of having separate second-class ops teams, etc. I could go on, but I have a really strong objection to boiling all their problems down to not making each service unit financially accountable. That won't fix things, it will instead make the internal culture on the infrastructure side much worse.

<comment><USER21> The comment was marked as "dupe" but I don't see why so I vouch it. Is it a bug ?

<comment><USER22> Check the guys comments to see the dupe. He posted the same comment to a separate submission of this article.

[https://news.ycombinator.com/item?id=11559781](https://news.ycombinator.com/item?id=11559781)

<comment><USER20> Yeah, I didn't realize you couldn't do that. Next time I'll just put a link to the comment versus pasting it verbatim.

</comment></comment></comment></comment><comment><USER23> this article is all fluff.</comment>


Apple's plan to sell used iPhones in India officially gets rejected - <AUTHOR> http://www.cnet.com/news/apples-plan-to-sell-used-iphones-in-india-officially-gets-rejected/ <comment><USER2> This really was a great plan and I hope Apple can make it work.

With the iPhone Upgrade Program, Americans can finance a new unlocked phone with 0% interest, reducing the cell carrier lock-in. After 12 months, you can exchange your old phone for a new one.

Now, Apple has millions of 12 month old, last gen phones. India requires 30% of products sold to be sourced in India, so Apple planned to refurbish these used iPhones in India and then sell them in market.

It really was a great way to get Americans to upgrade more often, reduce the power of American cell companies, and provide an affordable product to an emerging market.

Apparently refurbishing the phones in India isn't enough to satisfy the 30% rule.

<comment><USER3> > It really was a great way to get Americans to upgrade more often

I cringe in fear when I read this line. The voracious appetite and the unwavering focus on economic growth is hurting the entire world. Isn't it a time to step back and rethink our long term strategy as one species?

 _I routinely board very large airplanes without having the vaguest idea of how they work or how to fly them - I 'm a passenger, and happy to ride along. I take buses, and taxis, and ride shotgun when others drive, without sweating it. But put me behind the wheels of the car, and I suddenly need to know a whole lot more. Manual or automatic? Mirros adjusted right? Where is the knob for the headlights? Emergency break, just in case? Where I buy a new car, I actually do skim over the manual.

...

A reporter called recently and asked how long it would take Earth to "forget" humanity if we suddenly disappeared. In some sense, we are now unforgettable - the human-caused plant and animal extinctions have emptied biological "jobs" and that will be filled over many millions of years by creatures who will owe their existence to use wiping out the competition. We have pumped oil and gas out of the ground that had been there for hundreds of millions of years, through holes that may not be eroded away for additional hundreds of millions of years. The human "layer" of plastic and aluminum foil and heavy metals may be recognizable in sedimentary piles hundreds of millions of years from now.

...

With the among of stuff we use, and the amount of the world we occupy, we are no longer passengers napping in the back seat of the car. We are everywhere, and changing everything. Hence many environmental scientists are now involved in figuring out what we are doing, how to operate a remarkably complex and involved Earth system, and how to make the ride as enjoyable as possible.

I'm concerned that a lot of people, including some of those whow are making laws, still think that they are sitting in the back of the car, looking our the window and enjoying the ride.

\- 'Earth - The Operators' Manual' By Richard B. Alley_

</comment></comment><comment><USER4> To understand the insanity behind the Economic Policies of India, I recommend people to read "The turn of the tortoise" by T.N.Ninan. An eye opening and honest view from financial/economic point of view.

Some salient points are,

\- Indian Government acts paternalistic (at times with good intentions) but becomes parasitical in practice.

\- Indian corruption is rent-seeking unlike some high growth nations where corruption is more like profit sharing

\- India is a Center-Left country, with Fabian Socialism as the default political mindset, so Price controls and market control is the favorite practice of protectionism and fountainhead of black and gray markets.

I strongly recommend, whether you are Indian or interested in India.

<comment><USER5> India is a huge market for mobile phones. There are 400 mn+ smartphone users here. 1\. Why should the government allow someone to come and sell old phones ? 2\. These phones would have lesser shelf life and once they become bricks, India would need infrastructure to recycle these. In absence of this infra, it may lead to more pollution. 3\. Why doesn't APPL reduces price of their mobile phones to bring it to the level where it can compete with other players ? Samsung, Lenovo, HTC, Xiomi etc are doing very well here. They price phones competitively and some even make phones here. They do not need to sell refurbished phones. Their phones are better spec'd and have more relevant features compared to iphone.

Tim cook, on his recent visit to India, admitted that iphone is indeed mispriced in India. In my view this is very good decision by the government. You must understand more about the topic at hand than putting that passive aggresive comment here

<comment><USER6> >1\. Why should the government allow someone to come and sell old phones ?

For the reason that pretty much all other countries allow it - that it benefits the buyer and seller?

<comment><USER7> > that it benefits the buyer and seller?

You would have to prove that assertion. Or at-least make a case beyond the superficial level.

Like the parent poster said, India doesn't want to turn itself into a e-waste dump for the world. Such a situation would be bad for its citizens as the older phones need to be recycled/processed.

</comment></comment></comment></comment><comment><USER8> All foreign retailers run into this problem entering India. Ikea has been building factories so they can start sourcing from India in order to comply. Moving their production out of Pakistan and Bangladesh into India in order to comply to tackle the bigger market. Foreign owned businesses need to stock 30% or more of products sourced from India.

<comment><USER9> The fact that companies are choosing to comply rather than simply not do business in India seems to mean that their policy is a huge success.

<comment><USER10> The policy is great for Indians and the companies involved. Jobs mean money to spend and a thriving economy.

The same policy implemented here would be great to rebuild our crumbling economy and get money flowing.

<comment><USER11> Hardly any economists -- who are trained in analyzing these proposals -- agree with this sentiment.

There are significant second-order effects of protectionism that are harmful yet not well understood by politicians or voters: retribution by other trading partners, increased prices and inflation are but a few.

<comment><USER10> It's working great for India and Brazil. Jobs, happy people, money flow.

<comment><USER12> Ask people from Brasil how much they enjoy the high prices they pay for consumer electronics some time.

</comment></comment></comment></comment></comment></comment><comment><USER13> This is really horrible news for Apple. According to this article [1], their sales volume fell from 55% to 37% in India in the first 1/4\. Meanwhile, Samsung goes from 35% to 62%.

Selling used iPhones there would have allowed them to dramatically increase sale volume in the low-end market which could have helped them regain some ground.

[1]: [http://www.thehindu.com/sci- tech/technology/gadgets/samsung-...](http://www.thehindu.com/sci- tech/technology/gadgets/samsung-galaxy-s7-edge-review/article8671596.ece)

</comment><comment><USER14> Is there some kind of law in India against selling used phones? Or was this an arbitrary decision by the commerce and industry ministry? I guess I don't see what the big deal is (and the article isn't clear to me).

<comment><USER15> India has a law that a seller must source at least 30% of a product from intra-India businesses in order to do business in India.

In my opinion, this is a very intelligent law. It's goal is to induce industry in India and limit (predatory/highly desired) products that remove wealth from the country, a country that needs desperately work for it's people.

<comment><USER16> What's a predatory product? That seems silly to me: people only buy something when they value what they get more than what they give up to get it. And how does it remove wealth from a country? Allowing people to satisfy their desires in the most direct way possible doesn't seem in conflict with the goal of creating wealth, so I'm honestly finding it hard to understand your reasoning here.

I would argue that any form of trade protectionism is not intelligent: it's very short-sighted and sacrifices actual wealth for employment. It's the type of thing that sounded and felt good to me only before I actually tried to learn a bit of economics.

Think of it in terms of a small town that passed a law banning any form of trade between residents. Technically, 100% of people would be employed. They would be employed knitting their own sweaters, milking their own cows, growing their own grain, cooking their own food, gathering their own building materials, pumping their own water, etc. So life would be paradise with 100% employment right? Without trade, people would be on the edge of starvation and extreme poverty constantly. Scale up that analogy to put the residents of that small town as countries, and you can see where protectionist policies protect jobs at the expense of actual prosperity. North Korea is an imperfect extreme example, but you can easily see what effects limiting trade has on prosperity.

If I was a politician, I'd love to pass all kind of trade policies like this because most people haven't really studied economics so it's easy to spin up your consolidation of power as protecting jobs.

<comment><USER9> I'm not going to argue the whether protectionism is a good thing in general but a predatory doesn't mean that it's not worth it to the buyer, but that the profits of the sale leave the country.

As an extreme example, if your country exports nothing but you have citizens buying goods from other countries then over time the country is going to become poorer and poorer as the capital flows out of the country.

Free trade is good for regions with industry and when workers have the means to relocate to areas with employment. Until our immigration policy is indistinguishable from 'we're all basically one country' then trade protections are going to sometimes be a country's best option.

<comment><USER17> This is way to simplistic of an argument. In particular you are ignoring the affect of currency exchange rates as it relates to foreign trade.

</comment></comment></comment></comment></comment><comment><USER18> The article wasn't clear. Does this prevent Apple from selling used (refurbished) iPhone _period_ or can they sell them if they also sell new ones?

<comment><USER19> The original article is a bit better:

[http://www.livemint.com/Companies/lDn53REhqvhqGoIxs9MgwJ/App...](http://www.livemint.com/Companies/lDn53REhqvhqGoIxs9MgwJ/Apples- proposal-to-sell-refurbished-iPhones-in-India-reject.html)

Apple isn't actually prevented from selling either new or refurbished iPhones in India. What it appears that they cannot do, though, is open any Apple Stores there, because they don't (or can't) comply with a rule that "at least 30 per cent of the value of procurement of manufactured/processed products shall be sourced from Indian small industries" (from a similar story about Walmart: [http://www.thehindu.com/business/Industry/30-local- sourcing-...](http://www.thehindu.com/business/Industry/30-local-sourcing- norm-cant-be-met-walmart/article4945700.ece))

It looks like what they wanted to do was to manufacture the original phones in China, as always, but do the _refurbishment_ in India, and thereby call the refurbished phones "locally sourced". If they could do that, then they could run their own stores in the country, assuming that the refurb phones made up 30% of their product.

The Indian government rejected _that_ idea, so I presume that Apple will need to continue selling through third-party retail stores, or come up with another way to comply with the rule.

<comment><USER20> If apple is serious, why don't they build a factory and make phones in india? When Ford, Hyndai, GM, Toyota can manufacture in India, why not apple?

<comment><USER21> Because opening Apple stores in India isn't worth changing their whole production and supply chain.

Ford, Hyndai, GM, Toyota are all car companies. They're used to dealing with local production requirements.

</comment></comment></comment></comment><comment><USER5> Agreeing to all the whims and fancies of western companies is something governments should never do. In my view free market is propaganda by these companies to make these kinds of restrictions feel dirty. Before you attack me, hear me out.

China has many such restrictions on many such products. China blocked out internet and internet companies, which resulted in home grown products emerging and becoming really successful (alibaba, tencent, baidu, didi etc). Indian government did not put any such restriction on virtual products. This has resulted in Google, facebook and microsoft having literal monopoly on the market. There are some restrictions for companies like Amazon and Uber. This has resulted in a healthy local competition and ecosystem to develop and compete with international competition like Uber and Amazon. In the end, some of these local companies won't survive independently and got bought by international players. This, in my view, is a much better outcome as this makes international players to entrench heavily and invest in the local market.

Lets look at telecom, banks and airlines. Govt discouraged entry of foreign players into Indian markets by making rules of entry tighter. This has resulted in companies like Airtel, Idea, Reliance and Tata to become strong players in telecom. Believe me, Indian telecom sector has lowest tariff in the world and has really huge reach with more than 850mn subscribers. These companies have innovated and made sure that global competition did not kill them. Sure some companies got bought by likes of Vodafone. However, companies like Airtel managed to go global.

In banks, none of the foreign players have managed to pickup any significant market share in view of healthy competition by private Indian banks like HDFC and ICICI. In airlines, again, government disallowed foreign players. They have to be content with buying large chunks of really successful Indian homegrown players.

Lets look at mobile phone market. Indian government did not put a barrier for phones to be imported. They just blocked second hand phones by slapping a large anti dumping duty. This has resulted in virtually zero production of these mobile phones. With more than 400 mn smartphone users, who lost by letting big smartphone makers to import ? No Indian homegrown industry, no ecosystem. All they managed to do is to make sure all these phones where new and not refurbished.

I strongly believe that big countries like India, should have some sort of protectionism in the infancy stage of an industry. When you have strong local competition, only then these markets should be opened up for global competition. If the local competition that has managed to sprout is capable it will ward off global competition and establish a healthy equilibria. If not, global competition would rule the market and that should be fine. Point being, give local ecosystem a chance. By letting Apple sell second hand phones, India would open itself up to be dumping ground of the world. Soon enough all end of life phones would end up in India masquerading as refubrished.

</comment><comment><USER22> Sell a $300 charger bundled built in Indian with a free iPhone?

<comment><USER23> The 30% is by components, not price, so that would have to be a ridiculously complex charger...

</comment></comment><comment><USER24> Should Apple make a much cheaper version of the iPhone?

</comment><comment><USER25> Yeah! Lets just keep on manufacturing in an unsustainable manner.

These aren't you cars, these are chips which could'nt care or show effect of being n-handed.

<comment><USER26> They're not saying Apple can't sell used phones or that Indians can't buy and use used phones.

All that's happening is that Apple can't classify their refurbished phones into a regulatory category they would like to classify them as.

The fact this "news" source made that misinterpretation possible in the first place means they knew the story was boring. So they made it vague in a way that you wound assume the wrong thing.

</comment></comment><comment><USER27> What could possibly be the reasoning behind this?

<comment><USER28> If you don't want to read further than the headline then don't read further than the headline. But you seem curious to know more so maybe you should read further than the headline.

<comment><USER27> Huh? Which part are you referring to? At least overtly, there is only "we are not in favor of used phones". Why not?

Edit: looks like iclelland explained it [https://news.ycombinator.com/item?id=11822713](https://news.ycombinator.com/item?id=11822713)

</comment></comment></comment><comment><USER20> Apple iphones are overpriced. There is nothing technologically awesome about iPhone, except the high prices.

<comment><USER17> They are overpriced for _you_.

There is no single 'correct' price for anything because everybody values things differently.

<comment><USER7> Yes, but not having a single correct price doesn't mean that something can't be considered overpriced. A bottle of water sold at 2.5 million dollars would probably be considered overpriced by most people.</comment></comment></comment>


Pulsus - a game of particles - <AUTHOR> http://www.pulsusgame.com/ <comment><USER2> Thanks. I built pulsus and just created a new, much improved, version for the iPad. I just submitted it to the app store today, so it hopefully will be available soon. I'll post it as soon as it is.

</comment><comment><USER3> For another game that is a pretty similar to this one, check out [Auditorium](<http://www.playauditorium.com/>).</comment>


The Paige Compositor (1997) - <AUTHOR> http://www.uh.edu/engines/epi50.htm

<comment><USER2> There's lots more about this in The Autobiography of Mark Twain.

See [http://www.ucpress.edu/book.php?isbn=9780520267190](http://www.ucpress.edu/book.php?isbn=9780520267190) or [http://www.amazon.com/Autobiography-Mark-Twain-Complete- Auth...](http://www.amazon.com/Autobiography-Mark-Twain-Complete- Authoritative/dp/0520267192)

</comment><comment><USER3> Error 404?</comment>


How To Write A Calculator in 70 Python Lines - <AUTHOR> http://blog.erezsh.com/how-to-write-a-calculator-in-70-python-lines-by-writing-a-recursive-descent-parser/ <comment><USER2> How to Write a Calculator in 1 Python Line

        print input()

        > 25*4-50
        > 50

<comment><USER3> It accepts more than just numbers though:

      >>> print input()
      "a"+"b"
      ab

<comment><USER4> Mathematically, this is wrong.. a + b is not ab.

<comment><USER5> It's not symbolic...

<comment><USER4> Of course. I understand that "a" + "b" when taken to mean "concatenate the strings" is "ab" but OP's post was a calculator. It would not have yielded this result.

</comment></comment></comment></comment></comment><comment><USER6> Very cool.

Thanks for the cool post. I am not sure I got the difference between the LL and LR parser. Is what you have above an LR parser?

Also, why did you choose to represent both + and - as "ADD" tokens (and * and / as "MUL") is this to enforce evaluation priority? It would be interesting to see if you can add __or ^ as an exponent for this calculator.

Maybe you intended this post strictly as as an educational post, but I think doing parsing right (and from first principles) is a really cool thing to have. Check out how khan-exercises framework uses to parse math expressions into an AST: [https://github.com/Khan/khan- exercises/blob/master/utils/mat...](https://github.com/Khan/khan- exercises/blob/master/utils/math-model.js)

<comment><USER7> An LR-parser tries to reduce the input over and over again into rules, eventually ending with the 'start' rule. So a+b+c+d becomes [add]+c+d -> [add]+d -> [add] -> [start]

An LL-parser tries to expand the initial rule into a more complex rule structure, until it matches the input. So to match a+b+c+d it will do [start] -> [add] -> [add] + [num] -> [add] + [num] + [num] -> etc.

What I wrote is an LL-parser, simply because it's much much simpler to write and to understand.

Yes, both ADD and MUL are used for precedence. Since any list of +- or of */ will evaluate correctly if reduced from left to right, I didn't mind grouping them together and making my life easier (and shorter).

It was strictly educational, and also a shtick; a short code hack. If I was to write an actual parser (and I don't think I would ever try to), it would look very different!

</comment></comment><comment><USER8> Very nicely done!

I think a precedence parser could be even shorter, though I don't seem to have one handy in Python. Pratt parsing is similar, though: [https://github.com/darius/sketchbook/blob/master/parsing/pra...](https://github.com/darius/sketchbook/blob/master/parsing/pratt.py) And here's precedence parsing in C: <http://wry.me/~darius/hacks/dcalc.c> (I learned this method from Dave Gillespie, author of Gnu Calc.)

Finally, using a small parsing library very similar to the scheme in this post: [https://github.com/darius/peglet/blob/master/examples/infix....](https://github.com/darius/peglet/blob/master/examples/infix.py)

</comment><comment><USER9> The calculator seems to miss the point of recursive descent parsing. The parser should follow naturally from the grammar. As an example, here is a 52 line python calculator:

<https://gist.github.com/ascv/5022712>

The idea isn't to 1-up the OP but rather to showcase the technique of recursive descent parsing. The wikipedia entry for recursive descent parsing also has a very nice example.

<comment><USER7> Well, to be fair, your calculator seems to miss the point of being a calculator...

        > 10/2*2
        2.5

<comment><USER9> Clearly a bug. Thanks when I have more time I will fix it. I didn't give much thought to operator precedence, I assumed the user would specify it using parentheses.

The idea is what is important though. Recursive descent parsing uses the functions that correspond to types in the grammar to mutually call each other thus parsing the expression recursively in a descending fashion.

</comment></comment></comment><comment><USER10> this reminded me of something similar i did (i'm afraid my recursive decent parser is probably more opaque) - differentiating numerical expressions in python. <http://www.acooke.org/cute/Differenti0.html>

</comment><comment><USER11> Here is a similar calculator implemented in 58 languages including in 16 lines of Python code :)

<http://www.math.bas.bg/bantchev/place/rpn/rpn.impl.html>

<comment><USER12> This is an RPN calculator, which means you can basically execute the input using the token stream directly. TFA shows executing a context free language, which requires parsing, explaining the program being an order of magnitude larger.

</comment></comment><comment><USER13> FYI this <http://www.imgur.com/5Ge93Xc.png> is what it looks like on my Nexus 4, perhaps it's worth considering a more mobile-friendly layout ;)

</comment><comment><USER14> This article seems rather un-Zen

>>> import this

... though rules are made to be broken

<comment><USER7> Why is it un-zen?

<comment><USER15> I think it is not too unzen in its aim and method but if you ask there many little tricks that I'd say are unzen. First, give all the code a pass of autopep8 comb. Second, avoid things like "lambda (op,num): (num, -num)[...], just use "x if y else z"

Then you wouldn't be too far from Norvig's little educational gems.

<comment><USER7> I suppose I got carried away with the lambdas :)

Thank you, you gave me a great compliment. Norvig's short spellchecker was very inspirational for me.

</comment></comment></comment></comment><comment><USER16> I wonder if there's a way to add algebraic equation solving to this, or something like it, easily.

<comment><USER17> Not easily, and not in 70 lines. But there's the Python library "sympy" which can do symbolic algebraic equation solving (and many other things):

        from sympy import *
        var('x,b,c')
        print solve(a*x**2+b*x+c,x)

Result:

        [(-b + (-4*a*c + b**2)**(1/2))/(2*a), -(b + (-4*a*c + b**2)**(1/2))/(2*a)]</comment></comment>


Regular Expressions – Mastering Lookahead and Lookbehind - <AUTHOR> http://www.rexegg.com/regex-lookarounds.html <comment><AUTHOR> Most of the time I mention the topic of regular expressions to other developers, I usually hear self-critical commentary like "oh, I'm terrible at regex", and rarely anyone who loves them. I think they're great though, if you take the time to understand them. They're something like a Swiss Army knife for programming.

<comment><USER2> A programmer saying they are terrible at regex is like a mathematician saying they are terrible at algebra.

<comment><USER3> You are so right! How could you possibly go out of practice in real-time biomedical algorithms engineering when you might use them one or two times out of the year?! I must have missed the memo where all those strings are encoded in a patient's hemodynamic signal.

There are few people more frustrating to algorithms engineers and embedded engineers than people like you who think you are the only type of programmers out there or that the programming you do is somehow superior(despite largely relying on math you learned at a decent secondary school).

<comment><USER4> I agree. If I ever need to use regex, I will dive in, but I don't mainly write software to process text. I mainly write control software for various things like subsea oil wells, oil rigs, gas turbines etc. It is enough for me to know it exists. I try to spread myself thin and broad, and then that gives me the control of which areas to dive deep, depending on the task at hand.

</comment></comment></comment></comment><comment><USER5> > It is that at the end of a lookahead or a lookbehind, the regex engine > hasn't moved on the string. You can chain three more lookaheads after the > first, and the regex engine still won't move.

Omg, thank you, that is the insight I needed and now I completely get it. Internet +1 for the day.

</comment><comment><USER6> A use-case for lookarounds that I often use is:

        grep -Po '(?<=...)pattern'

Which also cuts out and prints the relevant part of the line. This saves a trip through cut, awk or perl. (-P is PCRE and -o is print only matched characters, which the lookarounds aren't a part of.)

<comment><USER7> I often use `\K` instead, which also helps if it is variable length lookbehind

        $ echo 'foo=5, Bar=3; x1=83, y=120' | grep -oP '\b[a-z]+=\K\d+'
        5
        120

further reading: [https://stackoverflow.com/questions/11640447/variable- length...](https://stackoverflow.com/questions/11640447/variable-length- lookbehind-assertion-alternatives-for-regular-expressions/11640500#11640500)

</comment></comment><comment> d--b > our pattern becomes:

> \A(?=\w{6,10}\z)(?=[^a-z] _[a-z])(?=(?:[^A-Z]_ [A-Z]){3})(?=\D _\d)._

And then these guys wonder why people hate regexes? The "now you have 2 problems" quote fit perfectly for that case.

<comment><USER8> The regexp syntax was devised for write-only programming at the terminal (at a time when a terminal was a physical object, not a window in your GUI).

The regular formalism is pretty neat though. There are alternative syntaxes (e.g. multiline regexps in Python) that are better suited for complex matchers.

</comment></comment><comment><USER9> While useful to some I think advanced RE are like mixing in Perl or playing code golf with production code. They tend to make code harder to read.

My preference in such cases is for multiple separated or longer REs (which can be at least split in the surrounding code) and each part named or heavily commented. Of course it's always worthwhile to consider non-RE solutions if the problem can be broken down enough.

EDIT: Fixed typo

<comment><AUTHOR> Fair enough, but I really think the benefits of advanced regular expressions are underappreciated in non-production and even non-application contexts. Laypeople (and occasionally even developers) are impressed when you show them how to search through a document or file system using a really complicated pattern, where it would have taken several iterations of data manipulation to achieve the same result without using advanced regular expressions.

<comment><USER10> It'd help a _lot_ if the grammar was actually readable. Combinations like .* don't visually "read" like a single unit, and then to make everything worse you often need a crazy amount of backslashes.

I'm not sure how you could fix that without introducing completely new characters or color-coding parts of the expression though.

<comment><USER11> The back slashes for escaping are absolutely _awful_. This is one of the worst things about Java.

It's much better in languages with regex literals like Ruby and JavaScript.

<comment><USER12> It's especially nicer in Ruby (which got it from Perl) where you can use whatever delimiters you like for regexes, with /abc/, %r"abc", %r{abc}, %r#abc# and so on all being equivalent, so you can just about always pick something that won't clash with the characters in your pattern (You can even use spaces as the delimiters, which looks terrible).

</comment></comment></comment></comment></comment><comment><USER7> I came to know about this wonderful site when I saw this article - [https://www.rexegg.com/regex-best-trick.html](https://www.rexegg.com/regex- best-trick.html)

example:

        $ # all words except those starting with 'c' or 'C'
        $ echo 'Car Bat cod12 Map foo_bar' | grep -ioP '\bc\w+(*SKIP)(*F)|\w+'
        Bat
        Map
        foo_bar

for more details: [https://www.rexegg.com/backtracking-control- verbs.html#skipf...](https://www.rexegg.com/backtracking-control- verbs.html#skipfail)

<comment><USER13> Which is a fancy way to say `grep -iv '^c'`. EDIT: Oh, I missed that the input was a single line.

I personally feel that control verbs are bad additions to the regexp, even though I do know that it is not a big addition to the regexp _engine_ itself (e.g. naturally extended from posesssive quantifiers like `a++` or atomic groups `(?>foo)`). Most uses of such verbs can be expressed with combined parsers and simpler regexps, in the much simpler and maintainable way.

<comment><USER7> sorry, it is not same as `grep -iv '^c'`

the `-o` option allows to output only matching portion, the regex is meant to extract all words other than those starting with 'c' or 'C'

here's hopefully better example

        $ # do something with words not surround by quotes
        $ echo 'I like "mango" and "guava"' | perl -pe 's/"[^"]+"(*SKIP)(*F)|\w+/\U$&/g'
        I LIKE "mango" AND "guava"

<comment><USER13> Oh, you are right. I missed that all words are in the same line. That said even the original article mentions that it only moves the captured group to the entire match; I am generally in a position to avoid all uses of control verbs, especially if it only costs one or probably two lines of the additional code that I can fully control and comprehend.

</comment></comment></comment></comment><comment><USER14> for those who find regex not very readable: [https://github.com/VerbalExpressions](https://github.com/VerbalExpressions) // Create an example of how to test for correctly formed URLs var tester = VerEx() .startOfLine() .then('http') .maybe('s') .then('://') .maybe('www.') .anythingBut(' ') .endOfLine();

<comment><USER8> [https://github.com/pygy/compose-regexp.js](https://github.com/pygy/compose- regexp.js) is another option (800 bytes mingzipped):

        const {sequence, suffix} = composeRegexp;
        const maybe = suffix("?");
        const oneOrMore = suffix("+");

        const urlMatcher = sequence(
          /^/,
          "http"
          maybe("s"),
          "://",
          maybe("www."),
          oneOrMore(/[^ ]/),
          /$/
        );

</comment></comment><comment><USER15> Plugging this website as I've found it very useful to learn simple regex with / get over my "oh God I don't know Regex": [https://regexone.com/](https://regexone.com/)

</comment><comment><USER16> Is there regular expression to match regular expression?

<comment><USER17> No. One way to convince yourself of this is that regexp capture groups must properly nest: /())(()/ is invalid for example. Regexps famously cannot match balanced parenthesis.

</comment></comment><comment><USER18> I used this article about a week ago to help me with a web scrape. Good stuff!

</comment><comment><USER19> That is truly bizarre... I went looking for info on lookaheads just today, and found myself on that very site, and now it's on HN. It's just that ol' HN magic I guess.

</comment><comment><USER20> You've got a problem you think regex can solve, now you've got 2 problems.

<comment><USER21> I wrote a list of json keys that should be taken from a message and :'<,'>s/\\(\S\\+\\)\s{0,}/t.\1 = message.\1;\r/g

Hey, did you commit already? Still typing?

<comment><USER22> It looks like your quote characters might be messed up there? Anyway, to parse json on the command line one should just use jq.

<comment><USER21> Single quotes were modified by HN engine, right. It is not a command line (thinking of sed?), it is the middle of a source code in my editor. I have a json-parsed message and t is a target object.

      a b foo c

      t.a = !!message.a;
      t.b = String(message.b);
      t.foo = message.foo;
      t.c = tonum(message.c);</comment></comment></comment></comment>


Ask HN: Who are the 4 guys in Y Combinator home page?  - <AUTHOR> http://ycombinator.com/ First slide. <comment><USER2> Pretty sure the one on the left is Patrick Collison, founder of Stripe. Not sure about the others, though</comment>


Apple Unveils ARKit 2.0, Putting Multiuser AR at Its Core - <AUTHOR> https://www.roadtovr.com/report-apple-unveil-arkit-2-0-putting-privacy-multiuser-ar-core/ <comment><USER2> So, as a non-Apple user... anyone found a killer AR app yet on their iPhone? Something that's not a gimmick you try once?

<comment><USER3> I have two young kids. I find these demos awful, and Lego's AR-spiel abhorrent.

Looks like 2-4 kids will use AR on a combined $1-4k iPads in order to "play" around an actual $30 Lego house. Let's envision additional killer applications: the AR yoyo, AR stuffies that snuggle with and talk to you in bed, AR food ingredients to pretend to cook a meal, AR face paint, AR lemonade stand... reality is so boring. [added] AR bath toys.

<comment><USER4> AR is also really good for squishing bugs!

[https://vimeo.com/149319403](https://vimeo.com/149319403)

</comment></comment></comment><comment><USER5> Honestly, little of this makes sense as long as you still have to hold a device up with your hands. But I guess it's a good way to iterate on AR software until they can release a set of glasses.

<comment><USER6> I agree that glasses are the ultimate direction that mobile devices and AR are heading towards, but I don't think holding a device up in the air is the worst interaction (compared to something strapped to your face with VR, even a helmet might be better?)

I think holding a device in the air and shining it around has a natural feel similar to a magnifying glass or a flashlight. More intuitive and not as intrusive. That's just my opinion though.

</comment></comment><comment><USER7> I think this is exciting. Something like AR can only succeed as a medium of social interaction. What is "something?" A toy in the general sense. Successful sports games are mediums of social interaction. Successful video games are mediums of social interaction. Even solitary pursuits like single player games and yo-yos have a social aspect. (Hey, can _you_ do this?)

Who is going to become the YouTube of AR/VR?

<comment><USER8> > Who is going to become the YouTube of AR/VR?

Hopefully nobody. Whatever infrastructure layer there will be powering AR, I hope it would be like using the Internet than an App Store.

If you look at current HMD manufacturers, everyone is constraining the operating system for a chance of becoming the AR App Store. If these companies really want AR to be adopted so bad, maybe lower the barrier to developing software for this medium? In that regard, yes, Apple is on the right track, but I do not think we will see any 'killer apps' on an iPhone. HMDs just have so much more potential.

<comment><USER7> _Whatever infrastructure layer there will be powering AR, I hope it would be like using the Internet than an App Store._

Unfortunately, given the high hardware requirements, a closed ecosystem seems more likely for mainstream AR.

<comment><USER8> > Unfortunately, given the high hardware requirements

Maybe I am missing something obvious here, but why is that a reason for a closed ecosystem?

<comment><USER7> I think a higher price puts the vendor/manufacturer in the mind that the user has sunk so much into the product, that they are pretty much ensnared.

</comment></comment></comment></comment></comment><comment><USER9> The only AR app that makes sense on a phone is navigation. Games don't. Without glasses, pretty much everything else is too tedious: super small viewport, muscle fatigue from holding the viewpoint.</comment>


4.4 Million Years Old, 15 Years of Work, 11 Science Papers, 1 Fossil - <AUTHOR> http://www.sciencemag.org/ardipithecus/

<comment><AUTHOR> Having 11 papers at once in Science is almost unheard of (especially when they're all by the same group of authors!). It's reserved for Human Genome Project level efforts.

So what's the big deal?

A prof at Berkeley (Tim White) and his team discovered a fossil (Ardipithecus) more than 15 years ago. It's a rare partial skeleton which sheds light on a branch of primate evolution (the human/chimp common ancestor) that we haven't had much direct physical evidence about. Seems they have opposable big toes among other interesting features.

Over the last 15 years, White & co. only allowed their collaborators to look at it, and others in the field have gotten annoyed and accused him of hoarding the find. See a representative dustup from a few months back:

[http://anthropology.net/2009/08/25/science-suffers-from- the-...](http://anthropology.net/2009/08/25/science-suffers-from-the-idiots- at-scientific-american/)

Fast forward to a few days ago. Science publishes this monster issue dedicated to the find. It sets the whole paleoanthropology world atwitter.

<http://www.sciencemag.org/ardipithecus/>

Here's some further commentary:

[http://johnhawks.net/weblog/fossils/ardipithecus/ardipithecu...](http://johnhawks.net/weblog/fossils/ardipithecus/ardipithecus- faq-2009.html)

And now you're up to date, at least on the "inside science" aspects of this.</comment>


Norwegian Air cancels order for 97 Boeing aircraft, sues Boeing - <AUTHOR> https://airlinegeeks.com/2020/06/30/norwegian-air-cancels-order-for-97-boeing-aircraft-sues-boeing/ <comment><USER3> BOC Aviation, controlled by the Chinese state, is now a majority owner of Norwegian, BOC have previously canceled 737 Max orders.

[https://www.thelocal.no/20200520/china-become-norwegians- big...](https://www.thelocal.no/20200520/china-become-norwegians-biggest- owner-after-debt-swap)

<comment><USER4> Interesting. Anyone have any idea if this will lead to a Comac C919 order? [0] Just remembered, this would have to pass the EASA certification at a minimum, if that happens or they start pushing for it it might be an indicator. Belt and Road no doubt, and quite possibly seeking to capitalise on the duopoly having a hard time. May lead to EU / US shoring up their respective industries. Maybe also burying their WTO hatchets?

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

[EDIT] asked further questions

<comment><USER5> Zero reason for a Comac order when there's tons of used A320s and 737s sitting around up for sale or lease.

</comment></comment></comment><comment> blinding-streak The entire airline industry (and travel as a whole) is under incredible stress right now. Many airlines have already gone bankrupt [1], and most others are near the brink. I don't think there's going to be any shortage of lawsuits going forward.

[1] [https://www.businessinsider.com/coronavirus-airlines-that- fa...](https://www.businessinsider.com/coronavirus-airlines-that-failed- bankrupt-covid19-pandemic-2020-3)

<comment><USER6> Most of the US airlines took the COVID bailout bill money. That bill required them to maintain specific service, and avoid layoffs through the end of September. Expect some chaotic changes in October.

<comment><USER7> Do you think the US gov won't renew those?

<comment><USER6> I suspect several of the airlines are now itching to do layoffs. It's hard to sustain the same number of employees when the traveler numbers are down so badly. They are all losing money despite the bailout.

<comment><USER7> True. I think this comes down to: will the US gov just continually print money while there is a slowdown from both top down lockdown and also people just trying to stay safe.

</comment></comment></comment></comment></comment><comment><USER8> I wonder who is going to have the guts to kill the 737 Max for good. It's never going to fly with airline and passengers ever again,

<comment><USER9> Or just rebrand it.

I'm sort of amazed they haven't done that already...

<comment><USER10> I don't know about you, but I never want to fly on a 737 MAX no matter what they rename it. Every time I have booked a ticket online the website tells me what kind of aircraft I would be flying on.

<comment><USER11> As nice as this info is, is there any actual guarantee that it is valid? I wouldn't be surprised if airlines switch planes around all the time, so by the time you check in you may be flying a MAX plane (and possibly not even be aware).

<comment><USER12> This is anecdotal, but I've never once out of hundreds of flights experienced what you're describing. Sure, replacement flights when things got cancelled may have been on a different aircraft, but then it's a different flight altogether so not particularly surprising. I'd be curious to know if under normal circumstances they ever fly a plane other than the one listed, I have no idea.

Edit: to clarify a bit, I know this because I'm a nerd and sometimes pick flights specifically because of the type of plane used. I quite enjoyed the A380. :o)

<comment><USER13> It doesn't happen on something like an A380 (especially since there isn't exactly any other plane type to switch to from an A380 without huge issues), but it's pretty common on smaller jets, especially in the A320 family or 737 family where they are nearly-identically-sized jets that can be swapped out easily.

If you're scheduled to fly on a 737-800 but there's a problem with the jet, they might swap it out for a 737-400 (which is pretty much just an older generation of the -800, similar to how the -800 is an older generation of the MAX 8) and it would go completely unnoticed by almost every passenger. That happens less often nowadays that most (all?) of the -400s are retired, but I would expect it to start happening again once the MAXs return to service and they are being deployed side-by-side with the NGs.

<comment><USER14> Yep. I've booked several flights originally scheduled to be operated by a 737-300 or a 737-400 and had it swapped out for the other on the day (as the airline operated a mixed fleet with both types regularly swapped around to better match demand and/or respond to maintenance issues). Also had a 757 swapped out for a 320 a few weeks prior to the flight. Or a 777-300 swapped out for a 777-200 several days before the flight. Even a 787 was swapped out for a 330. I suspect some of the changes are demand driven e.g. swapping to a smaller or bigger aircraft. I have observed this cross multiple airlines: Qantas, Air NZ, British Airways, China Southernm etc. Quite common especially for mixed fleet airlines.

</comment></comment></comment></comment></comment></comment></comment><comment><USER15> Boeing has terrible management and deserves to go under for the 737 Max fiasco but...

...it seems like maybe Norwegian Air is reeling from coronavirus-induced low demand and is trying to escape its responsibilities.

<comment><USER16> > Boeing has terrible management and deserves to go under for the 737 Max > fiasco

This seems a bit like throwing the baby out with the bathwater. Boeing employees _145,000_ people. You're advocating making the equivalent of a small city jobless based on the actions of a very small contingent.

Additionally, aerospace is a capital intensive business. To give up Boeing would mean the likely-permanent loss of sophisticated manufacturing capabilities in the United States.

Nobody is starting a new aircraft manufacturer on AWS using Javascript. It would take tens of billions of dollars to even begin to attempt to re-create a company with Boeing's capabilities.

<comment><USER17> > You're advocating making the equivalent of a small city jobless based on the > actions of a very small contingent.

No one has ever advocated that every person at Boeing be fired and that's not what happens in large corporate bankruptcies. So no, that's not what the other poster was advocating.

In general, I've seen people advocating that Boeing's shareholders be wiped out, senior management fired and the company be rebooted with a thorough dedication towards "safety first" as opposed to "short-term profits first".

<comment><USER18> Aren't most "shareholders" actually index funds or pensions at this point? The effects of wiping out such a large chunk of stock all at once would be felt pretty widely.

<comment><USER19> They shouldn't have invested in a badly managed company then.

As long as investors don't feel their moral Hazzard, companies will keep doing the same things. Because investors will keep investing in them because they'll get bailed out at the end.

Why wouldn't you invest in boeing if you know they are going to prioritize short term profits (good for you) and as soon as that comes back to bite the company it's going to be bailed out.

And if you keep bailing them out, it's in the companies best interest to prioritize short term profits over long term consequences, because that's what's best for investors.

Government bailouts pervert the market in extreme ways (you are essentially subsidizing risk), and it's the very reason why too big to fail companies keep doing the stuff they do.

The point of the "market" is leaving the pricing to investors, if they fail to price the company correctly then it's their loss, just like it's their win when the stock goes up.

The best option for too big to fail businesses failing is to buy 100% of it's shares when it declares bankruptcy (at close to $0), fire all top level management and the board, inject the cash needed and fix the companies culture to a prdoduct focused instead of finance focused (that's why the people rescued it), then IPO once it's numbers are in the green (or give one share to every tax paying resident)

</comment></comment></comment></comment></comment><comment><USER20> Reading between the lines of hype, this is the most important fact in the article:

> [Norwegian Air] delayed general shareholders meeting on Tuesday and on the > same day Boeing started re-certification tests for MAX aircraft

</comment><comment><USER21> There was recent news(April/March) about Norwegian actually running extremely low on cash to a point of bankruptcy and the airline laid off like 90% of their workforce due to Covid19 pandemic and lack of flights/demand.

<comment><USER22> I really hope this doesn't happen - Norwegian is the best low cost long haul airline out there. Round trip AUS-LGW tickets can be found for sub $500 on Norwegian. The premium is also very competitive for the same flight ($800-1200) when competitors doing similar route (BA) charge more than double that, and the service certainly isn't doubled. They are also flying very new planes and as such are a much nicer experience. There are always plugs under the seats, IFE is modern and available on every seat. Also the way they handle seat service is much more convenient, you order and pay through the IFE console instead of having to wait for the cart to come around and as such you have complete service all the way though the flight.

Even on domestic flights in Europe they are a pretty reasonable experience, much better than Ryanair and Easyjet at least. They are often priced about 10-20% more expensive than Ryanair and Easyjet when you probably get double the comfort and service and half the annoyances. I might sound like a shill for Norwegian but I think they really fill the Southwest niche here - <USER2> decently low cost (but not lowest) airline that doesn't treat you or it's employees like shit.

That's not to say they are without flaws either. I and others have had some sketchy times where Norwegian has fought awarding the EU mandated reimbursement for delayed/cancelled flights. But no other international airline in Europe straddles the line between legacy carrier level of service and barebones low-cost as well as Norwegian.

<comment><USER23> The article talks about the airline focusing on shorter routes and cutting the longer routes that they were losing money on. Even if the airline doesn't go through bankruptcy the long haul routes at the same price will probably no longer be around.

"However, with the scheduled flights gradually resuming, the airline is restructuring its fleet and focusing on short- and medium-range destinations. Europe's fourth-largest low-cost carrier will likely completely discontinue the long-haul flights that sank the company into debt."

<comment><USER24> it's too bad really, the long-haul price competition they created on their routes was fantastic

</comment></comment></comment></comment><comment><USER25> Aerospace is taking a massive hit, in the UK we've seen redundancies and are seeing more today.

</comment><comment><USER26> Imagine getting to break your contract and then sue to try to get your initial deposit back. Isn't that the whole point of a deposit?

<comment><USER27> Not necessarily. A refundable deposit is not unheard of. It's a good way to verify that your customer's are truly interested and at least partially capable of paying for the final product.

For example, Tesla's deposit is refundable: [https://www.tesla.com/support/model-3-reservation- deposit](https://www.tesla.com/support/model-3-reservation-deposit)

<comment> blinding-streak Except that in practice, getting your refund back is not easy at all. Tesla marketing and Tesla reality are often far apart.

[https://www.cnbc.com/2019/02/21/tesla-refund-and-return- prob...](https://www.cnbc.com/2019/02/21/tesla-refund-and-return-problems- detailed.html)

[https://www.bloomberg.com/news/articles/2019-02-20/tesla- wou...](https://www.bloomberg.com/news/articles/2019-02-20/tesla-would-be- customers-grouse-as-deposit-refunds-take-months)

[https://forums.tesla.com/forum/forums/deposit- refund-3](https://forums.tesla.com/forum/forums/deposit-refund-3)

<comment><USER28> Tesla has gotten better. A friend had their Solar Roof deposit returned within a week after Tesla cancelled their order.

Will it be just as easy if Cybertruck doesn't live up to the hype? I'll report back.

<comment> blinding-streak That is indeed a good sign, and might have a positive effect on people's willingness to make a deposit in the first place.

<comment><USER28> Agreed. Deposits signal intent to both Tesla and the capital markets they rely on, but you have to treat the customer relationship with respect to not poison the well.</comment></comment></comment></comment></comment></comment>


Chlorine: Dead Simple GPGPU - <AUTHOR> https://github.com/Polytonic/Chlorine <comment><USER2> I haven't used OpenCL before. This library seemed sort of reasonable but I had some questions about whether it was really that much better than the native OpenCL API. So I found an OpenCL "hello world" program here: [http://developer.amd.com/tools-and-sdks/opencl- zone/opencl-r...](http://developer.amd.com/tools-and-sdks/opencl-zone/opencl- resources/introductory-tutorial-to-opencl/)

Holy crap. The "kernel" code is basically the same, but the native API setup code (which that tutorial even calls "boiler plate") is insane, starting with the fact that the source code for the CL on-device program has to be passed as a string. There is no API to pass a filename--only a string containing the entire program source!

<comment><USER3> On the other hand, if you don't mind using other languages for the host code, there are a number of libraries in Java, Python, etc. that make it much simpler and more feature-complete than this library.

Major problem with many of those libraries, including this one, is that, while they help you with hello world, they cripple the real-world functionality. All this low-level stuff that is there in the standard usually has its use. Of course it could and should be simpler, but most of those wrapper libraries guess too much and make many optimizations inaccessible or very hard to achieve.

The library that I wrote for Clojure (and Java), ClojureCL ([http://clojurecl.uncomplicate.org](http://clojurecl.uncomplicate.org)) even supports OpenCL 2.0 (which is usually not supported in other libraries), while still allowing you all sorts of low-level performance optimizations accessible in the native C API, and is (in my opinion) rather simple to use compared to other libraries, and requires little boilerplate.

<comment><AUTHOR> >On the other hand, if you don't mind using other languages for the host code, there are a number of libraries in Java, Python, etc. that make it much simpler and more feature-complete than this library.

What features would you consider to be missing?

>Major problem with many of those libraries, including this one, is that, while they help you with hello world, they cripple the real-world functionality. All this low-level stuff that is there in the standard usually has its use. Of course it could and should be simpler, but most of those wrapper libraries guess too much and make many optimizations inaccessible or very hard to achieve.

Of course, though I wouldn't say cripple. With abstraction comes an associated performance cost. Chlorine is intended to reduce the barrier to entry. It's one of those "do things that don't scale" ideas. It hides some of the boilerplate from you, and is meant to help you quickly validate your ideas. If you need more fine-grained control over memory allocation, execution order, etc., you can always turn to the C/C++ API for performance, and it shouldn't be too difficult to port.

>The library that I wrote for Clojure (and Java), ClojureCL ([http://clojurecl.uncomplicate.org](http://clojurecl.uncomplicate.org)) even supports OpenCL 2.0 (which is usually not supported in other libraries), while still allowing you all sorts of low-level performance optimizations accessible in the native C API, and is (in my opinion) rather simple to use compared to other libraries, and requires little boilerplate.

My goal is to make GPU programming more accessible, so it's always good to see competition! Anyway, Chlorine is OpenCL 1.1/1.2 only, mainly because OSX is not OpenCL 2.0 compatible (knowing Apple, it may never be).

</comment></comment></comment><comment><USER4> This looks really interesting and extremely useful for a program of mine. Has anyone tried this in OS X?

<comment><AUTHOR> My primary platform is OSX, and Chlorine was written to target OSX first. It is arguably the easiest to get started under OSX.

</comment></comment><comment><USER5> "Header only" but needs CMake?

<comment><USER6> You need CMake to run the in-tree examples and tests. That doesn't mean you need CMake to use the library, which is in fact header-only.</comment></comment>


Warren Ellis: Here we are at the beginning of a conference about things - <AUTHOR> http://warrenellis.tumblr.com/post/152435913296/warren-ellis-at-thingscon <comment><AUTHOR> (2015)</comment>


Writing a Lisp: Continuations - <AUTHOR> http://reinvanderwoerd.nl/blog/2017/05/16/writing-a-lisp-continuations <comment><USER2> Continuations are strangely underused, as they enables writing long-living processes in a simple way, without having to keep them in running in a thread, or even in memory.

Then a real programming language can replace all "business processing" crap languages. Let's say you write a framework that escapes to a continuation whenever the "process" is waiting for Futures or Promises to complete, and returns the thread to a pool.

Depending on what you are waiting for, such as webhooks, asynch events/messages, or with some work even outstanding network requests ( if it's meaningful ), it would be possible to serialize the continuation to storage, potentially restore it on another machine, weeks later.

With some bookkeeping, it would be possible to also store what Futures have been completed, and what the continuation is currently waiting for, so it would be possible to keep track of the progress of the long running process, and use that information to show a nice status report.

<comment><USER3> I have implemented interpreters that support both full and delimited continuations. They are underused for many very good reasons. A continuation makes an implicit state machine. Implicit means anonymous, which means harder to talk about, which means harder to reason about. But there are technical problems too.

Continuation based sessions, as used in fringe web frameworks such as Seaside or even Arc's library that powers Hacker News, is a really problematic approach. Reifying a slice of call stack in to a continuation and serializing it introduces all sorts of problems for resource management and the user experience, especially in the presence of change.

For example, let's say you deploy a new version of your code: What happens to all the in-progress sessions? Do you let old code keep running? Do you force users to start over? Compare to "Edit and Continue" in a Java/C#/Smalltalk codebase where you can change a method and all instances get the new behavior, vs if you change a function that constructs another function: All the old closures stick around with the old code.

Let's say a user leaves a browser tab open for a while: How long do you wait before invalidating the session and free its resources? What impact does that have on the user experience? Hacker News has mostly eliminated its reliance on continuations to remedy these sorts of problems.

Speaking of resources: What resources does a continuation hold on to? If you serialize a continuation, do you keep all file handles open? Do you perform static analysis to know a priori what data should be garbage collected or excluded from the continuation as "semantic garbage"? This problem is double bad when laziness is involved. Consider paginating through a database cursor.

What happens when a continuation must be forked? Consider using a continuation-id to resume an interaction with a web app: Does opening a new tab duplicate any held resources by the continuation? Do your external resources even support cloning operations or are they thread safe? Compare to unix "fork" and file handles vs shared memory.

<comment><USER4> > For example, let's say you deploy a new version of your code: What happens > to all the in-progress sessions?

This is a problem inherent to long-running processes, no matter the implementation. We had the same problem in our business process engine using jbpm (implemented as an interpreter serializing state to database every step).

Ultimately you have to decide if you bind functions/subroutines/subprocesses/whatever you call them early (so when you call them later and there's a new version - they still use old version), or late - so they are always calling the newest version. And you have to adjust your coding assumptions and the way you update your software to new version basing on that decision.

Neither way is always the correct one.

<comment><USER5> Came to say the exact same thing, all the problems mentioned aren't unique to continuations. I'm not saying this makes a positive argument to use coroutines everywhere, but it's not their fault.

As ajuc mentioned, long-running processes and early/late bound is always a thing. Same with database migrations. Heck, even clients accessing a versioned api (foo.com/api/v1/bar) vs not has the same consideration.

> How long do you wait before invalidating the session and free its resources?

Same decision has to be made for explicit session data like login state and pagination cursors in eg. Facebook's graph API. Continuations are larger and therefore this question may have more weight.

> What resources does a continuation hold on to?

Anything reachable (static and/or dynamic analysis). And if you run your program in a monad (or other restricted, pure manner), then you can control when a function can suspend, like not in the middle of paging a database.

> Does opening a new tab duplicate any held resources by the continuation?

If you live in an immutable world, you get duplication for free with structural sharing. Same goes for an OS loading a shared library once and giving the same pages to multiple programs.

I do agree that having a blob of stuff serialized isn't very nice. Same goes for closures as well. The example I always compare in my head is a functional representation of a set vs. any other data structure.

I toyed around with an interpreter that would let you reflect a closure (same could be applied to continuations) to a program, which is akin to a residual program in partial evaluation. Then you could do whatever you want with the source of the closure/continuation. For the early/late bound question above, you could analyze the reflected continuation and decide exactly which bits you want to rebind before continuing the continuation.

</comment></comment></comment></comment><comment><USER6> I remember trying to learn continuations during my CS degree, and evidently even today I still don't understand them. The examples don't seem to help either – how exactly does the control flow function?

<comment><USER7> You know how in Python the "yield" statement is actually an expression and can be sent values using "next"? Imagine there is a special "yield" called "call- with-current-continuation" that can be used anywhere (not just in generators) which bundles everything up and makes a generator-like thing called a "continuation." This continuation object can be called later on, like using "next" in Python. Unlike generators, though, continuations can usually be resumed repeatedly, always resuming at the same point where the call-with- current-continuation expression was.

A weird thing is that call-with-current-continuation doesn't yield _back_ to something; it yields to the function given to call-with-current-continuation.

<comment><USER8> Would that be like having a yield statement AND passing a context (e.g. binding a this that represents "current-continuation")?

<comment><USER7> Here are two examples in Python syntax, assuming "yield" is no longer a keyword.

      def f():
        def receiver(yield):
          yield(2)
          # yield jumps out of the 'receiver' function and never returns
          print("This never prints")

        x = callcc(receiver)
        return x+1

      print(f())
      # f returns 2+1

      # backtracks stores (continuation,[values]) pairs.  Whenever a computation fails, we pull out another
      # value from the list and feed it to the continuation.  The idea is to perform a depth-first search.
      backtracks = []
      def fail():
        """Aborts the current continuation and backtracks to another alternative stored in backtracks."""
        if not backtracks: raise Exception('amb ran out of alternatives')
        yield, alternatives = backtracks.pop()
        alt = alternatives.pop()
        if alternatives: # this continuation still has alternatives, so put them back on the list in case of a future 'fail'
          backtracks.push((yield, alternatives))
        yield(alt)
      def amb(*alternatives):
        """The "ambivalent operator."  The arguments to amb are alternatives, and the return value of amb
        is an alternative which makes the future computation not fail."""

        if not alternatives: fail()
        def receiver(yield):
          backtracks.append((yield, alternatives))
          fail()
        return callcc(receiver)
      def expect(b):
        if not b: fail()

      def test_amb():
        """Let's find a Pythagorean triple."""
        x = amb(*range(1,100))
        y = amb(*range(1,100))
        z = amb(*range(1,100))
        expect(x**2 + y**2 == z**2)
        return (x,y,z)

      # We can print out all the Pythagorean triples.
      trip = test_amb()
      print("(x,y,z)=(%s,%s,%s)" % trip)
      fail() # fail every time so it keeps backtracking, but the side effect of printing out remains

</comment></comment></comment></comment><comment><USER9> My favorite part of this blog post is the Fira Code webfont

</comment><comment><USER10> Are there any continuation implementations in Common Lisp?

<comment><USER11> Yes, cl-cont by our very own Slava "coffeemug" Akhmechet. Unfortunately, a recent site rebuild at common-lisp.net seems to have left the project page blank; nor do I see a cl-cont repo on Slava's Github page. It's Quicklisp- installable, though.

</comment></comment><comment><USER12> Do any non-Lisp/Scheme languages have continuations?

<comment><USER13> Here's the obligatory "Haskell has a monad for that" comment

[http://hackage.haskell.org/package/mtl-2.2.1/docs/Control- Mo...](http://hackage.haskell.org/package/mtl-2.2.1/docs/Control-Monad- Cont.html)

<comment><USER14> That kind of feels like cheating though. I mean, the complicated part of a continuation is that it restores the same context and state that the app had right before the plunge. But Haskell inherently doesn't have "floating" state, it's all self-contained within each parameter. So in Haskell it's more or less a fancy goto-statement.

<comment><USER15> The linked module defines a "monad transformer" that can wrap other monads with a continuation-capturing layer. This means, among other things (Haskell's solution is awesomely general) that you can indeed use it with state, if you compose it with the state monad, or even the IO monad.

(The bottom of the documentation page has a contrived example of this.)</comment></comment></comment></comment>