Neiman Marcus files for bankruptcy - <AUTHOR> https://www.reuters.com/article/us-neimanmarcus-bankruptcy/luxury-department-store-chain-neiman-marcus-files-for-bankruptcy-idUSKBN22J2AJ <comment><USER2> One of Frederick Wiseman's wonderful documentaries is "The Store", which is about Neiman Marcus sometime in the 80's. Currently streaming on Kanopy.

One sequence showed the CEO giving a pep talk to his buyers, whose relationship with their suppliers was always strained at best. He told a joke about a buyer who called his supplier that went something like:

Buyer: "Hello, is Fred Jones there?"

Receptionist: "I'm sorry, Mr. Jones passed away last month"

Buyer: "Oh, sorry to hear that, goodbye."

Ten minutes later:

Buyer: "Hello, is Fred Jones there?"

Receptionist: "I told you, he died last month"

Buyer: "Oh, oh, yes. Goodbye."

Ten minutes later:

Buyer: "Hello, is Fred Jones there?"

Receptionist: "He's dead, why do you keep calling here?"

Buyer: "I just like hearing you say it"

<comment><USER3> That is so spot on. I've occasionally played the role of solutions engineer/sales engineer/whatever as part of two different companies selling consumer electronics products to big box stores and that is 100% right.

The supplier/buyer relationships are very "frenemy" even in the best of times.

<comment><USER4> > The supplier/buyer relationships are very "frenemy" even in the best of > times.

Why?

</comment></comment></comment><comment><USER5> Everyone talks about the "Amazon effect" but the changing distribution of income is also worth considering:

" _Retail is suffering because the middle classes have lost $1,355 trillion in income since 1970_ "

