Third Base – Ternary Notation (2001) - <AUTHOR> http://web.williams.edu/Mathematics/sjmiller/public_html/105Sp10/addcomments/Hayes_ThirdBase.htm <comment><USER2> In case you were wondering: "As in ordinary ternary numbers, the digits of a balanced ternary numeral are coefficients of powers of 3, but instead of coming from the set {0, 1, 2}, the digits are –1, 0 and 1."

e.g.

1 x 3^3 - 1 x 3^2 + 0 x 3^1 + 1 x 3^0,

Imagine, trits instead of bits. I like the idea of base e, if unrealistic.

(BTW: I have an old answer on Math.stackexchange that cheats by using base 3: [http://math.stackexchange.com/a/734723/108109](http://math.stackexchange.com/a/734723/108109) )

<comment><USER3> We'd all be more attuned to power laws if we thought in base 3. :-)

I like the -1, 0 and 1 concept, but is there any way to pull it off from an electrical engineering concept? Or would it all have to be overlayed as software?

<comment><USER4> [https://en.wikipedia.org/wiki/Ternary_computer](https://en.wikipedia.org/wiki/Ternary_computer) \-- it has been done before.

</comment></comment></comment><comment><USER5> There is a Texas Instruments 1962 patent for a tristable circuit (instead of a bistable flip-flop), using vacuum tubes, so it would be possible to build similar trinary computers in silicon. Though the same problem as with the old Russian Setun seems to remain: you need four transistors, which would ordinarily suffice for two binary bits, so any advantage is lost.

If you can design a tristable "flip-flop-flap" circuit with just three transistors, you might be in business!

[https://encrypted.google.com/patents/US3051907](https://encrypted.google.com/patents/US3051907)

<comment><USER6> Seems as if _one_ memristor can do it:

[http://spectrum.ieee.org/semiconductors/memory/sixstate- memr...](http://spectrum.ieee.org/semiconductors/memory/sixstate-memristor- opens-door-to-weird-computing)

</comment></comment><comment><USER7> While balanced ternary is nice in all sorts of ways, there's an argument against it being the most efficient representation. You might consider 2 better in practice in the sense that it makes it easier to pick the optimal amount of state space for a word when designing hardware.

On any practical architecture a word has some fixed length, N, and the vastly most efficient case will be when your number fits within that space. That is, it is more efficient if the number can be represented in r^N bits of state. The amount of state an architecture gives you is dictated by many different considerations but the radix that offers you most control (that is, most different possible values for r^N) is 2. For instance, say you want a word length that can store numbers up to 500, you have the options of

2^N: 2, 4, 8, 16, 32, 64, 128, 256

3^N: 3, 9, 27, 81, 243

So 2 gives you 8 choices for N whereas 3 gives you 5. So 2 gives you more design space to choose the most efficient representation in practice.

</comment><comment><USER8> I don't understand what is being optimized by minimizing the product rw. Reducing w reduces the number of digits, but how does reducing the radix r help with component count? Surely a memory cell that could store 1,000,000 different values in a base-1-million system is just one component, even if it is quite difficult to make. Are they talking about the components needed to perform calculations?

<comment><USER9> I'd say, your base-1-million system is virtually impossible to make...

But you are right: what counts is how much information you can store or process per square inch / per Watt, not really how many components you need to achieve this.

</comment></comment><comment><USER10> My favorite thing about "trits" is that they can directly encode the notion of "true / false / unknown". This is attractive because a lot of computer science (and type theory in particular) seems to gravitate toward constructivist / intuitionist logics.

</comment><comment><USER11> After reading about ternary number notation, it shouldn't be hard to solve one of my favorite brain teasers:

Given a simple balance scale with pans on both sides, how many weights does a merchant need to be able to weigh any whole number of grams from 1 to 40?

Most people have trouble getting the right answer, but its easy with balanced ternary. Try it!

<comment><USER6> This is actually explained in the article.

</comment></comment><comment> bit-player Please note: There's a PDF available at:

[http://bit-player.org/bph-publications/AmSci-2001-11-Hayes-t...](http://bit- player.org/bph-publications/AmSci-2001-11-Hayes-ternary.pdf)

</comment><comment><USER12> Someone I worked for a while ago would have summed this up as: "a cure for no known disease".

I know a little about CMOS transistor and logic design, but I'm certainly no expert. Still, I'm not seeing the advantages of ternary numbers. I'd be interested in hearing otherwise.

At today's geometries we have a hard enough time keeping _binary_ gates and memory cells working reliably. Ternary just doesn't seem to be practical. Perhaps with another supply voltage? E.g. +1.5, 0, -1.5? But today's CPUs very very aggressively vary supply voltage in order to conserve power. Now they'd have to fiddle with two voltages? Bah!

<comment><USER13> Ternary (or even higher n-ary) storage is already widely used: multi-level cell (MLC) SSDs store more than one bit per cell by using multiple voltages (most commonly 4, i.e. 2 bits per cell). I believe Ethernet also uses 3 voltage levels.

<comment><USER14> Communication systems in general routinely have up to 1024 modulation symbols (32 voltage levels for both the sin and cos carrier).

[http://en.wikipedia.org/wiki/Quadrature_amplitude_modulation...](http://en.wikipedia.org/wiki/Quadrature_amplitude_modulation#Quantized_QAM)

</comment></comment></comment><comment><USER15> Makes you wonder what a ternary - based, memsistor built functionally programmed CPU with 243 cores and roughly 4G of on board RAM would be like.</comment>


Hope this saves someone some time. - <AUTHOR> https://gist.github.com/garrettdreyfus/8153571

<comment><USER2> Why not compare the first character of the input to y or n (forced lower), or only allow one character of input like the instructions show.

<comment><AUTHOR> Updated it to your suggestion.

<comment><USER2> One more suggestion, make sure to test against lower case:

       reply = str(raw_input(question+' (y/n): ')).lower()

You could even add .strip() on there if you want to make sure it doesn't have leading spaces.

<comment><AUTHOR> Another good one, thanks.

</comment></comment></comment></comment><comment><USER3> Wouldn't everybody save much more time just using Common Lisp, and its already existing (y-or-n-p) function?</comment>


Folding Paper in Half (2015) - <AUTHOR> http://fermatslibrary.com/s/folding-paper-in-half <comment><USER2> The idea that you can only fold paper eight times in one direction rings absurdly false, since the problem screams of being obviously related to the thickness of the paper in relation to length.

An informal, physical/graphical proof that there is no upper limit given sufficient length is simply this. Imagine a piece of paper that has already been folded N times:

               </comment><comment>--\
              |         \
              |______    |
              /</comment><comment>`   |
              |          |
              \</comment><comment>---/

             ->|      |<- flat section

All you have to do is _add more material_ to the flat section, extending the length of each layer by an equal amount, and then you can fold it again:

               </comment><comment></comment><comment></comment><comment></comment><comment>\
              |                         \
              |_____________________     |
              /</comment><comment></comment><comment></comment><comment>---`    |
              |                          |
              \</comment><comment></comment><comment></comment><comment></comment><comment>-/

             ->|                      |<- flat section

You can add as much as you want. Suppose the above is an inch thick and we extend it to be a mile long.

I.e. don't approach this as a problem of the subdivision of a fixed length and width, but rather as the length being open-ended: we can go back and add more.

<comment><USER3> Is that really true? I mean the radius of the fold is going to mean the outside most layer is going to have to get larger and larger relative to the inner most layer. If it's 1 mile thick then the outer layer will need to be 3.14 miles longer than the inner layer. Won't that have some kind of effect? Is it all proportional or will the length of that difference eventually make it so the outer piece can't stretch/bend/flex over that great a distance (in reality vs magically friction-less paper)

<comment><USER2> Indeed, basically you're questioning whether this is literally folding _in half_. But I don't see that constraint anywhere. Just there have to be so many folds, and a flat section. So _in half_ is being used colloquially.

</comment></comment></comment><comment><USER4> I wonder why in the title this is a "mathematical" limit, not a physical one. Because there are formulas and calculations?

The formula expresses the folding limit based on the physical variable t (thickness).

Does the title confuse "Mathematical" with "Theoretical" limit?

<comment><USER2> The physical limit is actually more stringent because of the way materials behave under bending.

This is mathematical if we assume geometry to be subsumed under mathematics: it's a geometric problem involving stripes and arcs of stripes.

<comment><USER4> Don't want to nitpick, but the second part of the title says "how many times you can fold a piece of paper in half" not "geometric problem involving stripes and arcs of stripes".

I might think it's either a "Mathematical limit about the geometry of arcs of stripes" or "Theoretical/Physical limit of how many times ...".

<comment><USER2> That's true; of course the question can be a departure point into material science: what are the issues in bending a sheet of aluminum (or any other material) N times, or whatever, including the stretching and compression that takes place at the bends and so on. The context of it here being a pure geometric exercise is established early on.

</comment></comment></comment></comment><comment><USER5> Here's what happens if you ignore the mathematical limit and fold it again with a hydraulic press:

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

<comment><USER6> What's shown is not a "folding" action, which is reversible, but a "mixing" action.

The fabled Japanese sword steels are produced with a similar non-reversible mixing action, increasing the carbon content of the alloy each time.

<comment><USER7> Just because the hype around katanas is a pet peeve of mine: although Japanese swords are better known for this technique it's not exclusive to Japan by far. See [https://en.wikipedia.org/wiki/Pattern_welding](https://en.wikipedia.org/wiki/Pattern_welding)

</comment></comment></comment><comment><USER8> Current world record is 13 folds.

For 14 folds, the minimum according to the paper is 373x373 feet, for the 15 folds ("5-meter thick") – a bit over 1000x1000 feet.

</comment><comment><USER9> This is a great way to teach math. Model something that is interesting but only needs to rely on some basic principles (geometry, series and limits in this case). Best quote of the piece: "Britney found it interesting to realise that when we fold a piece of paper, we are actually finding a solution to a quadratic equation!"

<comment><USER10> You can even solve cubic equations with origami[1], which is what allows you to double a cube and trisect an angle by adding folding to the usual tools of compass and straightedge. (It's still not enough to square the circle.)

[1]: [http://math.stackexchange.com/questions/581958/solving- cubic...](http://math.stackexchange.com/questions/581958/solving-cubic- equations-with-origami)

</comment></comment><comment><USER11> This is beautiful work and a very nice paper, especially for an undergrad.

<comment><USER12> Note that she was not a university undergrad, but a grade-11 high school student, probably 16 or 17 years old. In the US, each year is a grade, and grade-12 is the final year of high school (which precedes university).

That only makes the work and paper more impressive, IMO. In my high school, our math teachers had very weak theoretical backgrounds. I suspect that Britney would have received less guidance in high school than would be available at university.</comment></comment>


Ask HN: Would you hire someone self trained from a MOOC? - <AUTHOR>

MOOC's are prevalent in today's media and certainly offer significant volume of quality content in certain fields (some computer science disciplines).  As an employer / manager, would you hire someone who was self taught using courses available through a MOOC?<p>If your answer is no, what is the main reason you would not be willing to hire them over a comparable person with a traditional bachelors degree? <comment><USER2> I would hire anyone regardless of the source of their training as long as they are capable of demonstrating proficiency, a firm grasp on the core concepts and a willingness and determination to learn.

<comment><AUTHOR> What metrics / standards would you use to vet a potential hire? (someone with no previous professional work experience). Personal work portfolio, strictly interview questions? The benefit of a degree is an implicit sign off from a reputable institution. How would you think about replicating that comfort for someone who is self taught?

<comment><USER2> I've done several approaches:

\- homework project

\- heavy interviewing with plenty of tests and several (3-6 people) giving written feedback on the candidate in the form of 5 points rating on lots of skills

\- hire on gut feeling

mixed in various amounts.

In my case, a diploma/certificate doesn't make me feel better. I've seen plenty of incompetents with a diploma, so I don't take it at face value. Testing worked best for me. A diploma/certificate also doesn't tell you anything about the candidate's work style/attitude. A hire with a bad attitude is much more toxic than a hire that lacks technical skills.</comment></comment></comment>


PG: Is this going down this year? - <AUTHOR> http://startupschool.org/??

<comment><AUTHOR> Related: [https://news.ycombinator.com/item?id=4442244](https://news.ycombinator.com/item?id=4442244)</comment>


The Opera Apps Hub - <AUTHOR> https://www.opera.com/pcappshub/ <comment><USER2> "Download applications from a trusted source" Oh, that's great. Except it's apparently none of that - Opera has discovered Yahoo catalog's Software section, cca 1998: "The software itself is downloaded from and offered by independent, third-party providers. By providing a link to software, Opera does not imply approval or endorsement of that software. The software is not investigated, monitored, or checked for accuracy, reliability, appropriateness, or completeness."

The large print giveth, the small print taketh away.</comment>


The ABC Programming Language: A Short Introduction - <AUTHOR> http://homepages.cwi.nl/~steven/abc/ <comment><AUTHOR> Python early days:

[http://python-history.blogspot.fr/2009/01/personal- history-p...](http://python-history.blogspot.fr/2009/01/personal-history- part-1-cwi.html)</comment>


Alexis Ohanian at Business of Software 2008 [video] - <AUTHOR> http://network.businessofsoftware.org/video/video/show?id=2352433%3AVideo%3A515

<comment><USER2> >The video is currently not available

I hate it when that happens. Is it just blocked in Taiwan or is it down?

</comment><comment><USER3> Man, Muffin gets around.</comment>


2013 was a lost year for tech - <AUTHOR> http://qz.com/161443/2013-was-a-lost-year-for-tech/

<comment><USER2> I feel like the "defining aspects" of a decade come halfway through. So the 80's to me really took place between 85-95, the 90's between 95-2005, and the naughts 05-15. I think we're closing up the current "themes" of the last decade, web 2.0, social media, mobile ubiquity etc.

There's also glimpses of what's going to define the teens, right now it seems like the augmented world might be a big theme. Things like Google Glass, VR like oculus, and maybe the beginning of drones and robots such as googles driverless car. Honestly though, the biggest things are still in labs. They're ideas who's time is tantalizingly close. I'd bet some really big things happened this year, maybe by people a part of this community, but they're not ready for the tech news to hype up or to shit on yet.

</comment><comment><USER3> "Not a single breakthrough product was unveiled"

Probably the most damning line in the piece. It was indeed a year marked by cryptocurrency mania, NSA scandals, and worst of all, mediocre tech. Anyone think 2014 is going to be any different?

<comment><AUTHOR> I think so. It seems like cryptocurrencies are getting to the point where they're being utilized (as opposed to being used mostly for speculation) in consumer-facing businesses.

The NSA stuff is concerning, but I get the impression that businesses are working on creating secure and trustless infrastructure.

</comment></comment><comment><USER4> Smells a little like link-bait.

</comment><comment><USER5> Bitcoin wouldn't have been listed by any major press as a breakthrough product/service the year it became public, either. Few were paying attention.

Let's hold off on the proclamations about 2013 being a dead year for breakthroughs. It's entirely plausible the biggest breakthrough for 2013 still isn't widely known. Some products require scale before it becomes overly apparent the dramatic impact they're going to have, and or before network effects take hold that said product may require to truly kick into another gear.

<comment><USER6> _Let 's hold off on the proclamations about 2013 being a dead year for breakthroughs._

The truth about technology is that "breakthroughs" are backed by a long, mostly invisible, period of hard work.

Has it been a "lost year" for technology? No, because millions of people have gone to work, built things, learned stuff, and there's a little more value in the world than there was before. Has it been a terrible year in terms of the high-profile idiocy that occurs, without fail, when the wrong sorts of people get into technology's upper echelons? Absolutely. But that's a cyclical phenomenon and doesn't really make the case for a year that has been completely wasted, any more than winter is a waste of time.</comment></comment>


Clojure Web Development with Ring - <AUTHOR> http://mmcgrana.github.com/2010/03/clojure-web-development-ring.html

<comment><AUTHOR> I mentioned this on another submission but Christophe Grand's Moustache routing library, <http://github.com/cgrand/moustache>, is great in conjunction with Ring. It makes very idiomatic use of destructuring to define routes, for example you can do stuff like the following:

      (def admin-post
         (app [""]        "admin post index"    ; /admin/post/ or /admin/post
              ["new"]     {:get new-post        ; GET  /admin/post/new
                           :post save-post}     ; POST /admin/post/new
              ["edit" id] {:get edit-post}))    ; GET  /admin/post/edit/:id

      (def admin
         (app [""]         "admin index"        ; /admin/ or /admin
              ["post" &]   admin-post
              ["posts"]    {:get all-posts}     ; /admin/posts
              ["settings"] {:get settings}))    ; /admin/settings

      (def main
         (app [""]          "index page"        ; /
              ["post" slug] {:get get-post}     ; /post/:slug
              ["admin" &]   admin))

</comment><comment><USER2> (loaded question alert)

What differentiates Ring from Compojure? What is the appropriate use case for Ring vs Compojure?

<comment><USER3> Ring is a lower-level library than Compojure. It provides a variety of common web-related utilities that will be needed by many Clojure web developers, regardless of what higher-level libraries they choose to use. The purpose of Ring is to prevent those utilities from being rewritten all over the place while also allowing custom utilities to be shared among Clojure web developers.

Note that Compojure 0.4 depends on Ring, to which it delegates things like parameter parsing and cookie manipulation.

If you're familiar with the Ruby web ecosystem: Ring : Compojure :: Rack : Sinatra.</comment></comment>


Ask HN: Good Sources of Coverage? - <AUTHOR>

Hey,
I recently launched a web-app (Streetread.com) which a lot of people here provided great feedback on (thanks again). Anyway, I'm continuing my effort to get good coverage and publicity for the site. I've gotten a few good ones, especially on Webware, but I'm having trouble getting covered elsewhere. Mashable, ReadWriteWeb, and the other review sites don't seem to take you seriously unless you're VC funded or your app is utterly pointless. The app is geared towards Wall Street and the financial community so I'm looking for sites either in this industry or in tech field. Any suggestions or tactics would be great.
Thanks <comment><USER2> 1\. A press release is great, a lot of people pick up on it and it gets indexed heavily by Google. Go to prLeap.com for the best prices.

2\. Go to adbrite.com and spend $5 a day on a run of network text ad or go into there directory and find sites with about 1000 to 5000 visitors and sign up for the CPM advertising. It will cost you about $.05 to $.25 a day per site. I use it, works good, and is a great price.

3\. Search for "web2.0 directory" on Google and submit to each one. I did that and from one submission I was blogged 60 times in a span of 2 weeks. I still get good traffic from that experience. Wish they were bigger blogs but the traffic overall combined is not bad.

4\. Google adwords is usable even on a small budget, I advertise on about 3 keywords and spend about $2 to $3 a day roughly. Just find some keywords where you can get into the top 3 for less then 35 cents a click. You will have to be a little creative but it is worth it. I find even if I am ad #7 it is still fine, not as good as being ad #1 through #3 but more affordable.</comment>


Duolingo Emailed My Wife with Her Password in the Subject Line - <AUTHOR> https://www.aaronm.net/duolingo-emailed-my-wife-with-her-password-in-the-subject/ <comment><USER2> Hi there, I'm an engineer on the Schools team at Duolingo and I remember looking into this a while back.

A couple of important things to note here:

1\. We do store all passwords hashed. We do not store plaintext passwords

2\. That spot in the subject line for the update is for the name of a classroom in the Schools product. When we investigated we realized this was just a case of user-error where they must have typed their password in as a classroom name when they created a class.

3\. I'm not positive if we ever responded to the report... I'm trying to find the thread. If we didn't respond, that's my fault and I'm very sorry. Not a great user experience to think your password is stored in plaintext!

I'm trying to find the email thread where I first encountered this so that I can understand more thoroughly what's going on.

UPDATE: The discussion we had internally was a slack conversation, not an email. I verified that one of the user's classroom names appears to be something someone would use for a password. Once we determined there wasn't a security issue, I didn't ask for the reporter's contact info or anything like that. I'm really sorry to Arron and his wife for the poor service & bad customer experience.

<comment><USER3> Good to hear, and we know stuff happens and falls through the cracks.

Upon discussing it with my wife, user error did come up—should have had that discussion again before writing the post (adding an update, now).

 _wipes egg off face_

<comment><USER4> Yes - thoroughly researching the issue is extremely important before accusations, even a 'refactored' one like yours has a lasting impact on organisations.

If you go to the Duolingo Schools website or account profile, you will notice the classroom name at the top, clearly listed - this should have quelled any plaintext suspicions.

[https://schools.duolingo.com](https://schools.duolingo.com)

</comment></comment></comment><comment><USER5> If you think this is bad... here are the emails I got from Robinhood after I had to contact them for my statements (since the app wasn't loading them):

> Robinhood: For security purposes, we'll need you to verify the following: > Your username, the last 4 digits of your SSN, and your DOB.

> Me: (reluctantly sent them the info, because what else could I do)

> Robinhood: Attached is your requested document. For security purposes, we've > encrypted it and set the password to the last 7 digits of your SSN.

 _(In case you don 't know, SSNs are only 9 digits, and the first 3 digits are known based on the location of either where you were born, or where you got the number -- I forget which. I recall the following 2 are also predictable, though I forget exactly how. In other words: they are not hard to guess. And don't forget the whole thing is 9 digits. Meaning it'd take less than a minute [if even a second] for anyone with a copy of my statement to crack it AND extract my SSN from it.)_

> Me: (Sends them an email lecture telling them exactly why everything so far > has been extremely alarming.)

> Robinhood: Robinhood Financial is a member of the Financial Industry > Regulatory Authority (FINRA) and the Securities Investor Protection > Corporation (SIPC). We take the security of our members' private information > very seriously. Robinhood uses bank-level security measures to protect your > personal information. Your _password_ , _social security number_ , and > _other sensitive data are encrypted_. Our mobile and web applications > communicate securely using SSL and 256-bit encryption.

 _(emphasis mine)_

Oh, and to top it off, it turned out they had _forgotten to actually encrypt the document with my SSN_ like they had claimed to. In other words they aren't even following their own security policies. Which I'm not sure whether to classify as a good thing or a bad thing given what their policies were.

<comment><USER6> And dont forget, robinhood is a b$ company now...

</comment></comment><comment><USER7> I'm inclined to trust in the intentions and competence of the people at Duolingo because I've worked with them before, so with that disclaimer:

Is it possible that this person accidentally mixed up the username and password fields when editing their own account? Or, some type of browser auto- fill mixup put the password in the username field when editing the account?

<comment><USER8> It feels like in both places that's the location of the username. Forget having passwords in plain text, for what reason would passwords be prominently displayed?

</comment></comment><comment><USER9> Question: Is it possible she simply typed her password into the wrong field when registering for the account? It seems like all of the fields would be an appropriate place for the name of, for example, an organization.

<comment><USER3> Yes, it is possible, the complete silence from Duolingo is as much a frustration as anything.

</comment></comment><comment><USER10> I spent night and day wasting my time away trying to make sure my apps are secure enough. I am never satisfied and it wears me down.

"I need to change my random token generator to use the one that comes with openssl, but then I'll have to rework a huge part of my application. Eff it, I'm doing it. "

Mean while Duolingo just saves the password in the database and gets on with it.

<comment><USER11> Something new to add to your checklist: "I need extra logic that prevents people from accidentally entering their passwords into every other profile field, otherwise it'll show up in emails and I'll get accused of saving plaintext passwords in a widely distributed blog post."

</comment></comment><comment><USER12> One for [http://plaintextoffenders.com/](http://plaintextoffenders.com/)

<comment><USER13> I realize this site is referring to password storage but it is itself a plaintext offender in that it doesn't support https.

<comment><USER14> Why does everything need to be https? Are you worried someone might find out what kinda lols your into?

<comment><USER15> Yes, everything does need to be HTTPS. If not for user privacy then for response integrity - to be sure the response hasn't been MITMed.

You might think most sites are innocuous, but it depends on where you live. I could see this site getting classified as "hacking/encryption-related" by something like sonicwall's firewall (HN too). What if your government tasks your ISP to round up all those trying to bypass state firewalls? Heck I live in a western country where our government is misguidedly angling to ban encryption. For the minimal effort involved, I believe all sites should be https.

</comment></comment></comment></comment><comment><USER16> Citicem journalism at its best: making false accusations and finding a way to still blame it on the victim.</comment>


LiteCoin is Causing Shortages of AMD Radeon GPUs - <AUTHOR> http://www.brightsideofnews.com/news/2013/12/9/cryptocurrencies-are-causing-shortages-of-amd-radeon-gpus.aspx <comment><USER2> That's no joke. I was trying like crazy to get in on one of the deals over "Cyber Week", and the deals that would pop up would literally be sold out within 2 minutes of appearing. I read a few threads in FatWallet and Slickdeals in which people said things to the effect of "Damn Litecoin miners! Some of us want to play games with these!"

Shortly thereafter I came to the realization that, if this many people are jumping into the Litecoin pool, mining Litecoins is going to get a lot harder very quickly, so I stopped bothering to look.

<comment><USER3> Smart cryptominers don't mine Litecoins. They mine the most profitable coin at the moment, then sell it and convert it to LTC (assuming they believe in LTC).

</comment></comment><comment><USER4> Truth! I have a co-worker who had to jump on getting 2 of them from Newegg. They're nearly impossible to buy now unless you catch a 40% markup on ebay or something. I'm very sorry for all the gamers out there. This isn't fair to them. :( . I just purchased my LTC with good ol' USD. Besides Bitcoin, we both are betting that Litecoin will "go up to da moon!". Specifically, I expect LTC to reach $900 by end of 2014. I have no data whatsoever to back that up with other than the Litecoin-related announcements I sometimes see on various forums of small businesses accepting LTC along with BTC. I'm already holding some[1] and will probably buy a few more if I see another price drop.

1\. [http://ltc.block- explorer.com/address/LYmsP841obKKt9jkapj8iK...](http://ltc.block- explorer.com/address/LYmsP841obKKt9jkapj8iK4ohQyEXrk6AG)

<comment><USER5> What can you use LTC for?

Thats right, nothing but hope.

<comment><USER6> You can sell them for bitcoins ;)

There are even mining pools such as middlecoin that shift from one scrypt- based alt coin to another depending on what is easiest to mine and sell on exchanges for BTC. As a miner, you don't have to lift a finger, just point cgminer at the pool's address and supply a BTC address for payouts, the pool operator takes care of the rest.

Some smaller altcoins (such as stablecoin) have had to make changes to their difficulty calculations because these pools, with relatively massive amounts of hashing power, come in, push up a coin's difficulty and then leave again once it's no longer profitable. Sitting on the sidelines, it's been really interesting to watch.

</comment></comment></comment><comment><USER7> This is a cool side effect of GPU mining, this is all commodity hardware. In a year or less miners will need to upgrade their GPUs and will be selling their old GPUs. Gamers can then buy them up for cheap. With ASIC Bitcoin miners the hardware is useless once it becomes inefficient to mine on it.

<comment><USER8> It's going to be an interesting hiccup in bitcoin when we eventually have to migrate off of SHA256 and suddenly existing ASICs become irrelevant.

</comment></comment><comment><USER9> Hopefully nobody figures out how to ASIC Litecoin. If it stays on general purpose hardware for a few years, we will have a huge network of processing power ready to be harnessed.

If someone makes Litecoin ASICs, we will have a huge network of space heaters.

<comment><USER10> GPU mining is still not as decentralized, as basically only high-end PC gamers (with their own default cards) and the people specifically buying GPUs for mining will have a shot at it.

CPU-only mining would be a lot more decentralized, if such a thing is even possible.

<comment><USER11> ProtoShares (and a few other coins, I believe) focus as much on being memory- hard as CPU-hard. While CPU/GPU can be "cheated" by designing ASICs, there's no such thing as application-specific memory, making it a better candidate for an honest signal. [1]

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

<comment><USER12> Won't that just lead to people making machines with giant racks of RAM, causing the exact same difficulty race as we're seeing with the giant racks of ASCIs in Bitcoin?

And even if that's not the optimization (I'm not an expert on ProtoShares or memory-constrained algorithms), I am highly skeptical of anyone claiming a computation problem is optimally solved by a laptop, and cannot be optimized with custom engineering.

<comment><USER9> Giant racks of RAM could be useful. Once someone's rig is no longer profitable for mining, they could turn around and open a MongoDB hosting service.

</comment></comment></comment></comment></comment><comment><USER13> Thus demonstrating the sheer idiocy of crypto-currencies -- they burn real resources on what is essentially bookkeeping.

<comment><USER4> Keep in mind that the mining won't last forever. Bitcoin mining has already become all but unreachable[1] for normal household resources. Litecoin's blockchain is still new enough that it hasn't reached that point yet. Just like BTC, LTC was first just CPU, now it's GPU, then ASIC will show up then finally it'll just be pools for 0.00003 LTC a week or you'll need a freakin' Pixar+Dreamworks+ILM SuperPowered-RenderFarm or something that no ordinary person can reasonably afford access to.

1\. [http://www.ibtimes.com/secret-bitcoin-mine-chinese- facility-...](http://www.ibtimes.com/secret-bitcoin-mine-chinese-facility- uses-boiling-liquid-cool-massive-computers-generate-bitcoins)

<comment><USER14> Doesnt the bitcoin network need mining to work? As far as I understand it, mining needs to be done forever, even if its impossible to collect new coins.

<comment><USER4> I don't think it does. Bitcoin can be split to the eighth decimal place, IIRC. If bitcoins become hard to get, the price should go up, then needing one whole btc to buy something should get less common. Or maybe you're right and years from now it'll all collapse and some other improved crypto-coin will have to take its place. I guess we'll find out, because there is a hard-limit on how many btcs can be obtained(21 million to be exact) by mining, so when that runs out...

<comment><USER15> Mining is fundamental to the operation of bitcoin. "Mining" just means finding a satisfactory hash for the next block of transactions.

People pursue mining because of the rewards built into bitcoin, transaction fees are supposed to eventually replace that reward.

</comment></comment></comment></comment></comment><comment><USER16> could an alt-coin be based on socially useful computation, e.g. folding@home?

<comment><USER17> As long as the work is hard to compute but quick to verify, sure. But you're probably going to run into the problem of having one central entity providing work units.

<comment><USER18> That's not right. It must be hard to produce, easy to verify, and be deterministically linked to the previous POW. That last feature is critical.

<comment><USER19> Hash the folded protein with the previous POW. Problem solved, no?

(I think the important thing is that you have to prove you didn't start the current pow until the previous work unit is done, right? Fortunately, there are lots of proteins to be folded. You can use the previous pow to select the parameters for the next pow. The hashes are uniformly distributed, so that will eventually range over the set of proteins.)

<comment><USER18> Not at all. What's stopping me from hashing the result with something else? The base of the work must be in changeable. That's the whole point of POW in this case. If you want to rewrite history you need to do the POW again, in your system that doesn't need to happen.

</comment></comment></comment></comment></comment><comment><USER20> Fascinating. Slighty related: I've stumbled over Primecoin¹ while researching Litcoin mining. Primecoin uses prime chains as proof of work. Existing GPU implementations are slower than modern processors and I'm not sure about the feasability of FPGAs and ASICS. It's an interesting idea.

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

<comment><USER21> Apparently it didn't gain much traction here. [http://news.ycombinator.com/item?id=6011094](http://news.ycombinator.com/item?id=6011094)

</comment></comment><comment><USER22> That's the same in EU - amazon.co.uk shows 1-3 months delivery for R9 280X and in Poland the arrival date of new batch was already moved twice in the last 3 weeks. 3 weeks ago I placed an order fo R9 280X, the LTC difficulty is now 2x of what it was then. I think I will soon be cancelling the order as LTC price falls and the break even point is ca. 2 months instead of 1 month.

</comment><comment><USER23> Why is AMD Radeon GPUs more efficient to mine LiteCoins than Nvidia GPUs?

<comment><USER24> It has to do with the amount of power usage and the return rate or mine rate of LTC/BTC. AMD seems to have a better ratio of coin per wattage. So basically just better bang for the buck.

<comment><USER25> Bang for the buck = efficiency, so you just answered the question "Why is it more efficient?" with, "Because it is more efficient."

The reason, more or less, is that AMD GPUs tend to have way more cores than Nvidia GPUs, and their cores can, in hardware, do the integer operation necessary for the hashing algorithm. Nvidia can only emulate the integer operation, so it takes three instructions on Nvidia vs one on AMD.

<comment><USER24> You're right. I wasn't aware of the specific technical reasons only knew the power wattage difference.

</comment></comment></comment></comment><comment><USER26> Can confirm, working in hardware marketing in Europe, many retailers and AIB manufacturers are talking about Litecoin causing stock issues (and/or sales peaks, depending on which side they're looking at it from). Have even seen a major systems manufacturer I work with change up the GPUs in their SKUs based on availability issues.

</comment><comment><USER27> This AMD GPU shortage isn't quite so terrible. I have a pair of AMD 5850s that I've been offered $250 each for. Never imagined those kinds of returns on 4 years old graphics hardware.

I wonder if the demand for altcoin mining cards will end up becoming so great that Nvidia will modify their architecture to better facilitate it.

<comment><USER28> Alternatively, you could try mining yourself if you're curious and want to learn about cryptocurrencies. I wrote a guide on how to get started with mining in <10 minutes (mostly for friends with gaming PCs), for some of my friends who were interested.

[http://edjiang.com/post/69758178501/mining-altcoins-for- fun-...](http://edjiang.com/post/69758178501/mining-altcoins-for-fun-and- profit)

</comment></comment><comment><USER29> From selling my 7950s earlier in the week on eBay UK, the going rate appears to be around 35% more than normal (Amazon) retail price. It's quite amusing, although I do feel for those caught in the CrossFire™ (sorry), who simply want a card to play video games.

</comment><comment><USER30> Clearly, this is in no way related to the busiest shopping period of the year.

I'm sure there is some increased demand from cryptocoin mining, but really its pretty myopic if you think even half of the Nov/Dec demand for GPUs is going that way.

</comment><comment><USER31> Took me about a week to find 2 of them on newegg. If you check newegg daily, you can probably find a couple here and there. You can possibly even find a name brand one.

</comment><comment><USER32> Could AMD be using a significant amount of capacity for the new Mac Pro GPU's?

<comment><USER33> Mac Pros probably don't sell in the numbers that the Apple laptops, iPads, or iPhones sell.

But it is entirely possible that Apple feels the shortage of AMD GPUs right now, which could be one of the causes for the Mac Pro not being available.

</comment></comment><comment><USER34> Meanwhile,

I still can't mine ltc on my mac.

EDIT: Both Asteroid and MacMiner don't work for me.

<comment><USER11> It takes a little effort to compile yourself, but you absolutely can. [https://github.com/pooler/cpuminer](https://github.com/pooler/cpuminer)

</comment></comment><comment><USER35> I see R9 290x on Amazon Prime...</comment>


Why is nytimes.com allowed on HN? - <AUTHOR>

Every day I see several posts for nytimes, and often they're not really HN material. But whats worse is that every article requires a subscription.<p>Why are non-free articles getting posted that most people wont be able to read? Or is it just something against me or firefox? <comment><USER2> [https://news.ycombinator.com/newsguidelines.html](https://news.ycombinator.com/newsguidelines.html)

> _" Please don't post on HN to ask or tell us something (e.g. to ask us > questions about Y Combinator, or to ask or complain about moderation). If > you want to say something to us, please send it to firstname.lastname@example.com."_

With the above said, if you put in some effort, then you'll learn that you can read as many NYTimes articles as you want without a subscription.

</comment><comment><USER3> Banning paywalled links would make HN worse, and there are easy workarounds for most paywalls.

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

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

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

</comment><comment><USER4> There is no bias towards specific domains on HN, but it is required that users post intellectually stimulating resources. A lot of nytimes posts are actually really well written and have new information in there, and so it's not frowned upon.

If the article requires a subscription - I am sure there is shared accounts knocking around somewhere to circumvent this...In the true hacker way</comment>


The Killings Continue At Google: Aardvark Put Down - <AUTHOR> http://techcrunch.com/2011/09/02/google-kills-aardvark/

<comment><USER2> Aardvark was truly great when it first started. I was an early adopter, got the t-shirt, and received and shared a lot of great information. It's sad to see it go, but I checked out a long time ago. Maybe it was a question of incentives, but at a certain point the whole thing tipped and after that point nearly every answer I got was some combination of poorly punctuated, flippant, ignorant, or willfully spiteful. At the same time the question pool became very thin, and I started receiving a half-dozen let-google-that-for-you queries a day.

Really neat t-shirt, though.

</comment><comment><USER3> "Over this time, we learned a lot about creating and maintaining online communities, and how to facilitate sharing of knowledge between people."

Except, you know, the whole 'real name' debacle.

<comment><USER4> Nothing good is going to come out of Google's obsession with "social".

It's a fool's errand that may end up costing them the company. If they succeed, they become what, fuckbook with coupons? And move on to organizing the world's stupidity into neat little crap piles, perhaps.

Way for allegedly smart guys to microsoft themselves.

</comment></comment><comment><USER5> Aardvark has never been totally awesome to the point where I would use it to ask questions myself, but it has done a really good job sending me IM's asking me questions that are really relevant to things I'm reasonably well read on.

I think it was a really neat idea, kinda sad to see it go, even though it's kind of been a wasteland since the acquisition. Which I guess is what the Google acquisitions mostly have been lately, "talent acquisitions" rather than "we want to get into this business" acquisitions.

</comment><comment><USER6> We use some Google tools where I work. I'm always afraid the Goog will lose interest and send us scrambling to find some other way to do what we're doing.

</comment><comment><USER7> Google is really impressing. I never expected such a great company can change their direction so fast and drastically as Google does since they have their Wartime CEO making the decisions.

</comment><comment><USER8> When Google+ first came out, there was code that seemed to imply an upcoming "Google Questions". I was assuming it would be based on Aardvark ... apparently not.</comment>


Go bindings to Rust's regex engine - <AUTHOR> https://github.com/BurntSushi/rure-go <comment><USER3> This right here is why I think Rust really stands out from other languages. You can call it from other languages just as you can call native code written in C. It's not married to a complex runtime system.

Most other languages are "dead ends", because code written in them is not easily reusable from other languages.

<comment><USER4> It's easy to call any code from any language - all you need is the power of HTTP and micro services! ;)

<comment><USER5> Microservices don't help polyglots make regexes faster. If you're sticking a 100ns operation behind an endpoint with JSON serialization/deserialization, network round-trip, etc., then I'm not sure what to say to that.

<comment><USER6> Actually this microservices approach has existed for decades in erlang/otp and can maintain quite excellent speed. You're not going to beat raw c speed-wise, but typically you will beat comparable dynamic languages -- and you don't have to worry about decoding/encoding json or any of that bs. I'd personally be absolutely thrilled if something like genserver and some other otp protocols were ported to other dynamic languages -- but alas real processes aren't nearly efficient enough.

<comment><USER7> You can also delegate to C with Erlang via NIFs

<comment><USER8> Then there's [https://github.com/hansihe/Rustler](https://github.com/hansihe/Rustler)

<comment><USER7> Yes, that's been on my (long) list of things to check out.

</comment></comment></comment></comment></comment></comment></comment><comment><USER9> We're interested in how the Hyperscan library (full disclosure: I am an Intel employee and Hyperscan designer) stacks up in this comparison. From what I understand there are Go and Rust bindings for Hyperscan out there as 3rd party projects (although I don't know much about them).

We find Rust intriguing and the fine-grained control would be a good match for what our run-time needs; it would be a interesting project to re-implement parts of Hyperscan in Rust.

<comment><AUTHOR> I'm interested too. I'm looking into adding hyperscan to Rust's benchmark harness (which already has PCRE1, PCRE2, RE2, Tcl and Oniguruma). I'm trying to figure out how best to wrap the API. The callback function in `hs_scan` is something I haven't seen in a regex library before (although I bet I can understand why it's used), but for example, Rust's wrapper cripples the callback in comparison to C by dropping the `void *context` parameter: [http://flier.github.io/rust- hyperscan/doc/hyperscan/type.Mat...](http://flier.github.io/rust- hyperscan/doc/hyperscan/type.MatchEventCallback.html)

I'm happy to wrap the C directly (in fact, that's what I've done for most of the other regex engines I benchmark against). Before I try to wrangle the callback-style API, is there an alternate API with a more explicit iterator- like interface?

<comment><USER9> Thanks for looking into this; we like to see benchmarks run by other people to avoid the prospect that we're just benchmarking the things we already know about and like doing (which are often also the things which we've optimized).

There are no other interfaces outside of the callback API. It's an interesting prospect to have an iterator-like API but a naive implementation of an iterator API would involve us having to save out all of our state somehow (in an explicit fashion, as opposed to a bunch of stack frames). Our system is pretty complex and so it's not just a case of saving out a couple DFA states...

<comment><AUTHOR> I've done a _tiny_ bit of hacking around on the command line. I'm essentially comparing your `simplegrep` utility with my own utility that operates similarly using `time`.

The first thing I noticed was that hyperscan wasn't lining up with match counts from the rest of the regex engines. I dug into your docs a bit more, and indeed, your engine reports _all_ matches, whereas traditionally, most regex engines offer an iterator over successive non-overlapping leftmost-first matches (including start+end). Of course, that's not to say you're wrong or anything---it's just going to be a real bear to accurately benchmark them.

All in all, hyperscan looks pretty fast. Some of your docs suggest you're doing even smarter literal detection than I am. Prefix literals and literals "near the front" are easy enough to figure out (the latter is on my list of things to do), but literals at the end or middle of a regex seem much trickier. In particular, it seems very easy to fall into worst case quadratic behavior. If you felt like expanding on some implementation details there, that would be awesome. :-)

In any case, I'll share some timings. I ran all of the following regexes on a ~2GB file containing a concatenation of some large sample of Project Gutenberg. It's my goto for "feeling" out regexes and collecting large samples for profiling. I modified simplegrep.c to not print every match and instead increment a single static `count`. I also modified it to mmap the file, so that it is comparable to my utility in Rust which also mmaps the file. The count of total matches is printed at the end. I tried to limit the regexes to ones that had the same number of matches in all regex engines, but on some of them, hyperscan reported slightly more. I then modified simplegrep.c to use the HS_FLAG_SOM_LEFTMOST flag. I did this because that's what Rust's regex engine does (and so do most others). Thus, the benchmark is flawed. But knowing this...

Benchmarks are reported in seconds. I tried to take the best of 3 where appropriate, but overall, I saw very little variation run to run.

        pattern                          rust   pcre2-jit   hs     hs-start-end
        \w+\s+Holmes                     4.4    17.0        0.5    3.4
        [1]                              4.4     4.0        0.5    0.5
        (?i)Sherlock|Holmes|Watson       4.6     7.5        0.5    0.5
        Sher[a-z]+|Hol[a-z]+             0.9     0.6        0.6    0.6
        (?i)Sher[a-z]+|Hol[a-z]+         4.6     7.0        0.6    0.7
        [2]                              0.9     2.0        0.5    0.5
        [3]                              1.0     ---        0.5    0.5
        [a-zA-Z]+ing                     5.1     7.2        1.3    2.2
        \s[a-zA-Z]{0,12}ing\s            4.9    20.0        1.6    2.6
        \w{7}\s\w{7}                     5.0    32.6        7.0    7.1
        [0-9]+[a-z]+[0-9]+[a-z]+[0-9]+   2.1     2.1        0.5    0.5

        [1] Sherlock|Holmes|Watson|Irene|Adler|John|Baker
        [2] Holmes.{0,25}Watson|Watson.{0,25}Holmes
        [3] Holmes(?:\s*.+\s*){0,10}Watson|Watson(?:\s*.+\s*){0,10}Holmes

That's a pretty impressive showing! I'll have to learn your secrets. :-)

<comment><USER9> Your observation about match counts and "all-matches" vs "leftmost-longest" or "pcre-locally-maximizing" semantics is accurate and Hyperscan is meant to be that way. All-matches is the only semantics we can implement efficiently when you take into account streaming and multiple regex matching. Block mode scans of single regexes are something we like to do well at but they are not our primary use case; more typical is hundreds of regexes in streaming mode. Similarly, accurate Start of Match (SoM) tracking is a pain. This is a work in progress. You can see the hit we are taking for it (perhaps unnecessarily given the SoM cases don't look like the hardest SoM calculations we have to do). This will improve but SoM is typically hard for us (given the streaming and multi-pattern requirements).

<comment><USER9> As for our secrets - they are not really secrets; anyone who wants to learn them can simply read our code. I will outline the literal discovery approach, though, as I'm inordinately proud of it (possibly for the wrong reasons):

We find 'factor' literals in a NFA Graph (a Glushkov automata embedded in a BGL graph; Glushkov automata are both our internal intermediate representation of regexes and an occasional implementation strategy) as follows: we explore the local neighborhood of a graph node and calculate 'if I wanted to cut the graph here, which literal strings would I need to see'. For example, if we have paths "abc" and "def" to a node, we would give this a score corresponding to "2 3-character literals" (pretty good). On the other hand, we could have a single path "abcdefghij" to the node (which would be a really good score - <USER2> low score) or we could have multiple short literals (say, corresponding to the expansion of \d - 10 1-character literals - really bad - a high score). If we can't find anything reasonable at all the score is effectively infinite. This allows us to score each edge in the graph. We then wire up our graph to a source and sink (at the start and end of the pattern) and do network flow and grab a min-cut. More or less - there are some wrinkles, but that's basically it.

This may or may not be the world's best idea, but I had hankered to find some weird use of netflow ever since a Graph Theory class in 1991, where a professor of mathematics showed us an algorithm to solve the stable marriages problem by reducing it to network flow. This was made more memorable by the fact that he, probably unintentionally, posited a slightly obscene formulation: all the boys were wired to a mysterious 'source', the girls to a mysterious 'sink', and some unknown substance flowed from the former group to the latter (!).

The min-cut trick has its problems, as it does things like scoring a graph where we cut with 5 different copies of the same literal "abc" as if they were distinct literals (having thrown away the way the scores were found when we do min-cut, which just treats the scores as a magic floating point number). But it's been fairly practical. Someone with a better grasp of abstract algebra and graph theory would be welcome to come along and tell us whether the thing that implements our score in min-cut could be more complex (some sort of class that cleverly tracks some or all of the 'sums of literals' and implements operations like + and min) and still allow the min-cut algorithms to work.

Cutting is also more complex for us given the fact that a 'late' cut isn't nearly as good for us as an 'early' cut if we are streaming, as the leftover bits of an NFA graph on the left of such a cut need to be evaluated all the time in streaming mode, while this isn't true to of the parts on the right of a cut. So in practice we don't really do the netflow algorithm in the pure form above (at least, not since version 2.something) but it still gets used. The fact that we are actually decomposing our problem also means that some cuts are better than others to leave a 'clean' set of engines also messes things up.

We'd love help working on this problem (hey, we're open source) but Building Your Own regex engine seems to be the thing everyone must do. It's probably a lot more fun than trying to grab a tractable bit to work on in a 100+Kloc source base.

<comment><AUTHOR> Very interesting. That is much more sophisticated than what I'm doing. My literal extraction is a simple greedy approach on the AST that only finds prefixes. My "scoring" is just a silly heuristic at this point. I had been doing it on the NFA itself, but found the AST easier to work with.

I think my problem is that I don't know how to take interior literals or suffix literals and apply them to search without provoking worst case quadratic behavior. For example, take the regex `\w+\s+Holmes`. It's easy enough to find `Holmes` and do a fast literal search for it. Then you can match `\w+\s+` in reverse from the start of the literal hit. But whoops, `Holmes` is a substring in the set of all strings described by `\w+\s+`, which means your automaton can start re-scanning input you've already seen. In pathological cases, you get quadratic behavior. (Similar to a poorly written Boyer-Moore implementation.)

I wonder if this gets easier using hyperscan's "all-matches" semantics. I haven't given alternative matching semantics much thought yet.

> We'd love help working on this problem (hey, we're open source) but Building > Your Own regex engine seems to be the thing everyone must do. It's probably > a lot more fun than trying to grab a tractable bit to work on in a 100+Kloc > source base.

Yeah, I started on Rust's regex engine almost 2 years ago. It's been a labor of love.

</comment></comment></comment></comment></comment></comment></comment><comment><USER10> Something I've wondered for a while... in the long term (that is, I'm more asking about architecture than what exists today), is it possible to integrate Rust more deeply into the calling convention of another language, so that rather than generating "C" functions, it might generate true "Go" functions?

I'm also asking beyond Go, so if the answer is "M:N really screws up Go w.r.t. Rust", I'm also curious about whether, for instance, you could write native Rust extensions to Perl or Python or $WHATEVER by changing out the runtime or something. If it works better for some languages than others, which ones might they be?

It's nice to be able to generate true C functions, and it is of course perfectly appropriate and correct to start there, given the real-world state of the ecosystem. But a lot of languages take various forms of penalties to call into C, in order to ensure guarantees that are not necessarily required by languages that aren't C, and, simultaneously, miss out on guarantees that Rust may be able to provide that C can't express and thus the C bindings can't count on.

<comment><USER11> Possibly. You'd have to add support for the nonstandard Plan 9 calling conventions, stack growth checks, and GC stack map information. LLVM broadly has support for all of these features (contrary to what some Go team members have said), but the specific binary formats for these features are incompatible with the Go runtime, so it'd be necessary to contribute upstream changes to LLVM or fork it.

<comment><USER12> Did they say segmented stack / stack maps is not available in llvm or it was not available when they started working on Go around 2007? Because I notice that segmented support was added around 2012 and stack maps in 2013.

</comment></comment></comment><comment><USER13> May I ask why? From my understanding Rust just have revamped their regex[0] using the same (similar) scheme as in RE2, which is now the Go's implementation, am I misinformed?

[0]: [https://github.com/rust-lang- nursery/regex/commit/e5a5198eee...](https://github.com/rust-lang- nursery/regex/commit/e5a5198eeea6de2a10a2244fece8a1cc206faf22)

<comment><USER14> The Rust regex library does use various techniques that RE2 and Go's library also use (and has from the start, that patch is just adding another feature that was missing), but it is generally faster than both of those libraries: take a look at the benchmarks in the link.

<comment><AUTHOR> @jerf - In response to your deleted comment, the README explains some of the numbers. The really crazy numbers are silly, and I say so in the README.

However, there are plenty of benchmarks well over 10x that are not silly at all. Look at the second block. The BeforeHolmes benchmark in particular is a good litmus test, since it defeats most optimizations.

Those particular speed ups are due to algorithms used. RE2 would have a similar speedup when compared with Go's regexp package.

Some of the other benchmarks in the 100x-400x range are likely due to smarter use of literal scanning.

</comment></comment></comment><comment><USER15> The usual way to use regular expressions in Rust is to use the Rust module that complies them at compile time. That can't be called from Go.

<comment><AUTHOR> Unfortunately, no, that is not the usual way any more. Two primary reasons:

1\. Compiling regexes at compile time requires a compiler plugin, which only works on nightly.

2\. The compile-time regexes are dramatically slower (think orders of magnitude) than the normal Regex::new method. The normal Regex::new method is what's shown here in these bindings.

The compiler plugin was code I wrote two years ago, and really hasn't changed since then. Regex::new on the other hand has gotten a lot of love.

The plugin's performance may one day get better, but it won't be soon unless someone else works on it.

<comment><USER16> curious, why is the compile-time regex slower? is it just a less efficient implementation?

<comment><AUTHOR> Regex::new has these tools at its disposal: Pike VM (NFA), backtracking (NFA), DFA (online), DFA (offline), Boyer-Moore

The plugin has these tools at its disposal: Pike VM.

But yeah, killercup is correct. The DFA (online) is one of the bigger reasons. But the offline DFA and Boyer-Moore are probably just as important.

You might glean more information from my hacking guide: [https://github.com/rust-lang- nursery/regex/blob/master/HACKI...](https://github.com/rust-lang- nursery/regex/blob/master/HACKING.md)</comment></comment></comment></comment>


What we found when we simulated the backbone of the Internet - <AUTHOR> http://improbable.io/2016/03/24/what-we-found-when-we-simulated-the-backbone-of-the-entire-internet-on-spatialos <comment><USER2> I read the article but apparently I still missed what they found.

<comment><USER3> It sounds like they found an advertisement for SpatialOS.

<comment><USER2> Indeed.

After reading the article, the network engineer in me's first thought was that there's no way they could "simulate" the Internet in any way that even remotely resembled reality since they have no insight or knowledge into all of the private interconnections that occur. I work for an ISP and have many more "private peerings" that an outsider would not be aware of at all.

There are various web sites where one can see what ASNs are connected together, but even those are missing all of this (and a lot more) detail.

Then, my next thought was, _" Oh, wait. What did they find out?"_ and I realized the answer was, apparently, "nothing".

</comment></comment></comment><comment><USER4> "In our simulation, every AS is running simultaneously and independently, so storing the full routing table for each AS requires many terabytes of RAM by itself."

i must be missing something - why do the tables consume terabytes of memory?

<comment><USER5> A single BGP routing table does not. A full table, multiplied by the number of unique autonomous systems however, can quickly reach that size.

<comment><USER6> It looks like a full table can often be stored in around 150MB.

So 60 000 AS would give around 9TB

<comment><USER4> thanks folks, that makes more sense.

do you have a source for the ~150MB figure?

</comment></comment></comment></comment><comment><USER7> Has a country wide Internet outage happened in the US? I'm 25 and have never experienced it.

<comment><USER8> not that i recall, but in the 90s, construction crews would routinely cut backhaul fiber lines and large areas of the country would go offline for most of a day while they fixed it, literally by stitching the cables back together. i think that's when they started putting markers by all the cables, because it was becoming a real problem. "call before you dig!"

or, more commonly, entire sites would be unavailable for a day or two, because everyone ran their servers on insanely expensive and unreliable T1 (or even crappier leased line) connections that were also prone to getting cut. that's when the colo / datacenter / hosting business really took off, because imagine running something that makes you money and relying on your local shitbox CLEC telco to deliver it for you. untenable at best.

for example, i remember a guy who ran a small gaming server outfit on a set of 56k leased lines running out of his garage. if you ran a clan, you could pay him for low-latency practice space. that was considered a legitimate internet business, cutting edge and visionary, even. i think it was a side business, and took off when the industry matured a little more and he could actually deliver decent solutions at consumer prices.

aside from basic nostalgia, those were not the good ol days. in fact, it pretty much sucked. flakey hardware, buggy software, slow-as-shit networking, no wifi ... the struggle was real.

these days, everything that comes out blows your fucking mind at how fast, reliable, high quality, and cheap it is. imagine waiting years for an incremental improvement in bandwidth instead of ridiculous shit like google fiber replacing your good-enough 100 megabit cable ISP. it's much better now in absolute terms, no matter how much people complain. and i'm only in my early 30s, i got an early start, but to someone in their 50s it must be mind- bending how much progress has been made.

<comment><USER9> I heard it was more fun when it was the military's fiber they cut. Resulted in uncomfortable situations.

<comment><USER10> I've heard a couple stories about telecom companies having good results buying defunct natural gas rights-of-way and leaving up the old signs that say "Warning: underground gas pipe"...

<comment><USER9> That's a friggin great idea! Thanks for mentioning it. I know a few people who will appreciate the suggestion.

</comment></comment></comment></comment></comment><comment><USER11> Also [https://news.ycombinator.com/item?id=11359155](https://news.ycombinator.com/item?id=11359155).

</comment><comment><USER12> Spam</comment>