[http://www.smashcompany.com/business/retail-is-suffering- bec...](http://www.smashcompany.com/business/retail-is-suffering-because-the- middle-classes-have-lost-1-355-trillion-in-income-since-1970?source=Snapzu)

<comment><USER6> That is quite the abuse of statistics! US GDP (edit: inflation-adjusted) was $5 trillion in 1970, and $19 trillion in 2019. The income percentage of the middle three quintiles went down from 53% to 45%, but 45% of $19 trillion is still much, much more than 53% of $5 trillion. Income for this group did not shrink, it just grew more slowly than other groups. The income was "lost" relative to a hypothetical world in which the economy was the same size as in 2019 but the middle quintiles had a larger income fraction, not the actual world in 1970 or any other past year.

<comment><USER7> Speaking of abuse of statistics, lumping the bottom 20-40% with the top 60-80% of wage earners is extremely deceptive. It's well known that income growth is wildly different for those groups. Inflation adjusted wages for the median worker only increased by 9% from 1973 to 2014.

<comment><USER8> True. But how much did the productive output of the average American increase? Can we really expect things to "always increase" \-- including wages? To me this seems like an absurd idea.

The end goal should be improving the median quality of life, through improving the efficiency of factors of production -- lower cost of goods... not through the expectation that the wages should arbitrarily grow linearly with GDP.

<comment><USER9> > But how much did the productive output of the average American increase?

Around one hundred percent. [https://data.oecd.org/lprdty/gdp-per-hour- worked.htm](https://data.oecd.org/lprdty/gdp-per-hour-worked.htm)

<comment><USER10> They probably meant median productive output. Sam Walton and Bezos made their supply chains 100% more efficient. It's not as if warehouse workers suddenly were able to lift 100% more weight.

<comment><USER11> Standardized pallets and forklifts can make them lift a hell of a lot more weight

<comment><USER10> The people who load pallets are moving just as many boxes as they used to. Sure they play a part in the productivity, but I don't see how it's unfair if they make the same amount for the same work.

<comment><USER11> Where do crane operators stand in this? Where does the productivity come from?

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER12> First guess: private equity?

 _Neiman Marcus, laden with debt after a private equity takeover,_

Yup.

<comment><USER13> Wow, why don't people wise up to this PE trick? Seems like creditors would learn their lesson after so many examples...

<comment><USER14> Please explain? Why is there the association that private equity creates corporate debt?

<comment><USER15> Private equity companies exist to purchase existing companies from their current owners and then run them better/extract more value from them. The canonical example of this is purchasing a public company by acquiring all outstanding shares.

This is often a fantastically expensive enterprise that requires that the new owners raise tons of money. The new owners do this by structuring a deal where the company will take out a ton of debt (basically its entire market capitalization of the company, plus a premium) to purchase the outstanding shares. This is known as a leveraged buyout (LBO).

So if a public company has $100M in outstanding shares and zero debt before they go private, by going private the private company will now have $100M of debt (rough numbers, illustrative but not necessarily realistic). That's why going private often results in dramatic sell offs and cost cutting- the new company needs to get the debt load down, and fast.

Definitely read Barbarians at the Gates, it's a great book and explains a lot about private equity from a dramatic case in the 80s.

<comment><USER14> Thanks for that. But why is the company now worse off than before? A company can be funded with equity or debt (different terms and obligations, I understand) but if a company converts 100% of its outstanding shares to debt, why does anything change? I assume this is what happens when a company takes itself private to escape the grind of quarterly earning, short-term growth, tyranny of Wall Street analysts, etc. If I could run a company better/extract more value from it, say, by decreasing expense, increasing revenue, and therefore profits, I'd write myself a big check quarterly and continue running the company. Something else extractive and zero-sum (I gain but the company loses) is going on and I don't know what that is.

<comment><USER15> Becuase the risk of investment is now structured differently with leverage. Let's pretend we live in world where companies are always worth 10x earnings + assets. Our pretend company $100M makes $5M in earnings and has $50M in assets (cash, real estate, etc..)

To take the company private, the lenders require an interest of 10% and 10% principal

Some PE company (or the CEO, whatever) thinks they can make this work, so they come up with $10M of principal, take the lenders money and buy the company. The first thing they do is sell as many of those underlying assets as they can to pay down the debt. You now have a company that has $5M a year in earnings before debt, $10M in assets (the principal, serviving as the required reserve for the lenders), and $50M in debt, with a debt service of ~$5M a year (so really 0 earnings).

If the the PE company does a great job managign the company and the economy is good, so they double earnings to $10M, then the company is now worth $50M ($10M in income x 10 + assets - debt) and the PE company made a 5x return already (FYI- I know I'm abusing my financial math, fake numbers, but its illustrative).

Now lets assume they were wrong and a global pandemic breaks out, and the companies start losign money to the tune of $1M a year. If the company had stayed publicly owned, they might have to cut their dividend and burn through reserves, maybe sell off some assets, but other than that all their employees and the majority of their assets are probably fine. The company's market cap is a lot less, but shareholders don't go to zero eithier.

The world where the company went private in an LBO? That $10M cushion runs out in less than 2 years. They are bankrupt. They might get a few more chances to restructure debt and such, but eventually the lenders give up and liquidate the company a la Toys R Us. The employees get fired and local landlords lose tenants. Pension funds disappear. It's not fun.

<comment><USER16> This was helpful to me. How does the PE company fare in the bankruptcy scenario? Have they put up collateral or are somehow on the hook to the lenders?

It's my understanding that the bankruptcy applies only to the purchased subsidiary, so the PE firm only stands to lose the principal they put in at the start.

If so, it sounds like the PE firm gets all the upside, but is less exposed to the downside. So they are incentivized to rachet up the risk.

<comment><USER17> > This was helpful to me. How does the PE company fare in the bankruptcy > scenario? Have they put up collateral or are somehow on the hook to the > lenders?

All deals are different. You're probably not going to have any collateral put up by the actual PE firm in most cases.

> It's my understanding that the bankruptcy applies only to the purchased > subsidiary, so the PE firm only stands to lose the principal they put in at > the start.

In most cases this is true. Depending on how aggressive the firm has been and how long they've been involved, they might have already dividended out their principal.

> If so, it sounds like the PE firm gets all the upside, but is less exposed > to the downside. So they are incentivized to rachet up the risk.

This is a correct but simplified conclusion. They're incentivized but there's usually a set of checks and balances in the form of banks providing financing and investors willing to finance deals. This system of checks and balances typically erodes as the business cycle/bull market rides on.

The binding constraint in most of these deals is how much leverage you're able to get away with.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER18> I think even without Covid, its harder to tell what is luxury in apparel. There have been a couple articles on this.

There used to be a clear difference between the look of clothes at different retailers but not as much anymore.

Walk through Neiman Marcus, Nordstrom, Macy's, H&M, and they start to blend together.

Doesnt mean no difference but maybe not enough to always charge a premium.

<comment><USER19> They all seem to have decided on a "market expansion at the expense of brand dilution" strategy. Ditto most of the formerly-consistently-good clothing brands. I'm not really sure which stores/brands replace the ones that have done this, these days.

[EDIT] I _suspect_ part of this is because the cost of actually-good clothes hasn't dropped like shitty-clothes costs have, because (this is further speculation on my part) a good bit of the "savings" from internationalization, by the time it reaches consumers, is actually making many categories of goods worse and eliminating mid-tier stuff (formerly bottom-tier) outright so the gulf between lower-end luxury (paying for quality, not name) and plain ol' low-end has grown, putting pressure on luxury brands to cut prices... but they can't with their current products, because internationalization hasn't actually dropped the price of producing _decent_ goods by very much, so instead they cut quality.

<comment><USER20> You'd be surprised. The cost of rubbish clothing has fallen, but then the cost of very reasonable mid-quality has dramatically fallen. I used to buy Levis, then Gap for mid range. Now, I get the same quality (and literally the same factory) jeans from Joe Fresh, for 1/4th to 1/5th of the price.

Suit shirts are the same. An online tailor I've been using for a decade sells shirts at half the price of Banana Republic (comparing to Canada), but mine are bespoke, perfectly fitted, and I can make choices from a website. To wit, I've stopped buying shirts in stores and now just use their service... since 2008. To make matters worse for retailers, his quality has improved at the price point.

Retail is hard.

<comment><USER21> As someone who knows very little about the fashion business--though I have had tailored clothing made--I'm a little surprised that more of a market for bespoke online ordering hasn't developed. Sure, you'll "never" get to the level of an in-person tailor with multiple fittings. But one would think that there would be a fair number of people willing to pay something of a premium for at least roughly customized clothing. I know that exists for shirts but, as I recall from when I used to buy more business casual, it was still a very big premium over buying stuff that fit me reasonably from Lands' End.

<comment><USER20> Online tailors have solved that by partnering/paying for local alterations. They come into town X times per year (4-5?) for those who want the ongoing bespoke relationship. Then, when your clothes arrive, you can take them to a tailor to have them altered if necessary - paid for by the tailor, and your details updated, paid for by the tailor.

</comment></comment></comment></comment></comment><comment><USER22> "It's Collapsing Violently": Coronavirus Is Creating a Fast Fashion Nightmare

[https://www.gq.com/story/coronavirus-fast-fashion-dana- thoma...](https://www.gq.com/story/coronavirus-fast-fashion-dana-thomas)

<comment><USER14> The idea of "fast fashion" is noxious! All those faddish things worn for a season then to take up space in landfills. I don't think I've found affordable clothes made to last anymore (a good quality wool sweater, maybe?) I can't remember when was the last time I was at the mall, or what was the last thing I _really_ _really_ like to buy to wear.

<comment><USER23> Indeed, fast fashion is one of the most wasteful and polluting industries. It's weird how it gets a pass on that.

As for clothing and shoes that last, Patagonia is pretty good.

</comment></comment></comment><comment><USER24> I'm not glad these stores are doing bad, but I just never understood how a pair of sneakers can cost $700 - $900 when I can buy a decent laptop with that kind of money.

<comment><USER19> Conspicuous consumption. The price is the point. It's a signaling thing. In the case of something like sneakers with a big brand logo on them, it's likely someone "low" trying to signal to their peers that they've made it (whether they have or not). See: Fussell's _Class_ , or _The Official Preppy Handbook_ for signaling rules specific to the upper-middle and upper classes (very expensive sneakers with swooshes: big no. Somewhat expensive tennis shoes with wear patterns from serving: yes)

<comment><USER24> Haha I will try to find a copy. Anecdotally, the goods I saw were far from conspicuous. They all looked straight out of some music videos (heard of the "Ugly" shoes?).

<comment><USER19> As long as the intended audience recognizes them, they're doing their job.

There is also a significant subculture or sneaker collectors who buy them like someone might a rare run of "collectible" action figures, where rareness is all that matters over the value of the item _per se_. Some crazy-seeming sneaker prices are just companies catering to that market. Of course there's overlap and symbiosis with the signaling crowd, too.

</comment></comment></comment></comment><comment><USER25> I can almost hear it: _Where oh where will I buy a fluorescent fuchsia sports coat for $8000 now?_

Amazon and similar are no good for luxury goods because of the lack of service that luxury shoppers expect. Perhaps they need to shift to an online-first model with video-conferenced personal shoppers who can browse store-like inventory while serving qualified shoppers who can concurrently navigate their wardrobe?

Personally, I like Neimy's, but not as a go-to retailer but as a once-every- twenty-years-buy-something-nice-and-crazy; their service is/was fantastic, they know their products/fashion, and their employees aren't/weren't like standard American retail salespeople. Ordinarily, I go to Salvation Army and Goodwill for outer clothing only, and eBay for new-but-discontinued b-stock or liquidated inventory of other clothing that I can no longer find.

</comment><comment><USER26> I hope individuals and businesses start saving again. When I was a kid, everyone saved money. We spent it too, but we all saved for rainy days. Maybe that idea will make a come back now. Be prepared. You never know what may happen.

<comment><USER19> I agree, but if they do we're in for a looooong recovery. If we're not already.

<comment><USER26> Yes. We should not go over board. Keep spending and supporting local businesses, but save some too. Say 15% of your earnings. Put it in the bank.

I remember when my wife tried to get a credit card right after we got married. She could not get one. Back then, there was only Visa and Mastercard. Then Discover card came out and she was able to get one with a very low limit. She used that to build her credit over the years. Today, the grand kids get card offers in the mail several times a month. We need to be somewhere in the middle and not at either extreme.

</comment></comment></comment><comment><USER27> One of my few regrets in life is that I never bought the family a Neiman Marcus Kitchen Computer.

[https://www.google.com/search?q=neiman+marcus+kitchen+comput...](https://www.google.com/search?q=neiman+marcus+kitchen+computer)

</comment><comment><USER28> People dress very cheaply now. I'm always amazed from historic photos, it seems the further back you go the more money they spent on appearance.

These days it just looks like no one cares. I'm surprised upmarket stores lasted this long.

<comment><USER29> Price doesn't reflect quality. Ever pull a good thrift store haul?

<comment><USER30> There's a phrase, 'cut and cloth'.

Better materials, the basic ingredients, generally increases the price (cloth from quality fabric mills, finer wools, nice dyes, shell buttons, leather, etc...). And the cut matters, to pay for a tailored shirt in England or Italy will cost you -- that is, the labor, design, and construction.

Sure, a high price tag does not necessarily imply quality -- but let's not be fools about the matter.

</comment></comment></comment><comment><USER31> > Neiman Marcus, laden with debt after a private equity takeover...

How unsurprising.

</comment><comment><USER32> I'd been to the Neiman Marcus in SF maybe.... once a year when in lived in SF. And a few times in Newport Beach over the last 20 years. I've never seen more than a few people per floor.

It's not surprising to me they are going under. I don't know who their market was. It was all very high end. But, seeing almost no one in those giant stores always seemed like the end was near.

</comment><comment><USER33> Interesting how the Barney's bankruptcy did not receive any commentary from the HackerNews.

As a software engineer with a degree in fashion design as well, I believe both luxury retail stores are equally notorious

<comment><USER34> Probably due to size?

<comment><USER33> As in market cap? It's 3x more, but Barney's is more legendary in fashion circles. Could also because there is more brand dilution at Neiman Marcus

<comment><USER34> I was referring to the number of stores, which speaks to whether it's a "common" brand (outside of fashion circles)

</comment></comment></comment></comment><comment><USER35> They just opened a huge new store at Hudson Yards in NYC. I'm sure lack of foreign rich tourists(mainly rich Chinese) during COVID months must have hurt them big time as well.

</comment><comment><USER36> Inverse pass the parcel: Those who pass it on get the prize, the child that ends up holding it looses... everything

</comment><comment> 1-6 The definition of luxury has changed. It's now more about value, utility, and stability. Luxury means owning property in a high-end location, a MacBook Pro, fast optical networks, clean drinking water, and a reliable car.

<comment><USER37> MacBook Pros are luxury goods now? What someone, such as myself, doesn't really like them, and instead prefers Thinkpads, like most of my peers?

<comment><USER38> What you like has little to do with luxury, and in many cases is actually anti-parallel to luxury.

I like my comfortable cotton tank top and my mom's mac and cheese but neither of them are luxury goods.

In fact since a lot of luxury is actually about signaling, if it's too comfortable / has high utility, it might actually lose status.

</comment></comment></comment><comment><USER39> Definitely a Brave New World. I guess we won't be getting our His and Hers gold plated, nuclear powered mini-subs this Christmas after all...

<comment><USER39> Apparently some here are unfamiliar with this holiday tradition:

[https://www.mentalfloss.com/article/89283/stories- behind-12-...](https://www.mentalfloss.com/article/89283/stories- behind-12-outrageous-neiman-marcus-holiday-gifts)

<comment><USER40> This one may be more in line with the Hacker News crowd:

[https://www.computerhistory.org/revolution/minicomputers/11/...](https://www.computerhistory.org/revolution/minicomputers/11/362)

</comment></comment></comment><comment><USER41> Lord & Taylor next

<comment><USER42> Prof G had mentioned that Nordstroms could be in a position to be acquired by Amazon back when he made the Wholefoods acquisition prediction. I wonder how their books are fairing these days

</comment></comment><comment><USER43> Their nickname: needless markup</comment>


Make Use Of The 21 Spare iPads You Have Laying Around - <AUTHOR> http://engineering.madefire.com/2012/07/12/ipad-video-wall-for-comic-con/

<comment><USER2> I don't get it. Why do this with iPads, rather than the old-school way with monitors? Wouldn't that make for easier, cheaper, and higher-value? Unless they really did have 21 iPads lying around the office.

Okay, back-of-the-envelope time!

21 iPad2s is what, $850? Plus $1k worth of server to drive it? Over $9k, anyway.

This whole setup is 5376x3072 resolution, at roughly 23" by 41" of viewable area (at a novel 1.75x aspect ratio).

Nine 1920x1024 monitors would give you 5760x3072, at a more traditional 1.78x ratio. Each needs to be 13.56" x 7.75" to get the same physical size, which is to say we're talking about 17" monitors. So let's make it more visually imposing, scale it up 25% to 21" monitors. Those go for $120 each, so that's just over $1000 in monitors. You're gonna need 5 video cards, call it another $1000, and maybe those are going to go into two servers instead of one, so another $2000. At $4000 total, you're ahead at least half the price.

If you don't want to scale it up, and you're willing to go slightly lower-res, you can do 4 24" monitors, easily driven by two cards on one server. Lower cost, more-useful hardware, but lower res.

More interestingly, with either case you don't have to fight Apple's walled garden, you don't have to worry about weird RF issues or charging, and you've got general-purpose hardware that you can use for developer machines afterwards.

So, anyway, now that I've spent WAY too much time on this and should go back to work, here's my TL;DR:

Is there any reason at all that this is a good engineering approach to building a video-wall?

<comment><AUTHOR> we used iPads b/c we're working on an app for iPads and it was a great way to instantly tell people what we're doing and it's just plain cool. most of your technical points are valid, but we wouldn't have enough power to run nine monitors at our booth. most importantly, no one would look twice at a massive monitor wall at comic-con. they're a dime a dozen and all of the big players have jumbo-tron style walls. we had loads of people comment on the iPad wall today and ask us how we did it. we even had the av guys from one of the big jumbo-tron companies come talk to us about how we built it.

</comment></comment><comment><USER3> Wow, that's really cool. How big of a screen did it end up being (curious about both inches and pixels)?

<comment><AUTHOR> thanks.

pixels of iPad screens: 768 * 7 = 5376 1024 * 3 = 3072 approximate dimensions: 51.75x27.5"

</comment></comment><comment><USER4> Awesome! How did you make the physical board that holds all the iPads?

<comment><AUTHOR> the booth is built with 3/4' laminated plywood, we'll have pics up soon (would already but the hotel wifi sucks.) the iPads sit on small metal L brackets fastened to the wall and are held in place heavy duty velcro. the L brackets have slots cut in them to allow the the connectors to pass through. everything is spaced and laid out such that the ipads are end-to-end horizontally and only have about 1/3" between them vertically. i'll try and get some close up pics tomorrow.</comment></comment>


Mozilla can produce near-native performance on the Web - <AUTHOR> http://arstechnica.com/information-technology/2013/05/native-level-performance-on-the-web-a-brief-examination-of-asm-js/ <comment><USER2> BTW, C/C++ code that is compared has multithreading and SIMD capability disabled. In the third page they benchmark asm.js and native with multithreading and SSE enabled. It shows upto 50x slowdown! Not exactly sure what the point of a benchmark without multithreading is. I mean anyone writing performance sensitive apps will use MT right? (given JS is single threaded, it seems this is a dealbreaker).

[http://cdn.arstechnica.net/wp- content/uploads/2013/05/classi...](http://cdn.arstechnica.net/wp- content/uploads/2013/05/classic-native-v-optimized-v-asmjs.png)

<comment><USER3> Is it fair to describe JS as single-threaded when all modern browsers support web workers?

Related: Why does it seem like web workers don't exist? I can hardly think of any popular libraries or web apps that make use of them, despite the seemingly obvious utility.

<comment><USER4> After getting very excited and doing a bunch of work, we did a lot of performance tests and discovered that for our use case all they did was increase processor load for the same work - the penalty associated with serialising and deserialising things to go across postMessage was greater than the work we were getting done on the other thread.

Of course this was in the early days, and it'd be good to retest it to see if it's better now.

I think that there are a lot of interesting use cases for WebWorkers, but you also have to be aware that for some things they will actually slow down your application.

<comment><USER5> It is still not good. I've started working on an asteroids game [0], and I tried moving my physics calculations to a background thread, but it ended up being slower.

0 <http://www.isaksky.com/asteroids/>

</comment></comment></comment></comment><comment> ux-app For most applications JS doesn't need to get any quicker. What makes web apps feel like swimming through molasses is the DOM.

Even something as simple as getting a Div to follow the mouse on anything but the simplest of pages is impossible to do without incurring ridiculous lag.

I don't know enough about them, but it seems that maybe Web Components may offer some answers by encapsulating mini Document trees which presumably exist in isolation from other components thereby reducing the penalties of dynamic CSS.

<comment><USER6> Like this? <http://jsfiddle.net/eymAS/2/>

The DOM is faster than almost everyone believes. It's not 2001 anymore, guys.

Web components solve a lot of major problems, but it has little to do with DOM/CSS performance and more to do with encapsulation (ie, so your CSS/HTML/JS don't break a component). DocumentFragments and insertAdjacentHTML solved more performance problems for the DOM than most other API changes have, and smarter compositing/painting algorithms in browsers (along with hardware acceleration) have made it possible to do some pretty ridiculous stuff.

<comment><USER7> The problem is that the DOM is a hard upper limit on performance compared to what the performance of an unsafe language (asm.js) is. It is massively complex because it must perform every UI task in the browser and simply moving around DIVs doesn't give you a feel for its the performance in complex scenarios.

If you think about how native applications perform and then imagine every one having to go through a DOM interface and every button and UI interaction being composed of DOM elements and re-styling these elements on every interaction you get a sense of what the problem is. There is simply no way to get the DOM to do something it wasn't designed to do, which is to be a document display interface and not a general graphical user interface. You have to clobber together a lot of interactions to get the desired behavior and not only does this increase the overhead for both your program and the DOM you are going to hit cases where the DOM isn't optimized.

This doesn't mean that the DOM is inherently slow. If you tried to offload the UI work onto javascript you wouldn't get the performance benefit of doing that on Asm.js or NACL. You really need unsafe code to solve this problem. Asm.js and NACL are only useful if you are going to do this; targeting the Canvas and WebGL gives you the ability to do that.

<comment><USER8> What you describe -- "imagine every one having to go through a DOM interface and every button and UI interaction being composed of DOM elements and re- styling these elements on every interaction" -- is exactly how Firefox is built. The desktop Firefox UI is all DOM elements (not HTML, but still the same underlying DOM code).

Hovering over a toolbar button or a tab causes a CSS style rule for a :hover effect to be applied. Opening a new tab uses CSS animation for the transition. Moving tabs around manipulates the DOM and moves the tab elements (which are themselves composed of images, labels, etc.).

And yet, the Firefox UI is plenty snappy -- yes, you can argue that there are slowdowns and issues that need to be fixed, but no more or less than in many "native" apps.

</comment></comment></comment></comment><comment><USER9> The fascinating thing about this is that they didn't write a new JIT for asm.js. It's just their existing JIT with more information and a few new tricks. Among other things, this means that it doesn't yet have a lot of the fancy optimizations that C/C++ compilers typically have in their backends, like clever instruction selection or register allocation. It's already impressively fast, and it has the potential to get even faster.

<comment><USER10> > It's just their existing JIT with more information and a few new tricks.

Spidermonkey is composed of the Baseline Compiler (JIT) and Ion Monkey (JIT), but a new AOT compiler was written, called "Odin Monkey."

<comment><USER9> OdinMonkey uses the existing IonMonkey compiler to do the actual optimization and code generation work.

This blog post has more information [0]; see especially the comments section where the author responds to some questions and discusses the relationship between OdinMonkey and regular JS compilation.

[0] [https://blog.mozilla.org/luke/2013/03/21/asm-js-in- firefox-n...](https://blog.mozilla.org/luke/2013/03/21/asm-js-in-firefox- nightly/)

<comment><USER10> oh, interesting! Good eye, thanks for pointing this out!

</comment></comment></comment></comment><comment><USER11> I would much prefer having a sane new language replacing JavaScript instead of this hack to improve performance. A new language could provide the same performance advantage and make writing web applications much more pleasant.

Admittedly it is harder to introduce a new language across all (major) browser but I think it would really be worth it.

<comment><USER12> I don't understand this stuff well enough, but doesn't Emscripten effectively give you that? It converts LLVM bitcode into JavaScript, so if you can compile it with LLVM, you can use it on the web.

<comment><USER13> But that's like converting C into python. Why not begin a new/existing language that can be compiled and ran at native speeds?

<comment><USER14> Three such languages are called AMD64, IA32 and ARM machine code, and are supported by Google Native Client (NaCl). I think they will be exceedingly hard to beat when it comes to speed and loading time.

<comment><USER15> They are fast, indeed. But by targeting NaCl, you are producing code that: \- will only run on Chrome; \- will only run on the hardware platforms for which you have developed.

This kind of kills all the fun in the web. By contrast, asm.js code will run just about everywhere, today. And will get blazingly fast in ~12 weeks for Firefox (a little later for Chrome and Opera).

<comment><USER16> > \- will only run on the hardware platforms for which you have developed.

What fast browser JITs are actively developed for platforms other than ARM, AMD64 and IA32? V8 does not support anything else, and while Firefox enables SpiderMonkey for MIPS and SPARC [1], "unsupported" is not a very hearty endorsement.

[https://developer.mozilla.org/en- US/docs/SpiderMonkey/1.8.8#...](https://developer.mozilla.org/en- US/docs/SpiderMonkey/1.8.8#Platform_support)

<comment><USER17> SpiderMonkey works on PPC, for what it's worth; the TenFourFox project is actively maintaining it there. They're usually a bit behind on porting the JITs, but they do actively port them.

But the real issue with NaCl is this thought experiment. Assume NaCl were developed in 1998 and everyone had jumped on that bandwagon and the web in 2003 were full of NaCl blobs targeting the hardware architectures that mattered in 2000-2001. Then ask yourself the following questions:

1) Would this have affected the choice of hardware for phones and tablets and whatnot?

2) Would it be viable today to ship a web browser on an ARM system?

3) What makes us think that the currently-relevant set of hardware architectures will still be the set we want to be using in 10-15 years? In 30 years?

The nice thing about asm.js or PNaCl compared to NaCl is that even if we ship it right now and only run it right now on ARM/AMD64/IA32, if someone comes up with a new hardware architecture they want to ship in consumer devices they can simply implement a JS JIT for it (in the case of asm.js) or an LLVM backend (for PNaCl), which is something they would need to do _anyway_ for that "consumer devices" bit. On the other hand, if they have to deal with legacy NaCl content they suddenly have to do hardware emulation or something insane.

</comment></comment></comment></comment></comment></comment></comment><comment><USER18> > Emscripten builds taking between 10 and 50 times longer to compile than the > native code ones.

Hey, this is fatal. With this massively long iteration time, you can't run actual big projects. Only executing 1,000,000 lines of C++ code is not enough. We care the build time as well as the perforamnce.

BTW, have you heard that the next Haswell processors can get only 5% performance improvement? We should assume that we have no free lunch anymore. One of the UNIX philosophies is already broken.

<comment><USER19> I thought the Haswell CPU was more about reducing power usage then adding performance? I'd be curious to know how much effort was spent on the power consumption vs performance.

</comment></comment><comment><USER20> It seems Mozilla and Google are moving more and more toward their own browser specifications and mechanisms. Microsoft and Netscape did this in the 90s, and it ended up causing nothing but pain.

Optimizing JS is interesting, but creating browser-specific applications of code meant for a web audience disturbs me. I don't want a repeat of the first browser wars. Hopefully Mozilla will work toward w3 standards in this effort, since Google clearly hasn't with Dart.

<comment><USER12> As far as I know, asm.js is a strict subset of JavaScript -- I don't believe it's "browser-specific" in a meaningful way. Rather, it shows that it's _possible_ to take a subset of JavaScript and make it run at near-native speeds, which means that there's still a lot of room left for the VMs to improve.

From glancing at the benchmarks in the Ars article, it looks like asm.js generally runs around twice to four times as fast as the same code without asm.js-specific optimizations. This is a huge improvement, but it's not the difference between something being blazing fast in one browser and unusably slow in another.

<comment><USER21> In some applications it doesn't matter, in some it's crucial. If your game runs at 60 fps in firefox and 15 fps in other browsers, it's effectively firefox-only game.

Additionaly browser games can't have main game loop (cause it would hang the browser infinitely), but often use "requestAnimationFrame" to trigger updates with the best sustained refresh rate available. Even if only one frame out of every 10 in your game is taking 20 ms instead of 16 ms - your game won't run with 60 fps anymore, but with 45 fps or 30 fps because browser is trying to choose refresh rate that will work. And that's a big difference in experience.

</comment></comment></comment><comment><USER22> I really disagree with the idea of ASM.js. I think that the whole asm.js thing has got people more people confused into thinking that they can't build fast applications in regular JavaScript.

That is not true. JavaScript code is usually compiled to native code now and is very fast -- generally much faster than Ruby and Python.

I wish Mozilla and other core browser teams would focus on better WebGL support in more drivers and devices as well as better JavaScript engines -- for example Safari especially stands out with their deliberately crippled performance, and Microsoft with their deliberately crippled featureset.

The great thing about the web is convenient APIs like WebGL and nice languages like CoffeeScript. ASM.js negates that for no good reason. There are huge opportunities for exciting WebGL games which don't require the most optimized possible JavaScript, that just haven't been explored yet, and within a couple of years ordinary hardware will go much faster anyway.

<comment><USER23> What do you dislike about the idea of asm.js? (You mention that some people think asm.js is evidence that you can't make things fast enough in regular JavaScript, but that is something you dislike about people's reactions to asm.js, not an issue with the idea of asm.js.)

<comment><USER22> It promotes that idea.

Also, asm.js negates the advantages of the nice web APIs and type-free programming languages etc.

Read what I wrote.

<comment><USER24> Being able to use _any_ language is better than having to use _one_ language littered with WTF pitfalls because one guy had to hack it together in a week. And the debate about type checking and static analysis is far from settled.

</comment></comment></comment></comment><comment><USER25> It feels the most interesting use of asm would be to bring existing C code into javascript and have it run at reasonable speeds. Things like small (or not) database engines, authentication or encryption libraries, data parsing utilities etc...

</comment><comment><USER26> Near native performance is a very good thing especially in the fields such as game development.

However, it's a pity that Mozilla doesn't address the main problem with the web platform, the lack of good platform and the set of API, something like Java or .NET provides. There are a large number of good javascript applications (Google docs, GMail, etc), which are produced by heroic efforts of the teams who created them. The same effort could have been expended on hundreds more useful software, if JavaScript was replaced by something more adequate.

<comment><USER27> Look around you at the Web: all the top sites use JS heavily and without "heroic efforts" compared to Java (dead on the client) or .NET (WPF is dead too).

If the old big-OO-frameworks really conferred such huge fitness advantages over JS, you would not see them dead on the client. They would have been used, and their plugins would have been supported better by the plugin vendors.

JS these days has a lot going for it, including IntelliJ-style IDEs (Cloud 9 offers one) and not-too-OO-or-huge frameworks.

/be

<comment><USER26> >Look around you at the Web: all the top sites use JS heavily and without "heroic efforts" compared to Java (dead on the client) or .NET (WPF is dead too).

Java isn't used in the browser because of awfully bad user experience, and bad security (personally, I disabled Java in the browser). JavaScript applications just look much better and behave much more smoothly, which is more important on the web than ease of development and performance. Web applications are much more readily used than desktop applications, and that's why we have to use them. It's just economic incentive. If we create a desktop application, user base which we sell too will be much smaller if the same application will be provided on the web. I'd love to use technologies, which make me more productive than JavaScript like JavaFX and Silverlight, or at least Flash. However, there's a large percentage of users whose browsers don't support them and if they support them they provide inferior user experience. I (and many other people) use JavaScript not because it's great but because it's the only platform which is universally supported by browsers not and provides superior user experience. It's the only reason to use it.

> without "heroic efforts" compared to Java (dead on the client) or .NET (WPF > is dead too).

Most of the top sites are quite trivial in code complexity. They are more complex design and ui-experience wise than codewise. There are, of course complex web applications, like google docs, cloud9, gmail, google reader, but they were created with definitely heroic efforts, and they don't reach the complexity of the top desktop applications. Where's web based Mathematica, 3DS Max, Autocad, IntelliJ? When web based office applications will have performance of MS Office?

As an indicator of how complex these web applications are, you can take a look at how many web frameworks have non trivial collections, like HashSets, HashMaps, TreeMaps etc. Only the following frameworks support them: closure tools, GWT, Dart. Most of the popular JS frameworks which are used by top sites don't use them.

>JS these days has a lot going for it, including IntelliJ-style IDEs (Cloud 9 offers one) and not-too-OO-or-huge frameworks.

I actually work at JetBrains (the creator of IntelliJ), and I can say that Cloud9 provides IDE experience from 90s. The only meaningful feature that it supports is code completion and error highlighting. It has no refactorings, find usages, and many other smart features. I think, the JavaScript is to blame, and I feel that so complex code is near impossible to write in a language such as JavaScript (because of its lack of static type system).

<comment><USER27> Quick reply (thanks for the well-formatted cited text!).

* Java didn't have the bad security rep until relatively recently. Java had nice-looking UX in the 90s (Netscape bought Netcode on this basis), much nicer than Web content. Didn't help.

* Web != Desktop. Large desktop apps are the wrong paradigm on the web. You won't see a Web-based Mathematica rewritten by hand in HTML/JS/etc. You will see Emscripten-compiled 3DS Max (see my blog on OTOY for more). The reasons behind these outcomes should be clear. They have little to do with JS lacking Java's big-OO features.

* Large mutable-state collection libraries are an anti-pattern. Functional structures, when hashes and arrays do not suffice (and even there), are the future, for scaling and parallel hardware wins.

* Conway's Law still applies. Too often, bloated OO code is an artifact of the organization(s) that produced it. This applies even to open source (Mozilla's Gecko C++ code; we fight it all the time, including via JS). It definitely applies to Google (e.g., gmail, Dart at launch). Perhaps there's no other way to create such code, and we need such programs as constituted. I question both assumptions.

* Glad you brought up refactoring. It is doable in JS IDEs with modern, aggressive static analysis. See not only TypeScript but also Marijn Haverbeke's Tern and work by Ben Livshits, et al., at MSR. But automated refactoring is not as much in demand among Web developers I know, who do it by hand and who in general avoid the big-OO "Kingdom of Nouns" approach that motivates auto-refactoring.

In sum, if the web ever becomes big-OO as Java and .NET fans might like, I fear it will die the same death those platforms have on the client side. Another example: AS3 in Flash, also moribund. These systems (even ignoring single-vendor conflicts) were too static.

The Web is not the desktop. Client JS-based code can be fatter or thinner as needed, but it is not as constrained as in static languages and their runtimes. Distribution, mobility, full-stack/end-to-end (Node.js) options, offline operation, multi-party and after-the-fact add-on and mash-up architectures, social and commercial benefits of the Web (not just of the Internet) -- all these change the game from the old desktop paradigm.

JS has co-evolved with the Web, while the big-OO systems have not. This might still end up in a bad place, but so far I don't see it. JS can be evolved far more easily than it can be replaced.

/be

<comment><USER26> >* Web != Desktop. Large desktop apps are the wrong paradigm on the web. You won't see a Web-based Mathematica rewritten by hand in HTML/JS/etc. You will see Emscripten-compiled 3DS Max (see my blog on OTOY for more). The reasons behind these outcomes should be clear. They have little to do with JS lacking Java's big-OO features.

I am actually not defending big-OO features (I think, 90s style big-OO is obsolete). I like mix of OO and functional programming and like the results which it confers to code (see for example, Reactive Extensions, it's very easy to learn, expressive, and compact). The feature which I miss in JavaScript and which platforms such as JVM and .NET have, is ease of maintaining code, mainly through sound type system and languages created with tooling in mind.

>* Glad you brought up refactoring. It is doable in JS IDEs with modern, aggressive static analysis. See not only TypeScript but also Marijn Haverbeke's Tern and work by Ben Livshits, et al., at MSR.

The problem with algorithms similar to Tern's is that it works well until we use reflexive capabilities of the language. However, most of the libraries do use them, and as long as it happens, algorithms such as Tern's infer useless type Object.

>But automated refactoring is not as much in demand among Web developers I know, who do it by hand and who in general avoid the big-OO "Kingdom of Nouns" approach that motivates auto-refactoring.

There are refactoring which can be useful in any language. My favorite one is rename, I usually can't come up with a good name from a first attempt. Others are extract/inline method (extract/inline variable is easy to implement in JavaScript).

Another maintainability related feature is navigation to definition and find usages. Unfortunately, language dynamism makes them imprecise and code maintenance becomes nightmare especially if you have > 30 KLOCs of code. You have to recheck everything manually and it's very error prone. Tests can help, but they also require substantial effort.

<comment><USER27> Tern's static analysis is based loosely on SpiderMonkey's type inference, which does well with most JS libraries.

Yes, some overloaded octopus methods fall back on Object. What helps the SpiderMonkey type-inference-driven JIT is online live-data profiling, as Marijn notes. This may be the crucial difference.

However, new algorithms such as CFA2 promise more precision even without runtime feedback.

And I suggest you are missing the bigger picture: TypeScript, Dart, et al., require (unsound) type annotations, a tax on all programmers, in hope of gaining better tooling of the kind you work on.

Is this a good trade? Users will vote with their fingers provided the tools show up. In big orgs (Google, where Closure is still used to preprocess JS) they may, but in general, no.

Renaming is just not high-enough frequency from what I hear to motivate JS devs to swallow type annotation.

/be

<comment><USER26> >And I suggest you are missing the bigger picture: TypeScript, Dart, et al., require (unsound) type annotations, a tax on all programmers, in hope of gaining better tooling of the kind you work on.

In many cases types can be inferred. ML is able to infer almost all types in a program (however the algorithm requires that the language doesn't have subtyping). Haskell has very good type inference which support subtyping (you declare very few types). They both have strong static type system and don't tax developers by making them having to declare every type. Algorithms which are used in Haskell are complicated, but they can be implemented.

<comment><USER27> I know about ML and Haskell but let's be realistic. Neither is anywhere near ready to embed in a browser or mix into a future version of JS.

We worked in the context of ES4 on gradual typing -- not just inference (as you imply, H-M is fragile) -- to cope with the dynamic code loading inherent in the client side of the Web. Gradual typing is a research program, nowhere near ready for prime time.

Unsound systems such as TypeScript and Dart are good for warnings but nothing is guaranteed at runtime.

A more modular approach such as Typed Racket could work, but again: Research, and TR requires modules and contracts of a Scheme-ish kind. JS is just getting modules in ES6.

Anyway, your point of reference was more practical systems such as Java and .NET but these do require too much annotation, even with 'var' in C#. Or so JS developers tell me.

/be

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER28> It seemed that the general idea of web being slow is so polarizing that each and everyone of us can't even pinpoint where the problem is. I suspect the problem is a multidimensional one.

</comment><comment><USER29> tl;dr: its not as fast as native but its much better than AT expected, and actually within 2x the speed of native.

Also its slightly slower (a few %) than regular JS on browsers without asm.js support.

<comment><USER30> > its slightly slower (a few %) than regular JS on browsers without asm.js > support

You sure you meant what you said here?

<comment><USER31> Check this out (from the asm.js spec)

        function add1(x) {
            x = x|0; // x : int
            return (x+1)|0;
        }

This declares x to be an int in asm.js, which allows a bunch of optimizations. In a non-asm.js engine, it is an extra 2 operations.

It's not difficult to believe that a non-asm.js engine would be slower with the type annotations than without, although I don't have any performance numbers to check.

<comment><USER32> It's not an extra two operations. An optimizing JIT like CrankShaft or IonMonkey can remove the first |0 operation in code paths where it is not needed (that is, where you call it with an integer), and can remove the second |0 even more easily by simple inference - in fact, the second |0 allows the JIT to emit a 32-bit addition, with no overflow checks. So it can make code faster, with or without asm.js.

<comment><USER31> Count the number of times you wrote "can" vs how many times you typed "does". Similar stuff happens with C++ compilers all the time, where certain code "can" help the compiler but, in practice, doesn't always.

The linked benchmarks _do_ show a slowdown with asm.js in IE10. Whether this is due to type annotations or something else I don't know.

<comment><USER32> Are you saying it's as unpredictable as C++ performance then? I'll take that ;)

I wrote "can" because there are no guarantees, but in practice, this is definitely done in Firefox and Chrome. See

[http://www.arewefastyet.com/#machine=11&view=breakdown&#...</a><p>- they don't get that close to native speed without such optimizations.<p>Not sure what is going on in IE10, but I am more curious about IE11.

</comment></comment></comment></comment></comment></comment><comment><USER33> It would be interesting to see an implementation of this on ARM platform. Firefox OS powered mobile device would be really promising with this optimization.

<comment><USER34> asm.js is already enabled on Firefox for Android nightly builds. We hope to have asm.js enabled in Firefox OS by the 1.2 timeframe (middle/end of 2013)

</comment></comment><comment><USER35> I think it's becoming clear that there is room for two classes of web language: one for general use (JavaScript) and one for high performance applications or games. Let's get a real language alternative, free of half measures or compromises.

<comment><USER32> All languages and VMs are compromises: JavaScript, JVM, CLR, LLVM, Flash, etc. Question is which compromise you prefer.

</comment></comment><comment><USER36> What do developers want for a development environment these days? Is C/C++ the next wave of web development? Tooling is a lot better than when I did it 15 years ago. Dart, however, seems like a friendlier environment but it probably won't be as fast a C++(asm.js).

<comment><USER37> > Is C/C++ the next wave of web development?

asm.js is certainly not targeted at writing web applications in C or C++. It's more about supporting arbitrary languages and getting existing native code bases (e.g. libraries and game engines) on the web.

There's some more background in this presentation: <http://kripken.github.io/mloc_emscripten_talk/>

(That said, based on anecdotal evidence, C++ seems to work pretty well on large projects where predictability and reliability matter. So for really large, complex web apps, C++ might become a popular choice. Not really seeing this happen though, as web applications generally handle the hard stuff in the backend.)

> Dart, however, seems like a friendlier environment but it probably won't be > as fast a C++(asm.js).

It probably doesn't have to most of the time. Hardly anything in the web applications I've worked on was ever CPU-bound, the network is usually the big bottleneck. We're just scripting the browser after all, most of the hard stuff (rendering, storage engines etc.), is already taken care of by native code.

</comment></comment><comment><USER38> I wonder how the Internet would have looked like if it had developed the way that Alan Kay proposed (i.e. a browser as a mini-operating system). It's quite possible that we'd have much better performance (among other things) from the start.

</comment><comment><USER39> Why dont they just insert regular C/C++ source code inside HTML and be done with it? Eventually the browser is just going to be a download manager that downloads executable code and runs it locally :P

<comment> iso8859-1 Emscripten can't compile LLVM yet, so you can't put the compiler in a web page. And considering that a PDF reader is couple of megabytes of JavaScript, LLVM would be probably be tens of megabytes.

</comment></comment><comment><USER40> No it can't. C is not the speed limit. Top native performance is achieved by an ungodly combination of SIMD intrinsics, compiler-assisted optimization, cache-aware data-structures and assembly.

</comment><comment><USER41> Why don't they first produce near-Chrome performance for their browser? Every time I use Firefox, it slows down to a snail's pace and eventually crashes if there are more than 4--6 tabs open.

<comment><USER42> Is your FF up to date? Since around v20 it feels way snappier than Chrome, at least on OSX.

<comment><USER41> I switched to Chrome right around Firefox v3.6. I've tried it a few times since, but I don't remember which version Firefox was at at the time.

</comment></comment></comment><comment><USER43> Finally, I can write all my web apps in C/C++. Dream come true!

<comment> iso8859-1 Well, there still is no interface to the DOM. So it really depends on your definition of "web app". It is quite comparable to applets IMHO. Except applets are less of a hack. I wish Sun had invested more time in their "sandbox".

</comment></comment><comment><USER44> > It's a limited, stripped down subset of JavaScript that It's a limited, > stripped down subset of JavaScript that the company claims will offer > performance that's within a factor of two of native—good enough to use the > browser for almost _any_ application.

Except for running webpages scripted with Dart. It's not fast enough for _that_ application apparently. <https://news.ycombinator.com/item?id=3095519>

<comment><USER27> Who knows how fast Emscripten+asm.js-compiled DartVM would be compared to Dart2JS in 2013? I don't know yet, and apparently neither do you. JITs can be tricky, but @azakai is having good results with Emscripten+asm.js'ed LuaJIT2.

What I wrote 593+ days ago was about the Dash memo's Microsoft-like strategy. My point then was not that it couldn't ever be defeated by something like our work on asm.js and Emscripten. Never say never. My point rather was that the Dash strategy intentionally used Google's big resources to push a gratuitously non-standards-based agenda at the expense of its Web-standards-based efforts.

Indeed, since then it has become clear that Google miscalculated. Dart even gave up bignums (the int type) to support Dart2JS/DartVM equivalence, which I think is a mistake. Bignums are actually on the JS standards-based agenda:

<http://wiki.ecmascript.org/doku.php?id=strawman:bignums>

[http://wiki.ecmascript.org/doku.php?id=strawman:value_object...](http://wiki.ecmascript.org/doku.php?id=strawman:value_objects)

See also

<https://bugzilla.mozilla.org/show_bug.cgi?id=749786>

Given all the time that has passed since 2010, Google champions in Ecma TC39 could easily have worked bignums into ES7 if not ES6.

At a higher level, by over-investing in Dart and under-investing in JS (the V8 team was moved from Aarhus to Munich and with the no-remoties rule had to be rebuilt), Google has missed opportunities such as game-industry work we announced at GDC with Epic. This is "ok", it's their choice, but I still say that it is inherently much more fragmenting than any optimization of the asm.js kind, and that it under-serves the standards-based Web.

Maybe in a few years we can evolve JS to incorporate whatever helps DartVM beat Dart2JS, if there's any gap left. However, the idea that mutable global objects in JS necessarily mean VM-snapshotting is impossible is simply false. On the other hand, do we really need VM snapshots to speed up gmail startup? LOL!

/be

<comment><USER45> You can't simply asm.js'fy LuaJIT2 because it has an interpreter hand written in assembly and it generates native code to achieve peak performance. You can only asm.js'fy a normal Lua interpreter which is up to 64x slower than LuaJIT on benchmarks, when compared natively. So asm.js'fied Lua will be up to 128x slower. Does not sound that impressive...

<comment><USER27> Hi -- you make a good point, the one seemingly at issue in this tangent (but not really the bone of contention).

As noted, I don't know which will ultimately prevail in pure performance: DartVM or Dart2JS on evolved JS. In the near term, of course DartVM wins (and that investment made "against cross-browser standards" was the strategic bone of contention 594 days ago).

I do know that in the foreseeable term, we browser vendors don't all have the ability to build two VMs (or three, to include Lua using LuaJIT2 or something as fast, in addition to JS and Dart; or more VMs since everyone wants Blub ;-).

The cross-heap cycle collector required by two disjoint VMs sharing the DOM already felled attempts to push Dart support into WebKit over a year ago. Apple's Filip Pizlo said why here:

[https://lists.webkit.org/pipermail/webkit- dev/2011-December/...](https://lists.webkit.org/pipermail/webkit- dev/2011-December/018811.html)

Other browser vendors than Apple may have the resources to do more, but no browser wants to take a performance hit "on spec". And Mozilla at least has more than enough work to do with relatively few resources (compared to Apple, Google, and Microsoft) on JS. As you've heard, asm.js was an easy addition, built on our JIT framework.

So you're right, an optimizing JIT-compiling VM is not easily hosted via a cross-compiler, or emulated competitively by compiling to JS. LuaJIT2 would need a safe JIT API from the cross-compiler's target runtime, whether NaCl/PNaCl's runtime or Emscripten/asm.js's equivalent.

Googling for "NaCl JIT" shows encouraging signs, although the first hit is from May 2011. The general idea of a safe JIT API can be applied to asm.js too. In any event, one would need to write a new back end for LuaJIT2.

Bottom line: we're looking into efficient multi-language VM hosting via asm.js and future extensions, but this is obviously a longer road than C/C++ cross- compiling where we've had good early wins (e.g., Unreal Engine).</comment></comment></comment></comment>


Ask HN: Best current model routers for OpenWRT, DD-WRT, Tomato, etc.? - <AUTHOR> There are many models of routers that support open source router software/firmware like OpenWRT, DD-WRT and Tomato. However, when you look around, it's very difficult to determine the recency of router models out there and post date isn't always useful since many use which ever router just happens to be available to them for free. If one were to decide to buy a brand new model router to install open source router software on, where would you go to find out the best current models and be able to compare their features?<p>While it would be nice to know the best models as of today (December 1st 2013), I think it's more interesting to be taught how to fish instead of being given a fish. This also makes it easier for me (and anyone else) to pass this advice onto the next person. <comment><USER2> My advice is to just avoid DD-WRT altogether. The community is so hostile and unhelpful, the site and wiki full of conflicting information, and almost all builds for anything besides the old Linksys gear is in a real unstable state. It seems almost inevitable that DD-WRT will just result in bricking your router and having some forum asshole mock you for it.

I'm running Merlin's AsusWrt on an RT-AC66U and I've been very happy with it. I bought it earlier this year to replace my aging WRT54GL which had run with Tomato for years.

I'm also a fan of OpenWrt, but I use the x86 build on a VM host, it acts as a router/firewall to other VMs in a private bridge.

<comment><USER3> I can vouch for this. I've run ddwrt on all my routers for some time, but it seems like they're no longer the favorite, for many reasons.

If I could do it all again, I'd go for OpenWRT, though in my case that's just because OpenWRT has some features that ddwrt is lacking (e.g. native IPv6).

<comment><USER4> Considering DD-WRT is simply a closed version of OpenWRT and this is HN... we should all be going for OpenWRT!

It's a pretty amazing little project.

</comment></comment></comment><comment><USER5> Ubiquiti devices all the way [1] [2]. They're the hacker's choice!

Before I discovered Ubiquiti, the Linksys WRT54Gx series was my goto. The problem with them is that, as a given WRT54Gx line matures, they usually shave down the specs. You can see that in action with the WRT54GS series here [3], which debuted with 8MB of flash and now only sports 2MB. Good luck getting anything useful into 2MB.

The other problem with the WRT54Gx's is that there's quite a lot of hardware and architecture variation under the hood. You're usually fine, but I do have one WRT54G-RG at home here that wouldn't even take OpenWRT. It's running DD- WRT, which is a ghetto. (I see some other commenters here feel similarly).

Anyway the Ubiquiti PicoStation 2HP, by contrast, has

      - 8MB of flash
      - 32MB of RAM
      - a nice Atheros SoC which transmits at the legal max of 1000 mW
      - can easily be outfitted with high gain external antennas
      - works perfectly under OpenWRT, and
      - is competitively priced at $78 [4]

The only downside: if you need extra ethernet ports, you'll want a separate switch or possibly a wired router. But I think it's worth it. You shouldn't put an all-in-one wireless / router device on the public internet. The commenter who runs pfSense on an x86 system has the right idea: [https://news.ycombinator.com/item?id=6829315](https://news.ycombinator.com/item?id=6829315)

Source: I started a live entertainment company 4 years ago. We use Ubiquiti equipment in all our shows, and we've deployed about 50 PicoStations with our own OpenWRT packages to date.

[1] [http://www.ubnt.com/picostation](http://www.ubnt.com/picostation)

[2] [http://www.ubnt.com/nanostation](http://www.ubnt.com/nanostation)

[3] [http://en.wikipedia.org/wiki/Linksys_WRT54G_series#WRT54GS](http://en.wikipedia.org/wiki/Linksys_WRT54G_series#WRT54GS)

[4] [http://store.netgate.com/Ubiquiti- PicoStation2HP-80211bg-100...](http://store.netgate.com/Ubiquiti- PicoStation2HP-80211bg-1000mW-IndoorOutdoor-AP-P245C157.aspx)

<comment><USER6> I have to wonder what the difference in BOM costs there is between 8MB of flash and 2MB of flash? Consumer USB flash prices in the 10+GB range are around 0.05 pennies per MB. Surely at the point, the cost of the enclosure dwarfs the cost of the actual memory for flash chips in the MB range.

It seems like the cost of retooling would far outweigh any cost savings from spinning a new rev with 6MB less flash.

<comment><USER7> They sell a lot more than just the WRT54 and are terrified that the $250 market (or whatever) will collapse if people start buying low end models and reflashing to gain features.

Its a market segmentation game. They'd gladly pay $5 extra for less memory, if neutering the low end device saves the sale of a high end $200 model.

You may wish to look into who owns Linksys.

<comment><USER8> > You may wish to look into who owns Linksys.

I think you're referring to Cisco, who manufactures higher-end networking equipment. But recently, Belkin bought Linksys from Cisco: [http://news.cnet.com/8301-1001_3-57574628-92/belkin- complete...](http://news.cnet.com/8301-1001_3-57574628-92/belkin-completes- acquisition-of-linksys-from-cisco/)

</comment></comment></comment></comment><comment><USER9> The OpenWRT wiki[1] is a great resource for this. There you can find a Buyers' Guide[2], as well a Table of Hardware[3] with compatibility tables for vendors, models and OpenWRT versions.

I recently flashed a TP-Link TL-WR1043ND with OpenWRT and it worked like a charm. I'm planning to flash it with the Pantou[4] OpenWRT distribution so I can start running OpenFlow with real hardware.

[1]: [http://wiki.openwrt.org/](http://wiki.openwrt.org/)

[2]: [http://wiki.openwrt.org/toh/buyerguide](http://wiki.openwrt.org/toh/buyerguide)

[3]: [http://wiki.openwrt.org/toh/start](http://wiki.openwrt.org/toh/start)

[4]: [http://archive.openflow.org/wk/index.php/Pantou_:_OpenFlow_1...](http://archive.openflow.org/wk/index.php/Pantou_:_OpenFlow_1.0_for_OpenWRT)

<comment><USER10> The TP-LINK TL-WDR3600 is the same price, but supports 5GHz as well.

<comment><USER11> Not only that, but the WDR3600 has a significantly faster CPU, more memory and more flash than the WR1043ND. It's about 2 years newer too. Definitely worth a few extra dollars.

</comment></comment></comment><comment><USER12> I usually use tp-link gear for openwrt, it's readily available from our distributor and dirt cheap. Don't just look for recent models, pick your hardware from the openwrt hardware compatibility list based on the specs you need.

If you can disregard the fact that the firmware isn't open source, have a look at www.ubnt.com and www.routerboard.com . Those don't run openwrt, but price/performance and features beat everything else that's on the market. The mikrotik routers are performing so well and have so many features it's ridiculous. If you really need Cisco, you'll know. If you're not sure, get a mikrotik, it will cover everything you'll ever need.

<comment><USER11> Agreed... You really cannot beat TP-Link for the money, and the vast majority (but not all!) of their routers are OpenWrt supported.

I buy literally thousands of them for work (we re-purpose them as network measurement devices, running OpenWrt), and the models we use are as follows:

* TL-WR741ND - 100M ports (can saturate the WAN link).

* TL-WDR3600 - 1G ports (LAN-WAN can hit around 500Mbps with careful tuning, but I don't know how that changes when NAT is enabled)

* TL-WDR4900 - 1G ports (LAN-WAN can hit around 900Mbps, and that's even without using the NAT co-processor, which OpenWrt doesn't support)

Ones I would avoid - WR1043ND (very popular, but old now - it was the precursor to the WDR3600), WDR3500 (100Mbps ports - yuck), WDR4300 (very little difference to the WDR3600, but more expensive)

The TL-WDR4900 really is blindingly quick, largely because it has a PPC CPU inside rather than the MIPS CPU, but it's also double the price of the 3600.

Unless you need the horsepower, the TL-WDR3600 really is the way forward.

I would avoid the 802.11ac models at the moment; they're more expensive, and there's no 802.11ac driver for OpenWrt yet, so you'd be wasting your money.

<comment><USER13> Seconded. I use the 3600 with Gargoyle OpenWrt (www.gargoyle-router.com, basically a web interface to OpenWrt) and it's been nothing but great.

</comment></comment></comment><comment><USER14> Jeff Atwood's write up : [http://www.codinghorror.com/blog/2012/06/because- everyone-st...](http://www.codinghorror.com/blog/2012/06/because-everyone- still-needs-a-router.html) is worth reading along these lines because he does a good job of explaining a process for surveying the market.

That said, if you are not too cost conscious you can build a wireless router out of the Intel NUC really easily, and for modest loads I've used a Beaglebone as an access point. So you may find you can cobble together the pieces in a fairly straight forward way. I do _not_ recommend a Raspberry Pi as a wireless router as its network is all going through the USB hub and as such it has a lot of latency spikes.

<comment><USER15> I don't see why QoS is such an important feature for a personal router. If he is (and I assume he is) the primary user of his network, then why is QoS control necessary?

<comment><USER14> The common response is voip, but it can also be video on demand. While Netflix will notch down from HD to SD to Artifact-D as the net congests it isn't pretty. If you have multiple users and some says "Hey look the Linux Mint iso is out, lets get both the 32 bit and 64 bit version." while you are watching a movie, its very annoying for both the movie watcher and the other person who says "WTF? 18 hours to complete, no way!" This way only one of you is disappointed.

<comment><USER16> What is Artifact-D?

(Yes, I tried googling it.)

<comment><USER17> It's probably a joke, implying that the Netflix video quality served during congested periods is so low that all you get is video artifacts.

</comment></comment></comment></comment></comment><comment><USER18> I've been using the Asus RT-N66U 'Black Knight' for well over a year with DD- WRT and have nothing but praise for it.

Dual-band N900, three detachable antennas, 256 MB RAM, rock solid stability.

[http://www.dd-wrt.com/wiki/index.php/Asus_RT-N66U](http://www.dd- wrt.com/wiki/index.php/Asus_RT-N66U)

[http://www.asus.com/Networking/RTN66U/](http://www.asus.com/Networking/RTN66U/)

<comment><USER19> I'll second that motion. I have not had a single issue with my RT-N66U and Tomato.

<comment><USER20> openWRT... another asus model. but yeah, after my research, asus is the best bang for the buck.

</comment></comment></comment><comment><USER21> If you are looking for the best, regardless of price, it is probably the ASUS RT-AC68U that was released recently. See the 9-page dd-wrt thread on it here: [http://www.dd- wrt.com/phpBB2/viewtopic.php?t=177612&sid=8bfd...](http://www.dd- wrt.com/phpBB2/viewtopic.php?t=177612&sid=8bfdc68ee0ac089e7783b8e19f0d4ea7) which shows a few issues here and there, but that is typical of newly released models. You did say you were looking for recent ones.

If you don't have 802.11ac-capable devices and just want a cheap solid dd-wrt box, I would suggest the Asus RT-N16 or RT-N66U. The thing to look for is the amount of ram in these things. An 8M router is going to suck at running dd- wrt. See the big huge table here:

[http://www.dd-wrt.com/wiki/index.php/Supported_Devices](http://www.dd- wrt.com/wiki/index.php/Supported_Devices)

And pay attention to the ram column.

<comment><USER22> I got an ASUS RT-N66U earlier this year and it really is an awesome piece of kit. +1 for Asus routers

<comment><USER23> ... except for the N56U. The only one NOT supported by the popular firmware alternatives. Guess who bought one :-)

There is code.google.com/p/rt-n56u/ but it's nowhere as good as my old Tomato.

</comment></comment></comment><comment><USER24> I've got pfSense[1] running on a passively cooled embedded board[2]. I then use whatever wireless APs I want in bridge mode.

I like this because x86 will always be compatible with anything I might run in the future, and changing out wireless hardware from 2.4 N to dual-band N to ac has been trivial and required no thought to compatibility.

      [1] http://www.pfsense.org/
      [2] http://www.jetwaycomputer.com/ITX-JBC362F36.html

<comment><USER7> One problem with a "customized distribution" is it probably gets far fewer security updates, much slower, of FreeBSD, than just using straight up main line "real" freebsd.

This kind of logic is why I use plain old Debian as the OS with roughly the same hardware architecture as your design.

<comment><USER24> While you're absolutely right, this is my home network, and not that big a deal. I'd guess that even outdated FreeBSD is way more secure than most consumer router firmware, which hopefully makes me a less appealing target.

</comment></comment></comment><comment><USER25> None of the above.

Run pfSense on an old x86 box and you'll end up with something an order of magnitude better. As far as an access point goes I'd suggest going with ubiquiti gear if it's in your budget.

<comment><USER26> There are huge disadvantages in using old x86 boxes, like size, noise, power consumption, lack of ethernet ports and so on.

If you wanted to sensibly advise using pfsense you could point at the zrouter project [http://zrouter.org/projects/zrouter/wiki/Supported_devices](http://zrouter.org/projects/zrouter/wiki/Supported_devices)

<comment><USER7> I do not think those disadvantages apply in most cases. Back when DSL was new I used an old 486 for many years, this is not new territory for me.

Size is irrelevant unless you're putting it in your entertainment center (why?) or live on a sailboat. Just stick it in the basement, stack on top of the fileserver, whatever. If you're doing the dorm room thing or living aboard a sailboat you have to realize that involves some highly unusual lifestyle compromises. For most people its not an issue.

Noise: I did splurge on some large slow fans (like $10) to replace old small fast (LOUD) fans. Again this is a lifestyle thing, where if your castle has no location further than 5 feet from your sleeping head, you're going to have serious lifestyle issues that most people simply will not have. I don't find my desktop at home or work to be particularly loud. I did at one time run a more modern desktop as a firewall and specifically ripped out the fancy graphic card and used the on board video, to reduce noise a little. After installation I never used the video or keyboard again, all SSH access, so its not like it needed fancy graphics. My main firewall/wifi/dhcp/asterisk/stuff/etc box is about 50 walking feet from my sleeping head, past the (sometimes) loud fridge, the dishwasher, the clothes dryer, the hot water heater... For most people its not going to be an issue.

Power consumption. Not an issue. I was drawing about 50 watts which will cost about $50 or about 3 weeks of cablemodem service per year. Using the EE tradition of it costs about $1 to provide 1 watt for one year. I admit I was an idiot and upgraded to a soekris box many years ago which is basically a 5 watt PC. So I save about $45 per year of damage to my finances and the environment. Great, that'll only take like ten years to pay off the capital expense / manufacturing environmental degradation. That was a dumb move on my part and I'd suggest you're always better off both financially and environmentally by reusing an old desktop.

Lack of ethernet ports (LOL, serious? Plug in another board?)

<comment><USER27> >Size is irrelevant unless you're putting it in your entertainment center (why?) or live on a sailboat.

No, it's not. If you're using *DSL (including FTTC) then how much space you have available depends on where your phone line enters your house, for instance.

My lines comes in, from a pole in the alley behind my house, to my kitchen and the master socket is by my kitchen door in the hall. I certainly don't have room for a large box there, but a typical router fits nicely.

</comment></comment></comment></comment><comment><USER28> ... and while we're at it: best alternative firmware? e.g. I liked DD-WRT, but they hadn't released version in ages - and e.g. use an exploitable version of the dropbear ssh server. I'm now using OpenWRT and am happy -- but I don't have enough time to really research.

<comment><USER12> I would say OpenWRT wins in this category. It's not based on open sourced Linksys firmware anymore, it's a embedded distribution designed from scratch for modularity and portability. It really is a awesome piece of engineering which is fun to use and well documented in detail. If you want to extend the features of the router and add things like openvpn, ntp server, traffic shaping, asterisk pbx, tftp server or whatever comes to mind, openwrt most probably has it packaged and ready to use.

</comment></comment><comment><USER29> I along with many others are waiting patiently for the new Alix gigabit board ~Q1 2014.

[http://www.pcengines.ch/apu.htm](http://www.pcengines.ch/apu.htm)

Passive cooling, 2-4GB RAM, AMD 1GHZ APU, 3 Gigabit ports, 2 MiniPCI cards for cell and wifi, Using 6-12W @ 12Volts.

</comment><comment><USER30> People tend to overlook Thin Clients. There is plenty of these available on Ebay, and they are mostly low-power x86 boards with one PCI slot. I am using a Maxspeed Maxterm (that's an 800 MHz VIA C3) and am very pleased with it.

<comment><USER31> Does it have more than one ethernet port on it? Otherwise, how can you use it as a router?

<comment><USER32> It has a built-in port, so you can always use a PCI Ethernet card to get two ports. You'll probably still need a switch, though.

</comment></comment></comment><comment><USER33> If anyone is interested in a travel router - small as a pack of cards, can be powered by USB, 3g dongle compatible - I recommend the tp-link mr3020/3040.

Do take care that it needs some configuring, because it has only one Ethernet port used as wan & LAN [1]

I had a slightly related question on how to set up a wireless-only setup for a startup. Hope someone has an answer to that - [https://news.ycombinator.com/item?id=6800737](https://news.ycombinator.com/item?id=6800737)

[1] [http://www.lambdacurry.com/2013/05/configuring-the-tplink- mr...](http://www.lambdacurry.com/2013/05/configuring-the-tplink-mr3020-with- dd-wrt-and-the-single-port-problem/)

</comment><comment><USER34> Latest tomato builds:

\- [http://at.prahec.com/](http://at.prahec.com/) \- [http://tomato.groov.pl/](http://tomato.groov.pl/)

<comment><USER35> Loved the tomato firmware. Bought a Netgear R6300 with the hopes that it would be supported. Looks like it will never happen. Regret that decision.

</comment></comment><comment><USER36> I would check out the edge router lite from ubiquity. It runs edgeos, a fork of vyatta. Based off debian and has lots of options. Dual core mips64 cpu, cavium network processors for ipv4,ipv6 and ipsec offloading. All this for $99 or less [http://amzn.to/1bBpdJ8](http://amzn.to/1bBpdJ8)

<comment><USER12> I have one of those sitting on my desk. It still feels a bit like early adaptor stuff, the edge router line is quite new, but looks very promising.

I really like vyatta, but now that vyatta is basically dead, I'm happy that it lives on in edgeos.

Don't be fooled by the GUI though, it's very incomplete, but the full feature set of vyatta/edgeos is there accessible in the CLI.

</comment></comment><comment><USER37> I'm a big fan of the WNDR3700, bought it on a whim a few years ago, the firmware it comes with sucks, but with *WRT it just works (I've got a V2, have a look at [http://wiki.openwrt.org/toh/netgear/wndr3700](http://wiki.openwrt.org/toh/netgear/wndr3700) for details about versions).

With a powered USB hub and an external disk drive and a webcam, it functions as remote backup via. rsync and monitoring my home when I'm on vacation, when enabled it takes pictures every 2 seconds when there's movement in the frame. The pictures are uploaded offsite immediately.

I'm using OpenWRT and have had very little problems, only issue I've noticed is that the wifi transfer speeds are a bit slower (10-30%) than when using the factory firmware, but I can live with that.

        21:47:12 up 221 days,  5:22,  load average: 0.00, 0.01, 0.04

</comment><comment><USER38> Personally,

-General device testing is well served at SmallNetBuilder (the octoBox test environment used now is awesome), though the stock FW is obviously tested more often than not

-Ubiquiti gear is indeed pretty rad

-Old Broadcom-based gear is still holding up well for low throughput use using Tomato + variants (.. or even DD-WRT)

-I would probably avoid 11ac models for now (unless you have a compelling reason not to).. but if you do decide to go that route, the BCM470(8/9)x SoCs are Cortex-A9 based [versus the single-core MIPS based BCM4706]

.. for a bit more data, a somewhat thorough overview of available hardware is available via the below WD query (in table form)..

[http://wikidevi.com/w/index.php?title=Special%3AAsk&q=%3Cq%3...](http://wikidevi.com/w/index.php?title=Special%3AAsk&q=%3Cq%3E%5B%5BThird+party+firmware+supported%3A%3AOpenWrt%5D%5D+OR+%5B%5BThird+party+firmware+supported%3A%3ADD- WRT%5D%5D+OR+%5B%5BThird+party+firmware+supported%3A%3A~Tomato*%5D%5D%3C%2Fq%3E+%5B%5BEmbedded+system+type%3A%3Awireless+router%5D%5D&po=%3FEmbedded+system+type%3DType%0D%0A%3FThird+party+firmware+supported%3DTPFirmware%0D%0A%3FFCC+ID%0D%0A%3FManuf%0D%0A%3FManuf+product+model%3DManuf.+mdl%0D%0A%3FCPU1+model%3DCPU1%0D%0A%3FCPU1+clock+speed%0D%0A%3FFLA1+amount%3DFLA1%0D%0A%3FRAM1+amount%3DRAM1%0D%0A%3FWI1+chip1+model%3DWI1+chip1%0D%0A%3FWI1+chip2+model%3DWI1+chip2%0D%0A%3FWI1+MIMO+config%3DWI1+MIMO%0D%0A%3FWI2+chip1+model%3DWI2+chip1%0D%0A%3FWI2+chip2+model%3DWI2+chip2%0D%0A%3FWI2+MIMO+config%3DWI2+MIMO%0D%0A%3FSupported+802dot11+protocols%3DPHY+modes%0D%0A%3FEstimated+year+of+release%3DEst.+year%0D%0A&eq=yes&p%5Bformat%5D=broadtable&sort_num=&order_num=ASC&p%5Blimit%5D=500&p%5Boffset%5D=&p%5Blink%5D=all&p%5Bsort%5D=&p%5Bheaders%5D=show&p%5Bmainlabel%5D=&p%5Bintro%5D=&p%5Boutro%5D=&p%5Bsearchlabel%5D=%E2%80%A6+further+results&p%5Bdefault%5D=&p%5Bclass%5D=sortable+wikitable+smwtable&eq=yes)

</comment><comment><USER39> I am running OpenWRT on a Buffalo WBMR-HP-G300H without any issues. This model has an integrated ADSL modem and has a few USB ports. I have a USB hard disk attached and I use it as a media and bittorrent server. Over LAN it can stream an HD movie from the disk, but over wifi it seems too slow for that.

<comment><USER40> I have the AirStation N600 Buffalo router.

It's kind of annyoing that it comes with DD-WRT preinstalled, but it's half- assed and is not configured for easy modification.

I have not taken the plunge yet, because I do not want to deal with jtag cables if it bricks, and the whole "install our binary, and then do not even breathe in the direction of the router for 10 minutes" part does not inspire much confidence...

<comment><USER41> I got one of these with the idea of installing OpenWRT. No problems at all.

Telnet into DD-WRT, then wget followed by mtd.

The console approach makes it clear what's happening.

[http://wiki.openwrt.org/toh/buffalo/wzr-600dhp](http://wiki.openwrt.org/toh/buffalo/wzr-600dhp)

</comment></comment></comment><comment><USER42> The Wirecutter does pretty extensive lists of "the best" electronic products/gadgets.

Here's their networking section: [http://thewirecutter.com/leaderboard/networking/](http://thewirecutter.com/leaderboard/networking/)

</comment><comment><USER43> For OpenWRT, if you'd like a Netgear R6300 do not get the v2. I've been told on OpenWRT's IRC just recently its not supported so you won't get usb, ethernet, wireless etc.,pretty much all that is vital. Whereas v1 is supported and said to have worked, it's not on the officially supported hardware list. There isn't much info on this model with regards to openwrt I'm afraid. In fact, I'm atm busy trying to build a custom fw for it myself & will update if I manage to get it working. (Though fyi, I can confirm DD-Wrt is working for this model)

</comment><comment><USER44> ASUS RT-N16

Its cheap, stable and un-brickable. So much so that there is a special tomato version dedicated to this model.[1]

[1] [http://www.easytomato.org/download](http://www.easytomato.org/download)

<comment><USER45> Still not supported properly in OpenWRT, all these years later. (yes, I've got one sitting on the shelf waiting for this purpose)

</comment></comment><comment><USER46> I've had success with the Netgear WNR3500L running DD-WRT. It doesn't have 5GHz but it does 2.4GHz great and on the cheap. The one I'm running now I bought refurbished for $35 and its rock solid stable and performs well.

Of course, its WiFi, so I'm already wishing I had AC so my portable devices were as fast as my wired desktop. But I don't think that will ever change. WiFi will probably never catch up to our ever increasing internet download speeds.

</comment><comment><USER47> been running various Tomato flavors w/VPN for many years, first on WRT54GL, now Asus RT-N16. currently run Toastman builds [1] but Shibby [2] is good too.

[1] [http://www.4shared.com/dir/v1BuINP3/Toastman_Builds.html#dir...](http://www.4shared.com/dir/v1BuINP3/Toastman_Builds.html#dir=zBnbpdpY)

[2] [http://tomato.groov.pl/download/K26RT-N/](http://tomato.groov.pl/download/K26RT-N/)

</comment><comment><USER48> I love DD WRT.

As for router models, development seems to be slow these days - I can only recommend the older Linksys routers, the Belkin F7D4301 and the many TPLinks (WR7-10xx series in particular)...

But any model that has a stable DD WRT release should be good - most important thing is the processor and Flash/RAM size in my opinion...

[http://www.dd-wrt.com/wiki/index.php/Supported_Devices](http://www.dd- wrt.com/wiki/index.php/Supported_Devices)

</comment><comment><USER49> ASUS RT-N66U is nice, didn't have a need for AC. I have that and an older Netgear WNR3500l (v1) running upstairs and down same SSID different channels. Tomato is my firmware of choice although ASUS with Merlin is pretty solid.

There were some pretty good router deal on Black Friday, be on the lookout for the ASUS on Cyber Monday I'd say.

</comment><comment><USER50> Other than price, can anyone give me a rundown of any benefits to this approach over an Airport Extreme? Other than ideological benefits. Do they perform better, or are there things I can't do with the Apple device? I'm not sure I want to deal with headaches here. Thanks.

<comment><USER51> I've done pretty extensive comparisons between one of the old Airport Extreme Dual Band units that look like a white Mac Mini and run some flavor of NetBSD and it performs slightly (~10%) better than both my old WRT54G and superior- specced WNDR3700 running DD-WRT builds. I still use the WNDR3700, not for performance, but for features and configurability. The APE basically just sits and serves a network disk.

</comment></comment><comment><USER52> The old Netgear WNDR3700 is one of the best because of very good 2.4 GHz range and lots of RAM.

<comment><USER53> I've had a bad impression with the v3 release. In the past year I've had two hardware failures and recently had an issue with the Netgear firmware causing upwards of 80% packet loss. Switching to DD-WRT fixed the packet loss issue. The v3+ routers also only have DD-WRT builds so far as I can tell, and switching to another firmware is damn near impossible once you switch to DD- WRT. That said, with DD-WRT it works and works well so long as the hardware doesn't fail.

</comment></comment><comment><USER54> The Asus N66u is highly regarded:

[http://thewirecutter.com/reviews/best-wi-fi-router-asus- rt-n...](http://thewirecutter.com/reviews/best-wi-fi-router-asus-rt-n66u/)

I have one myself but have not loaded Tomato on it yet.

</comment><comment><USER55> I've used DD-WRT before and it bothers me that their releases are seemingly far and few between. Even my commercial router with its original firmware got more updates than DD-WRT. Just some food for thought.

</comment><comment><USER26> Netgear lists their current models that they support for open firmware here [http://www.myopenrouter.com/](http://www.myopenrouter.com/) \- thats how I chose one.

</comment><comment><USER56> The ASUS RT-AC66U supports Tomato

You can find the firmware here: [http://tomato.groov.pl/download/K26RT- AC/](http://tomato.groov.pl/download/K26RT-AC/)

<comment><USER57> This Asus router scores a 95/100 from me. I ran a pfSense machine and separate AP for several years and bought this when the machine died. The RT-AC66U has been almost as solid and capable as the dedicated pfSense setup, without the extra power usage that comes with running an x86.

</comment></comment><comment><USER58> I am a bit surprised I only caught one mention of the Buffalo N600. I know it doesn't have AC, but it runs DD-WRT for all that I need and has full gigabit ports on the switch.

</comment><comment><USER59> I have a DLINK DIR-615. Cheap, easy to install (just flash via webinterface) and nearly unbrickable. Although not very powerful, i find it is a nice device to try out new stuff.

</comment><comment><USER60> I'm suprised no one has mentioned MikroTik.

Take a look at their RB750[1] which is about $40.

[1] [http://routerboard.com/RB750](http://routerboard.com/RB750)

<comment><USER20> because it is wired only, without gigabit ports.

</comment></comment><comment><USER61> I've been generally impressed with TP-Link's kit, although it is cheap, so don't expect it to hold up in a hostile environment (e.g. lots of dust).

</comment><comment><USER62> Carambola-2 with dev-board. No hassle, low price and compact.

[http://8devices.com/carambola-2](http://8devices.com/carambola-2)

</comment><comment><USER63> I recently bought a Linksys 1200. Works beautifully with DD-WRT. Or the Linksys 2500, if you want more power.

I can also recommend Netgear WNDR3700 if you want 5Ghz.</comment>


Ruby Trick Shots - <AUTHOR> http://rubyreloaded.com/trickshots/ <comment><USER2> One handy trick that I've found a lot of people don't know:

There's often the problem when working in IRB that you want to run a command that will produce a huge amount of output. For example, you might be reading a large file and assigning its value to a variable:

        s = File.read("largefile.txt")

This can take a long time, as you wait for Ruby to print the entire contents to the terminal. However, this can be avoided by using a semicolon and another statement:

        s = File.read("largefile.txt"); 0

Now the only thing printed out to the terminal will be 0, but s will still get the contents of largefile.txt.

<comment><USER3> > _However, this can be avoided by using a semicolon and another statement:_

Just a semicolon is sufficient, actually.

Also, importantly, it's not a statement, it's an expression (which is why you see the return value of your read to begin with).

<comment><USER4> A semicolon is not exactly sufficient-- it leaves the expression open, and thus unexecuted, until you close it. Try `puts 1;` vs. `puts 1;0`.

<comment><USER5> This confused the hell out of me when I came from MatLab to Ruby. I thought the semicolon was working like in MatLab to just suppress output. It wasn't... Many bugs ensued!

Having now watched the video, if someone had told me that '_' in irb was equivalent to 'ans' in MatLab, I would have been very happy.

<comment><USER6> Ohh, you're giving me ideas now. How great would it be to have a whole panoply of "[language a] for [language b] developers" videos or articles ;-) I know of a few but still..

</comment></comment></comment></comment></comment><comment><USER7> A couple tricks that are specific to MRI and probably not useful for everyday programming:

1\. Get the bytecode for some code:

        irb(main):001:0> x = RubyVM::InstructionSequence.new '1 + 1'
        => <RubyVM::InstructionSequence:<compiled>@<compiled>>
        irb(main):002:0> puts x.disasm
        == disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>></comment><comment>====
        0000 trace            1                                               (   1)
        0002 putobject        1
        0004 putobject        1
        0006 opt_plus         <ic:1>
        0008 leave
        => nil
        irb(main):003:0>

2\. Output parser states and debugging information:

        $ ruby -y -e'1 + 1'

(The output is long so I haven't pasted it. :-) )

<comment><USER3> With Rubinius, you can use the compile subcommand:

        $ bin/rbx compile -A -S -B -e '1 + 1'  # A(ST), S(exp), B(ytecode)

</comment></comment><comment><USER8> Any chance of a command-line session transcript instead?

I suspect there may be some interesting content here, but this is the kind of thing where I just hate screencasts. I can't skim it to see if these are things I already know or care to know, and even if they are it'll take me half an hour to get through, when I could probably read through the command-line session in 5 minutes.

<comment><USER6> When I do a video like this, usually someone does something like that within a few hours(!) but if not, I can do one. That said, it will all be on the Web eventually - the video was just to promote the effort (and put me on the line to finish it ;-))

As a list, though, it digs into: random numbers from a range, awesome_print, curious concatenation, fiddle, simple substring presence, spaces as string literal delimiters, multiple module inclusion, shorthand for ivar interpolation, ruby syntax checking, ruby syntax analysis with ripper, chained ifs, "next" as Proc's return, zipping arrays, exploding ranges into arrays, json output, __method__, multi line chaining, _ in irb, checking set bits, params defaulting to other params, Proc#source_location, prepending to a string in place, accessing the current source file as data, and some regex tricks.

</comment></comment><comment><USER9> Nice collection. The weird concatenation, I suspect, is a part of the grammar. It's frequently used in C code as well, when the format string is too long to fit in one line.

        printf("%d ... blah blah blah"
               "%f ...", 1, 1.2);

<comment><USER10> It actually works for string literals only, so you can't do a real concatenation there, with a variable for example. In C it's done at compile time, so you never actually concat those strings, the literals are merged. From what I see it's the same in ruby:

      irb(main):001:0> a = "avs"
      => "avs"
      irb(main):002:0> "sada" "sadasd"
      => "sadasadasd"
      irb(main):003:0> "sada" "sadasd" "sda"
      => "sadasadasdsda"
      irb(main):004:0> "sada" "sadasd" a
      SyntaxError: compile error
      (irb):4: syntax error, unexpected tIDENTIFIER, expecting $end
            from (irb):4
            from :0

</comment></comment><comment><USER11> Thanks for the video Peter, seems interesting.

Also seems mainly like a foot-shooting manual so far!

But it's certainly true that I didn't know a number of these behaviors!

<comment><USER12> _Also seems mainly like a foot-shooting manual so far!_

Could be, but a key value for examples of stuff you'd probably be better off not using very often is in learning _why_ things behave as they do.

</comment></comment><comment><USER13> The idea of Technical books on Kindle is not new. I have converted numerous Sitepoint PDF books to Kindle format and read them on the Kindle AND on my computer using the Kindle app for Mac. I loved the video and PROMISE to buy the Kindle book when it is available.

<comment><USER6> Yeah, I'm discovering that now, lol. My "research" consisted entirely of searching for "ruby" and going through the first few pages. They were nearly entirely Kindle versions of established print books. Turns out.. Amazon prefers to feature books that actually sell ;-)

I've since discovered some cheap indie Kindle programming books and even a whole range of cheap O'Reilly "What is *?" books. So it seems there's a market but IMHO not a very mature one, so I look forward to giving it a go. Thanks for the support!

</comment></comment><comment><USER14> For the array zip one @14:20, I'm surprised he didn't briefly mention that you can use unpacking in the block parameters:

        names = ['fred', 'bill']
        ages = [33, 40]
        locations = ['san francisco', 'dubai']

        names.zip(ages, locations) do |n, a, l|
          puts n
          puts "lives in " + l
          puts "is #{a} years old"
        end

</comment><comment><USER15> Awesome :-)

</comment><comment><USER16> FULL kudos to Peter Cooper for this.

Ruby is such an amazing and zany roadtrip of a language ... these few little gems have got me hungry for more. Its awfully addictive when you realise you can do so _much_ with so _little_.</comment>