Ask HN: YouTube is the cutting edge of fake news, why don't Google fix it? - <AUTHOR> I watch news on Youtube every night.  I watch CNN, MSNBC, Fox and others.
And Youtube constantly suggests that I watch what is apparently those same newscasts, but often the news clips presented are not from the original news organisation, they are published by some no-name Youtube accounts.
So essentially Youtube is full of accounts that take the news from the major outlets, and recut it, and then it gets re-presented back to Youtube viewers.
This seems to me to be blatant "fake news" and provides massive opportunity for bad actors to cut the news how they want it cut.
Youtube is a seething mass of corrupted news re-cutters and surely an obvious target for foreign influencers who want to present the news in ways that are meaningful to them
Why isn't Youtube onto this, when fake news is such a huge issue for technology companies? <comment><USER2> Money. YouTube revenue is via advertising, they want to keep your eyeballs on their videos. They probably have search/google history of you going to CNN or something and then present suggested videos from "there". They don't care what the content is, just that you are watching ads before the videos and stay on their site.

You can probably read faster than watching a video stream. Go to places like BBC news to get a feel for what is happening on our planet. Or buy a major city newspaper and read it. Video hardly will have the depth of a properly written piece of journalism. If you think major papers are biased, read a few different ones about the same topic to get a sense of what you think is going on. A lot of the bias in TV news is _what_ stories they decide to run or not run, not necessarily the 30-60 second content.

</comment><comment><USER3> Everyone else says money. The real reason is darker.

When the first broadcast media came out, radio and later TV, there was very limited bandwidth. The FCC had to apportion out a finite spectrum, and the powers there decided to make sure the public got their money's worth (because spectrum is a public good). Remember when government did that?

That ensured that building a transmitter and beaming out programming was expensive not only from a physical hardware perspective, but also from a licensing and compliance perspective. If the FCC thought your approved use of public airwaves was a little too raunchy or biased, you'd lose that approval.

Now with ubiquitous internet, bandwidth is essentially free. Net neutrality aside, there's no public interest in governmental involvement in bandwidth from a scarcity perspective, and we've yet to reach an agreed-upon point where there is any other reason for governmental involvement.

Imagine the heady days of TV with the lineup of talking heads, push polling, personal branding, backroom deals, astroturfing, sockpuppetry, and exogovernmental involvement we have today.

To answer the question, Google won't fix it because no government forces them to.

</comment><comment><USER4> Fake news creators pay to promote their clickbait content. Content that plays on people's fears. Of course people are going to click on it. Then it reinforces the algorithms that are designed to show it more often. It becomes a feedback loop driving crap to the surface. This is happening everywhere. It's the evolution of social media driven by algorithms to maximize profit.

The better question is: why doesn't everyone leave these platforms?

</comment><comment><USER5> YouTube is also still full of ElsaGate predatory pedo accounts and YouTube is happy to play ads to the millions of views each video gets. But Alex Jones? Sorry, can't have him or a few other conservative loud voices on the platform.

</comment><comment><USER6> The core of the problem is that fake news is much more interesting than real news. "Laughing Swedish PM seen kicking puppies!" will net you many, many more views than "Swedish PM presents new tax reform!"

</comment><comment><USER7> Seen this a lot too.

I guess it spells "money", simple as that.

While the monetary benefit aren't big enough, or even positive, it's not worth doing. What is worth doing is getting ad impression revenue on clickbaity things.

<comment><AUTHOR> >> I guess it spells "money", simple as that.

I would have thought with the political stakes so high that Youtube/Google would care about more than just the money.

I can see the heads of Google sitting in front of congress trying to explain Youtube as the most obvious fake news platform. You'd think they might want to avoid that.

</comment></comment><comment><USER8> I've been looking for an answer to this for a while now. What would be a good way to fix it, other than youtube have its own moderators to filter the content out?</comment>


Absinthe: GraphQL for Elixir - <AUTHOR> http://absinthe-graphql.org <comment><USER2> So I guess this doesn't currently work with sockets? Never the less, this looks really awesome and i can't wait to start playing with it.</comment>


Why are Silicon Valley billionaires starving themselves? - <AUTHOR> https://theweek.com/articles/835226/why-are-silicon-valley-billionaires-starving-themselves <comment><USER2> Am I missing something, or does the author really not mention the strong body of evidence showing that calorie restriction is one of the only interventions consistently associated with a significantly longer lifespan? I feel like it's obvious that Jack and anyone else skipping meals is doing so because of solid science, not "because Stoicism" (and a good thing, too, because how idiotic would that be?)

<comment><USER3> I agree. The article is so obviously biased against anything related to the world of tech that it makes me feel like it was written by a bot.</comment></comment>


5 Business Decisions You Will Be Proud Of - <AUTHOR> http://www.dumblittleman.com/2008/04/5-business-decisions-you-will-be-proud.html

<comment><USER2> If there was a down-vote, I'd use it for this article. I get annoyed when I follow a link only to find a fluff piece.</comment>


Twilio for email: Email Yak API Launched v1.0. Thanks HN Feedback? - <AUTHOR> http://www.emailyak.com/

<comment><USER2> Wait a second. isn't there this other email API called...IMAP?</comment>


Haskell in Production: 12 Months Building ApiEngine - <AUTHOR> http://mth.io/talks/haskell-in-production/ <comment><USER2> I appreciate the need some people feel to make modern-looking web pages, but the format of this really is just a triumph of style of substance:

* I have no idea how far through the content I am

* The lack of verbosity means I'm constantly having to apply guesswork to their statements (ie an explained point will tell the readers why Haskell gave them better communication. A slide show like that with just headings mean I have to guess the reason Haskell had those benefits)

* It's scales terribly (at least on Opera, some of the content fell off screen - so I had to maximize the browser. But this might just have been an Opera bug. In either case, this wouldn't have been a problem with a more traditional blog layout).

* The navigation requires guesswork

* And most annoying of all, it doesn't actually save the reader any time by displaying the content like that than it would have done with blog post as the jarring navigation presented with slides require the reader to pause before each page to understand how to read the slide, and then pause after each page to apply the aforementioned guesswork. With a blog post, the information is presented in a more natural communicative way which makes it quicker to digest the information.

It's a great pity I'm having to pick post a negative comment about the presentation of the submission rather than comment about the point being raised - particularly as I've been very interested in Haskell lately. But I found even my interest in the subject wasn't enough for me to put up with this slide show layout and thus I ended up closing the browser tab before the end. :(

<comment><USER3> > modern-looking web pages

Well, herein lies the problem: It's not a web page, it's a slide deck.

But I do agree in general. The slides alone are often not very interesting or useful without the talk. Hopefully, it was recorded.

<comment><USER4> I assumed it was a deck but couldn't find a way to advance from the first slide.

<comment><USER3> The left and right cursor keys generally work.

</comment></comment></comment></comment><comment><USER5> Awesome. Is there a video recording of your presentation anywhere online?

What strategies did you use to combat the lack of stack traces, especially in production?

I was happy to see that you are fellow Brisbanites. I'm a bit out of the "local loop", is there much of a local Brisbane start-up scene?

<comment><USER6> I think i'm missing something. On slide 4 it says (the code) it has 0 exceptions and is robust, but then on slide 7 it says that (the system) it crashes without stack traces? Is that right?

What did the OP meant by being robust, when the code crashes unexpectedly?

<comment><USER7> The cynic in me says that unless Haskell has a magical "do the right thing in every situation, with automatic full knowledge of your application's business requirements" operator, if there's no specific logic in the code that responds to errors, they're just ignoring them (or else they're building a very bare bones app - any nontrivial piece of software will have potential error conditions out of its control that it has to react to in very specific ways that depend on the app itself).

In which case I could produce an equally "robust" Java program by wrapping everything in a try/catch and not logging anything. Except that in Java, or just about any other language, with a single method call I could obtain that elusive stack trace that OP is sorely missing. Which, in real applications (which, to be fair, I've never been masochistic enough to write in Haskell), I always do, and it significantly improves our ability to track down the remaining unanticipated conditions that our error handling logic hasn't already handled in well defined ways. And that sort of work should consume most of anyone's time spent developing, because the happy path is the easiest piece of the puzzle - engineers handle all code paths, hackers handle the most important ones, and hacks only handle the best case scenarios.

I'm not really getting what Haskell has helped here, apart from making the article more upvote-able.

That said, the presentation slides don't give me even a vague sense what the real thrust of the presentation was, so I'm probably missing the substance. I take issue with this being posted without any additional context, but I'll grant the benefit of the doubt and assume that there may actually have been something worth listening to if we didn't just have the slides to look at.

<comment><USER8> Exception in Haskell is more specific than in other languages. There are many ways to have "unexpected circumstances" such as Maybe, Either, Error, Mplus, Alternative, and the transformer variants thereof. Exceptions refer explicitly to "asynchronous" exceptions—the kind in most other languages, that imply global changes in control flow that are difficult to reason about.

People tend to avoid this behavior except in rare circumstances. That said, it's easy to replicate locally with the Cont monad. These local reflows are easier to reason about as well. You can even build it atop delimited continuations for more control. These are great for covering early stopping in searches, for instance.

<comment><USER9> >Exceptions refer explicitly to "asynchronous" exceptions

This is not technically true. You can throw exceptions from pure code, either explicitly or with something like an incomplete function definition (which the compiler should warn you about). However, it is considered very bad practice to do so.

<comment><USER8> Sure, and if you treat them all as `undefined`/bottom then you get CPO semantics. Usually "Exception" still refers to `Control.Exception.SomeException` and `error` is bottom.

Catching "undefined" from pure code is the danger that leads to massively confusing semantics—it breaks down the "value" concept badly. The `spoon` library is a great example of this and it's scary to see it in places. That said, it's not terrible for wrapping up foreign code that isn't quite unsafe enough to need "IO" treatment.

The best usage of "error" is to mark completely impossible situations. These show up easily when you do dependently typed stuff with GADTs, but can also exist due to various algorithm invariants.

</comment></comment></comment></comment></comment></comment><comment><USER10> Reddit discussion here:

[http://www.reddit.com/r/haskell/comments/1etssw/haskell_in_p...](http://www.reddit.com/r/haskell/comments/1etssw/haskell_in_production_slides/)

</comment><comment><USER11> Not only I have no clue about the slides, but I went to their site (apiengine) and I have no idea what their site does. Interestingly, both the slides and their site (apiengine) has clean and beautiful designs, however neither one of them are a bit informative.

<comment><USER12> He He... Their site is hard to read and understand and so is Haskell at first glance.

</comment></comment><comment><USER13> Does anyone have some insight to what is going on in the Z monad bit? It looks like an Either monad with a bunch of error states instead of just the one.

<comment><USER8> There are two independent parts. The Z monad is nothing more than a ReaderT monad giving access to some config and environment information. Since it's a transformer they can execute actions in higher monads (like IO) pretty easily from Z, but it can also be used in pure code if you just need the configuration information.

Parallel to that is the ZResultT monad. It's built on the ZResult monad (it should be easy enough to write a Monad instance for it anyway) which looks like an Identity monad with some "Z-specific" error handling layered in. ZResultT just lets you have a transformer stack interleaved with the ZResults.

Then you combine those two stacks in ZZ which gives you both "Z-related" configuration and "Z-related" error states.

It looks like the whole thing is specialized to make it easy to build functions pure functions which only need a handful of the effects and then weave them together into the ZZ monad which is likely to be run at the top level, right below Yesod.

</comment></comment><comment><USER14> The fact I read this and have absolutely no idea about what's going on makes me compelled to learn more about Haskell.

Is it really that alien (I know Scheme)?

<comment><USER15> I have been programming Haskell for the last few month for a sideline project, and really enjoying the experience so far. This has been the second or third time I revisit Haskell as a programming language, and this time I do feel that I am "getting" it in Haskell and could be productive ;) and I do feel very safe to write in Haskell, usually it works if it compiles.

Here is one great post about starting in Haskell (via jerf@Reddit) [http://www.reddit.com/r/haskell/comments/1e3cl0/haskell_intu...](http://www.reddit.com/r/haskell/comments/1e3cl0/haskell_intuition/c9wkwev)

it would be the exact way if I would summarize my experience over last few months..

but I do feel the lacking of good communicators in Haskell community who know how to talk to non-Haskeller.

<comment><USER16> That Reddit post is great. For me, in learning Haskell, the biggest challenge has been libraries. Many of them just seem badly designed, or unfinished.

My first project I wrote a simple scraping tool that scrapes a certain web site and organizes the information in a database behind a front end and API. Immediately I encountered several problems that would have been a cakewalk in, say, Ruby:

* The HTTP library (Network.HTTP) is not encoding-aware. It ignores Content-Type and returns a String with some undefined encoding. So if you grab a resource which is, say, ISO-8859-1, anything that works with UTF-8 will potentially blow up.

* (And if you do this yourself, there is no built-in way to parse MIME charsets into Haskell encoding names except by writing it yourself, I think.)

* The string libraries are confusing. There is String, but also Text. Both are supposed to be Unicode-aware, but many of the operations you want are in Text, requiring conversions back and forth.

* I could not, and still haven't, figured out how to convert a ByteString containing ISO-8859-1 to an UTF-8 string. Data.Encoding apparently exists for that, but I could not get it to work like I wanted. I ended up with this lovely mantra (which you wouldn't think had anything to do with ISO-8859-1, but it does) and left it like that just because it works:

        decodeLatin1 bytes = Data.Text.unpack $ Data.Text.pack $
          Data.ByteString.Char8.unpack bytes

* There are multiple libs for HTML/XML parsing, and no clear winner. HaXml was buggy and did not parse my HTML correctly. TagSoup and HandsomeSoup had weird APIs I did not like. I ended up with HXT, which uses Haskell arrow syntax extensively and is therefore incomprehensible, even when I understand what and how it does it. It feels a lot like people who write ambitious libs in Ruby with too much "magic". Haskell is a functional language and should be _wonderful_ for parsing HTML/XML using XPath or CSS selectors, but it's a nightmare. HXT's parser is impure by default (!) and you have to google some tutorials to find out how to use its pure version, which the tutorial writers (in the same breath) dissuade you from using.

* For the frontend I ended up using Happstack Lite because it's small and about as easy to get started with as Sinatra. Unfortunately, the first templating system it recommends, Blaze, is crap. With Blaze you write the template inline, building an XML tree, similar to Ruby's "Builder" gem, but the syntax is ugly and unnecessarily complicated. The other recommended templating systems, HSP and Hamlet, are like ERB or PHP, so a serious step backwards from HAML. In the end, I could not find anything like HAML.

* I haven't delved very deeply into Happstack yet, but like many Haskell libs it seems to make simple things more complicated than they ought to be (eg., the routing system). One annoyance I remember is the fact that HTTP verbs aren't IO, which makes code less intuitive, since obviously in a modern web app, HTTP verbs are going to be doing IO (things like talking to databases), and so you have to use liftIO a lot.

* Perhaps the biggest issue for me was the general lack of high-quality documentation (Happstack itself has almost none). Sure, there are tons of searchable machine-generated docs, which is great, but that documentation lacks the bits that tie everything together. Since Haskell is mainly about applying functions to values of types, it is very decentralized; knowing what function to use is only part of the game. It's just as important to know how its return value plays with the rest of the function space, because so much of Haskell revolves around composing functions in idiomatic ways. This is very different from, say, Ruby, where you know a method returns an object, and an object only has the methods its class provides; this centralizes, clusters and constrains the information into easily digestible pieces.

A veteran haskeller would probably not struggle too much with these things. But as a novice, I expected the path to be slightly easier. The language was rarely a problem, the libraries definitely were.

<comment><USER17> Just a few thoughts on the points you made:

> * The HTTP library (Network.HTTP) is not encoding-aware. It ignores Content- > Type and returns a String with some undefined encoding. So if you grab a > resource which is, say, ISO-8859-1, anything that works with UTF-8 will > potentially blow up.

Agreed that the HTTP package is rough around the edges. It also doesn't support HTTPS, which seems like a major shortcoming to me. Fortunately, there are several better-designed alternatives (which have the added benefit of being more efficient), e.g. http-streams and http-conduit.

> * The string libraries are confusing. There is String, but also Text. Both > are supposed to be Unicode-aware, but many of the operations you want are in > Text, requiring conversions back and forth.

This pain can be mitigated somewhat by using `{-# LANGUAGE OverloadedStrings #-}`, at least when you're working with literal Strings, ByteStrings, and/or Texts. The main problem with the proliferation of string types is when using multiple libraries, each of which expect a different type of string (or one expects a strict ByteString and the other a lazy ByteString). Then the conversions can get irritating.

Generally speaking, you should use Text for textual strings, ByteString for binary data, and String in simple cases when the convenience of using Prelude or list functions trumps performance concerns. They all have reasonably well defined uses.

> * There are multiple libs for HTML/XML parsing, and no clear winner. HaXml > was buggy and did not parse my HTML correctly. TagSoup and HandsomeSoup had > weird APIs I did not like. I ended up with HXT, which uses Haskell arrow > syntax extensively and is therefore incomprehensible, even when I understand > what and how it does it. It feels a lot like people who write ambitious libs > in Ruby with too much "magic". Haskell is a functional language and should > be wonderful for parsing HTML/XML using XPath or CSS selectors, but it's a > nightmare. HXT's parser is impure by default (!) and you have to google some > tutorials to find out how to use its pure version, which the tutorial > writers (in the same breath) dissuade you from using.

Have you tried the `xml` package [1]? It's not as sophisticated as something like HXT, but for a lot of uses, it does the trick and is far easier to work with. HXT is intimidating for sure, but apparently very powerful once you learn it (I haven't bothered).

> * For the frontend I ended up using Happstack Lite because it's small and > about as easy to get started with as Sinatra. Unfortunately, the first > templating system it recommends, Blaze, is crap. With Blaze you write the > template inline, building an XML tree, similar to Ruby's "Builder" gem, but > the syntax is ugly and unnecessarily complicated. The other recommended > templating systems, HSP and Hamlet, are like ERB or PHP, so a serious step > backwards from HAML. In the end, I could not find anything like HAML.

Funny, I personally think blaze-html is terrific. I like having a Haskell EDSL for HTML generation instead of having to drop into a specialized and restricted "templating language" for that purpose.

If you want something like HAML, check out `hamlet` [2]. It's directly inspired by HAML and is the main templating engine of the Yesod web framework.

I found Snap to be somewhat easier to work with than Happstack, after trying them both. It occupies about the same level of abstraction. Yesod is a more full-stack Rails-like framework, which some people prefer. You can pretty easily mix and match components of the different frameworks however you like; they are nice and modular. I often use snap-core, acid-state, digestive- functors, and blaze-html together for simple web apps, even though they are not all part of any one framework.

> * I haven't delved very deeply into Happstack yet, but like many Haskell > libs it seems to make simple things more complicated than they ought to be > (eg., the routing system). One annoyance I remember is the fact that HTTP > verbs aren't IO, which makes code less intuitive, since obviously in a > modern web app, HTTP verbs are going to be doing IO (things like talking to > databases), and so you have to use liftIO a lot.

Frequently having to use `liftIO` is a sign that the library author overspecialized their functions to IO. If more people would write libraries using `MonadIO m => m a` instead of `IO a` that problem would basically disappear. Polymorphism is wonderful, when you are able to apply it.

> * Perhaps the biggest issue for me was the general lack of high-quality > documentation (Happstack itself has almost none). Sure, there are tons of > searchable machine-generated docs, which is great, but that documentation > lacks the bits that tie everything together. Since Haskell is mainly about > applying functions to values of types, it is very decentralized; knowing > what function to use is only part of the game. It's just as important to > know how its return value plays with the rest of the function space, because > so much of Haskell revolves around composing functions in idiomatic ways. > This is very different from, say, Ruby, where you know a method returns an > object, and an object only has the methods its class provides; this > centralizes, clusters and constrains the information into easily digestible > pieces.

I don't disagree that more documentation is a good thing, and some libraries are under-documented. But I can also point to examples of Haskell libraries with superior documentation to nearly anything else I've encountered. Some authors really go the extra mile; it's great.

My experience has been that the type system plus Haddock docs are frequently enough for me to figure out a library even without any prose documentation at all. This, to me, is a huge advantage of Haskell. The types only fit together one way, and that way is the correct one. When using a library with well- designed types, you basically can't get it wrong.

I certainly understand why this would not be so easy for a newbie. It gets much, much easier with experience, though.

[1] <http://hackage.haskell.org/package/xml> [2] <http://hackage.haskell.org/package/hamlet>

<comment><USER16> I really appreciate the detailed response!

> _Fortunately, there are several better-designed alternatives_

Do those you mention handle content type and encodings correctly?

> _Have you tried the `xml` package [1]?_

Yeah, it doesn't do selection based on CSS selectors or XPath expressions. I don't want to have to manually write tree-traversal code when those already exist.

Take a look at my current scraping code [1] if you want to see how I use HXT. (Just promise not to laugh at my novice work.) Basically, the arrow syntax gives you a weird portal into a different world where you select stuff from a tree using a predicate syntax. I say weird because within the proc and the "-<" arrows, it seems you can only deal with XmlTree operations.

> _Funny, I personally think blaze-html is terrific._

It's a bit much, but not awful for generating XML programmatically. The main problem is the need to use "toValue" and "toHtml" all the time. I guess I don't understand why the element building functions don't accept strings.

But for templating, I just don't like embedding templates in the actual source code of the HTTP verb it's for. The main controller code should be about preparing data for the UI, and the UI should be separate from the controller code. You could put it in a separate file and function and import it, of course, but it's still Haskell code, which must be compiled along with the entire app, which slows down the development cycle a lot.

I haven't looked closely at the various web frameworks to see if they support Rails-style reloading (ie., recompiling and reloading the app on each page load). Do you know?

> _If you want something like HAML, check out `hamlet`_

Hamlet is like someone looked at HAML and didn't grasp why it's so good, because they decided they had to make it look like HTML. Here is HAML:

        div#foo
          ul.list
            - items.each do |item|
              li= item.title

And the same in Hamlet:

        <div #foo>
          <ul .list>
            $forall item <- items
              <li>#{itemTitle item}

Why invent something that looks like HTML but isn't? HAML syntax is basically (almost) CSS selectors, that's the whole point.

And again, it's apparently meant to be placed inline.

The Snap guys (I think) also invented their own versions of SASS, called Cassius and Lucius. Cassius corresponds to the indented SASS syntax, and uses CSS selectors, unlike Hamlet.

> _Frequently having to use `liftIO` ..._

Oh, interesting. I don't know about MonadIO yet. Will definitely read up on this.

> _My experience has been that the type system plus Haddock docs …_

Haddock is great, but a lot of it is non-trivial to understand without having to read the docs very closely. The "xml" library is an example of a simple library where, if you browse around, you can piece together how it works, although it's so bare-bones that if you just want to know how to parse some XML, you have to hunt down the right function, which happens to be in Text.XML.Light.Input; nowhere is there a "how to" introduction which illustrates use cases.

With more complex libraries, the machine-generated docs become increasingly obtuse. For example, I would never, ever have figured out how to use HXT with Hackage alone. I mean, look at it! [2] Is the parser in Text.XML.HXT.Arrow.ParserInterface? Nope. In Text.XML.HXT.Arrow.ReadDocument? Curiously, no. The function to parse a document, runX, is apparently not even in the Hackage database. And good look finding out that this is the function you need to use, never mind the semantics of XML arrows.

[1] <https://github.com/alexstaubo/pfinn/blob/master/Scraping.hs>

[2] <http://hackage.haskell.org/package/hxt>

<comment><USER17> > Do those you mention handle content type and encodings correctly?

I honestly can't say for sure, but I've never encountered such a problem in my own usage. Maybe that just means I've been lucky. I just know from firsthand experience that they do a lot of things better than the HTTP package does.

> The main problem is the need to use "toValue" and "toHtml" all the time. I > guess I don't understand why the element building functions don't accept > strings.

First of all, if you're writing string literals and explicitly converting them with `toHtml`, you're missing out. Instead, enable the OverloadedStrings extension, and then you can do this sort of thing:

        html $ do
          head $ title "My Web Page"
          body $ do
            h1 "A Heading"
            h2 "A Subheading"
            hr
            p "A paragraph of text"
            p $ "Another paragraph, with an " <> (a ! href "http://example.com/") "embedded link"
            p $ em "Emphasized text" <> " and " <> strong "strongly emphasized text"

Notice the total lack of `toHtml` there.

The HTML DSL functions don't accept strings because String and Html are two fundamentally different types of data. Enabling the type system to differentiate between the two lets you do some pretty nifty things. For instance, if you were to write

        "<script>alert('XSS!');</script>" :: String

you'd be in trouble, but you can't do that since blaze-html doesn't accept plain old strings. Instead, you'd write

        "<script>alert('XSS!');</script>" :: Html

Note how only the type is changed, but now, the string will be transparently converted to "<script>alert('XSS!');</script>" before it's added to the document, and thus you're safe, without having to actually do anything different. The type signatures I gave are superfluous of course, since they'd be inferred automatically. The type system makes this kind of flaw impossible.

Plus, since blaze combinators are just Haskell, and the Html type is a monad, you can use all the usual Monad functions with Html:

        ol $ mapM_ (li . toHtml) ['A'..'Z']

That generates a 26-item list of letters from A to Z. Yes, you do have to do the explicit conversion to Html there, but I think that's a small price to pay for all the flexibility afforded by templating HTML with full-fledged Haskell code.

> But for templating, I just don't like embedding templates in the actual > source code of the HTTP verb it's for. The main controller code should be > about preparing data for the UI, and the UI should be separate from the > controller code. You could put it in a separate file and function and import > it, of course, but it's still Haskell code, which must be compiled along > with the entire app, which slows down the development cycle a lot.

Yeah, I just put "view code" like the above examples into a separate module and import it. I don't find the slowdown to be significant, but maybe that's just me. In any case, true template languages have to be compiled too, either with the rest of the program or at runtime, so one way or another you incur that cost no matter what you're using.

> I haven't looked closely at the various web frameworks to see if they > support Rails-style reloading (ie., recompiling and reloading the app on > each page load). Do you know?

Yesod does this by default, and Snap can, if you use `snap-loader-dynamic` for your development builds. I believe they both use the awesome `hint` package for runtime eval and compilation of Haskell code. I don't think Happstack has any auto-reloading capability though.

> Why invent something that looks like HTML but isn't? HAML syntax is > basically (almost) CSS selectors, that's the whole point. And again, it's > apparently meant to be placed inline.

It doesn't seem _that_ different from HAML to me, but it's clearly a subjective judgment. :) And it doesn't have to be inline. It uses the QuasiQuotes language extension, which means you can do inline snippets or write it in a separate file, however you like.

Hamlet, Cassius, Lucius, and Julius (collectively, the "Shakespearean" template languages) are developed by the Yesod framework guys, not Snap, by the way. Snap uses a template language called Heist by default, which I don't particularly care for (I just use blaze-html instead).

> Oh, interesting. I don't know about MonadIO yet. Will definitely read up on > this.

If you use liftIO, you're using MonadIO. That's what liftIO does, it's an adapter between plain IO values and polymorphic MonadIO values. But if library authors use MonadIO instead of IO, you can omit the explicit conversion. This isn't something you really have control over as the user of a library though.

> With more complex libraries, the machine-generated docs become increasingly > obtuse. For example, I would never, ever have figured out how to use HXT > with Hackage alone. I mean, look at it!

Fully agreed. HXT is a huge, complex beast! I don't think it's fair to judge all libraries by that standard, though. HXT is clearly at an extreme end of that continuum.

<comment><USER16> I have been cursing the string handling and now you tell me OverloadedStrings exists. This makes sense. Thanks for the help, that actually makes Blaze a little closer to HAML for me.

I appreciate the input on the other things. I will check out Snap, I think.

</comment></comment></comment></comment></comment></comment></comment><comment><USER18> Why wouldn't the landing page say "use arrows to navigate?" I spent a good little while trying to figure out what I was missing.

<comment><USER19> Took me a second until I noticed that the scroll wheel seemed to take me to a different page. As soon as I determined it was a slideshow, I tried the arrow keys, as they work on every HTML slideshow I've seen in the last 5 years.</comment></comment>


PCMag: The VPN Industry Is on the Cusp of a Major Breakthrough - <AUTHOR> https://www.pcmag.com/commentary/369921/the-vpn-industry-is-on-the-cusp-of-a-major-breakthrough <comment><USER2> Been waiting years for a windows version of wireguard and it's finally available. Will give it shot soon!

Btw these benchmark results corroborate Wireguards own [https://www.wireguard.com/performance/](https://www.wireguard.com/performance/)</comment>


ScaleFactor Raised $100M in a Year Then Blamed Covid-19 for Its Demise - <AUTHOR> https://www.forbes.com/sites/davidjeans/2020/07/20/scalefactor-raised-100-million-in-a-year-then-blamed-covid-19-for-its-demise-employees-say-it-had-much-bigger-problems/#2e135beb2928 <comment><USER2> > Kurt Rathmann explained to Forbes last month, customers were craving a > person, rather than a computer to do their accounting. "We really thought we > could automate the entire back office of a small business," Rathmann said. A > lofty goal that more money couldn't achieve.

The whole selling point of the company was to automate away bookkeeping and make it real-time. The reason why customers signed up was to _not_ have to deal with a person. It's unbelievable that despite the market calling this man out on his bullshit he still has the audacity to lie one more time and try to change the entire narrative. If customers were truly craving a person instead of a computer for their accounting you would've stopped at the market research/MVP phase instead of raising $100M and defrauding customers.</comment>


Boeing-backed startup Zunum Aero plans to deliver hybrid-electric plane in 2022 - <AUTHOR> https://www.bloomberg.com/news/articles/2018-05-21/boeing-backed-startup-targets-2022-debut-for-electric-plane <comment><AUTHOR> From Zenum's website:[0]

Performance

Max range: 700+ miles

Max cruise speed: 340 mph

Take-off distance: 2,200 ft

Seating capacity: 12 economy, 9 premium, 6 executive

Max take-off weight: 11,500 lbs

Max payload: 2,500 lbs

Powertrain

Architecture: Series hybrid with range extender

Max power: 1 MW variants

Battery mass: Under 20% of max take-off weight

Turbogenerator: 500 kW variants

Emissions: 0.0 to 0.3 lbs CO2/ASM

Sideline noise: 65 EPNdB

[0][http://zunum.aero/](http://zunum.aero/)</comment>


The Social Graph is Neither - <AUTHOR> http://blog.pinboard.in/2011/11/the_social_graph_is_neither/ <comment><USER2> This is a superb post. Social networks, starting especially from the era of the Facebook era, have foisted increasing amounts of doublethink on their users, and it's often difficult to make people realize this and explain the reasons for it being that way. This essay not only lays out good examples of that nagging cognitive dissonance, but then goes on to explain its necessity at both the technical and business levels.

<comment><USER3> I disagree. The entire first point is merely a taxonomic complaint. Yeah, taxonomies are hard to "get right" in the global sense. That's why we don't employ globally correct architecture-astronaut taxonomies for everything, there aren't very many accurate useful ones.

Instead life is made up of piles and piles of little taxonomies used for specific purposes. I'm happy with that as both a mental model and a practical one.

I agree that the notion of a single social graph is an incoherent one, but Maciej's point is largely a quibbly one. There are graphs of human interactions that can be mapped out. These interaction graphs are not static. Data sets which purport to represent reality require updating, as they are not the canonical source.

But so what? That's true for maps of physical locations too, or article quality on wikipedia. Facebook shows, if nothing else, that it's possible to not just track but mediate (and still track) these interaction spaces for users as an end to itself (even if they are the product not the customers).

Does it matter that Facebrick isn't a perfectly synced representation of reality? Well, does it matter that Wikipedia isn't a totally accurate encyclopedia? You'd be right to ask for what cause, and to what end.

And that's the whole point. We dig up or create the little taxonomies that bridge the gaps that we're looking to cross.

<comment><USER2> I think you're missing his bigger insight, that is, building a social graph is a fundamentally asocial act. And that extends to creating taxonomies, even if they are localized to my concept of socializing. Nobody goes to a party to create a taxonomy.

Being social is all about disorganization, spontaneity, creativity, breaking _out_ of all the stupid taxonomies that we impose on other people and have imposed on us. Trying to organize socialization to the extent that a "social graph" can be created is a profoundly sociopathic act. To push this task on users so that they do all the shoeboxing and tagging and linking, all in the name of "fun," requires some coercive force. It is no surprise that many Facebook users say that they don't really _enjoy_ using it, but they _have_ to. Part of that was the site's smart choice to maintain real names, so that you are always fretting about your online appearance. It's not a "perfectly synced representation of reality," but it is presented as such, almost like your own personal Wikipedia page, and by the laws of social anxiety you are compelled to check up on it! Shoebox, tag, link...

The line about Facebook rarely producing creative or original material really hit home for me. 4chan and SA are creative because they are fundamentally disorganized, and this freedom produces real moments of brilliance (and plenty more of profound stupidity). Facebook and its ilk are like corporate jobs disguised as consumer web products. You are constantly being shuffled from box to box, task to task, and the blinders have to be tightened ever so constantly to keep you from realizing why what you are doing really never will be "fun" in the way that a raucous party is fun.

About those blinders: those are in a big way the "privacy options" that every social network touts. Maciej points out, and I think that it's a salient point, that if everybody was able to see the whole social graph, it would dissolve. That alone should suggest that the social graph is an unnatural concept. Yet there is somebody, the owner of the social network, that can indeed see the entire graph, and there is a whole level of misdirection that they must apply to make this seem completely normal.

Again, maciej said most of this better than I could, so I'm glad he did.

<comment><USER4> > Being social is all about disorganization, spontaneity, creativity, breaking > out of all the stupid taxonomies that we impose on other people and have > imposed on us.

That is a very euro-centric, post-modernist way of thinking.

What are caste system if not social?

What are far-flung familial relations if not social?

A definition of being "social" which only applies to societies where friendship is paramount, and friends come and go with ease is too limiting and leads you to solutions that can be awkward in other societies.

For example, in my country, we care deeply about family and ancestory--so much so that in every generation one member of the family is nominated to be the "memory keeper" (sorry, there's no translatable word) who keeps track of the geneology of everyone, and is expected at a glance to determine if a stranger is at least vaguely related to us.

Would a free form social graph be useful to us---not really. Our facebook pages are practically 90% family members, 10% people who through marriage _will become family members_.

<comment><USER2> > That is a very euro-centric, post-modernist way of thinking.

You're right, even the way I defined "social" is too limited. But that irony only helps my point. You _cannot_ define social, but this is precisely what the "social graph" is attempting to do. As soon as you create a definition, people react to it and oftentimes rebel against it. And then you are right back to the drawing board.

<comment><USER5> I agree with you but that doesn't make the creation of social graphs a waste of time right? It just means the market has a lot of niches for different types of graph that each provide limited and specific value.

It's not about creating perfect Platonic models. It's about making cool things that people find useful. If you are trying to design a system that scaled to every single possible interaction from scratch then you've already failed, you can't compete with reality at that one.

</comment></comment></comment></comment></comment></comment><comment><USER6> Two things struck me:

\- the quality of thinking displayed in this post

\- what is in the world is it doing on the delicious clone I signed up for?

This is the same guy that writes about scaling hardware, no? Keep it coming.

<comment><USER7> Scaling hardware, steaks[1], Iceland[2], John Titor[3], scurvy[4], etc.

[1]:[http://idlewords.com/2006/04/argentina_on_two_steaks_a_day.h...](http://idlewords.com/2006/04/argentina_on_two_steaks_a_day.htm) [2]:<http://idlewords.com/2003/11/a_morning_in_iceland.htm> [3]:[http://idlewords.com/2003/09/best_practices_for_time_travele...](http://idlewords.com/2003/09/best_practices_for_time_travelers.htm) [4]:<http://idlewords.com/2010/03/scott_and_scurvy.htm>

</comment></comment><comment><USER8> Social networks aren't really social networks either. If you read Bowling Alone, it should be readily apparent that Facebook et al. fulfill few of the functions of an actual social network.

<comment><USER9> Exactly. "Social networks" are thingies that aid us with establishing and keeping up with _actual_ social networks. It's a bit like calling a publisher's press a news agency.

<comment><USER8> In vipassana meditation there is the idea that if you learn to recognize thoughts at the precise moment they arise, then eventually any given thought will basically lose its power and stop arising. Facebook seems to have the same property, but for personality. Every time you post about yourself, you become a little bit more bland and boring of a person.

The way I think of Facebook is rolodex + fax machine + succubus.

<comment><USER9> Fascinating tidbit on meditation, but I disagree that posting about oneself on Facebook makes one more bland and boring. If, for example, one is bland and boring to start with, then yes, posting about yourself to Facebook won't really help. However (EDIT) -- if your life is boring, you can post about something else. I've known some individuals who lead the most pathetic lives you can imagine yet they had a decent-size following on Facebook because they regularly posted about politics (which I guess they used as a medium through which to vent about how pathetic their lives were...).

I do see some truth however to your comparison with that idea from meditation. For example, even if you are leading an interesting life, there are many ways to post about it that will make your life appear less interesting than it really is.

</comment></comment></comment></comment><comment><USER10> "Imagine the U.S. Census as conducted by direct marketers - that's the social graph."

That's the best quote in the whole post. I can't articulate it, but that resonated strongly with me.

</comment><comment><USER11> One of the main points in this article is that any social graph found in a service such as Facebook, Twitter, or G+ can't possible model all of the nuance of real life relationships. That's obvious. However, the author takes it a step further. Suggesting that because of this these services have no value.

That's pretty big logical leap.

An imperfect approximation of the social graph still has a lot of value.

<comment><USER12> Exactly, I mean, just ask the citizens of Egypt.

"This revolution started on Facebook." - Wael Ghonim

[http://www.huffingtonpost.com/2011/02/11/egypt-facebook- revo...](http://www.huffingtonpost.com/2011/02/11/egypt-facebook-revolution- wael-ghonim_n_822078.html)

</comment></comment><comment><USER13> > Asking computer nerds to design social software is a little bit like hiring > a Mormon bartender.

exactly.

<comment><USER14> This is bullshit.

"Computer nerds" have plenty of friends. I know factory workers that have very high depression levels due to not having enough social contact or friendship in their lives. Sure, when I was 9 I was beat the fuck up over and over but when you are friendly, smart and successful people _like_ you. They want to be your friend. Let's play devils advocate for a second. Take the most popular person in high school and get him to design social software. It would suck. Bad.

<comment><USER15> > Take the most popular person in high school and get him to design social > software. It would suck. Bad.

Let's assume they had the technical skills to do it, why do you think it would suck?

<comment><USER16> _Let's assume they had the technical skills to do it_

So basically a nerd with social skills?

<comment><USER15> I'm trying to figure out his argument. He's implying that someone with good social skill would suck at designing a social network, but seemingly for more reasons than they just don't have the technical ability. Or maybe that's all he's saying.

<comment><USER14> I'm denying the premise.

The most popular person in high school was almost certainly not a nerd. Nerds take a while to maxing out their social skills, but once they do I find they are almost as good at it as sales guys or MBA gals.

From my experience the most popular kid almost never had the time to dedicate to crafting the technical skills necessary to build a mega-successful online business, Social or otherwise. Nerds think about things far more than the typical prep or jock.

<comment><USER17> I think it was Adam Carolla who said that the guys who get laid consistently in high school don't go on to achieve anything. They don't have the drive.

</comment></comment></comment></comment></comment></comment></comment><comment><USER18> Ugh, I hate titles like these.

It's not a graph? Of COURSE it's a graph. It's just a very complex one. Just because you could make many such graphs representing the same relationships doesn't mean it's not a graph.

And it's not social because you're missing someone's crush? Uh, no. It's still social, just incomplete.

A better title for this would have been "The Social Graph is incomplete and complex."

<comment><USER19> _A better title for this would have been "The Social Graph is incomplete and complex."_

A more accurate title perhaps, but definitely not a better title!

</comment></comment><comment><USER20> When you publish content on the internet and it has a relation to your online identity you are just saying: look how awesome I am.

I uploaded a bubble sort in prolog and a b-tree in Haskell ("I'm an enlightened far-reaching hipster hacker").

I quoted Allen Ginsberg on facebook. "Look at me I'm smart and read poetry".

MySpace collapsed and Facebook's clean UI won because most people don't have that much identity.

</comment><comment><USER21> Hmm,

I seems like the post is saying "The Social Graph" isn't a graph 'cause it is a multi-graph with different kinds of connections. That part seems obvious.

But the "it's not social part" is more saying "it's not something to publicly mess with", ie, take the question of signaling interest seriously. That's true but the thing remains a social graph.

I would put it another way. The social graph exists, touching it can be dynamite, yes, can breach some boundaries, yes, publishing a connect is further social act, yet. But technology is about breaching boundaries. Facebook doesn't allow the touchy, fine-grained quality of real world friendships - and there are advantages to this. It has created a lot of connections which wouldn't exist before it. Sure, further refinements may make things more nuanced as in the real world. But the crude, glad-handing Internet world is now _also_ the real social world and won't be going away. There are ways that this is quite good.

</comment><comment><USER22> I agree that the graph is an incorrect representation. Because people don't think that way. But that doesn't mean organic, activity/interest based communities are the only ones possible, or even desirable.

I want a way to be able to communicate with all of my different offline groups without having to be in their physical presence. I also want this on a broad spectrum of public-private.

I think adequately (not perfectly) modelling social context is a solvable problem. It's a matter of UI and metaphor. Here's my take on it: [http://blog.byjoemoon.com/post/7072771434/a-new-metaphor- for...](http://blog.byjoemoon.com/post/7072771434/a-new-metaphor-for-social- networking)

</comment><comment><USER12> I put my thoughts on this article in a blog post. Too long for a comment.

"The Social Graph is Both"

[http://lesspostmoreget.com/2011/11/09/it-is-a-graph-and- it-i...](http://lesspostmoreget.com/2011/11/09/it-is-a-graph-and-it-is- social/)

<comment><USER23> Good essay, thanks.

>They are useful graphs with deficiencies.

This describes _all_ graphs representing real-world, as opposed to purely mathematical, objects and relationships.

</comment></comment><comment><USER24> Lots of good, interesting ideas in that post.

A few comments: In general, what data you capture, always depends on what you want to do with the data. Any data model is an abstraction, which discards a lot of information. This simplification is what makes the data model useful.

Of course, storing social relations as an undirected, graph with a single type of edge, as is done in Facebook, is a gross simplification of real social structure. Everyone knows that; Facebook know that; but the fact is that you can build a lot of useful stuff, with even such a simple model. Is it perfect? No - I'm sure we will do better in future - but you've got to admit its amazingly successful, for such a simple representation.

So, we aren't going to be able to define a format for the social graph that is so rich, that it will capture all possible uses with it - but I don't see why we couldn't define a format that captures enough detail to do many a great many of the things we might want to.

Next point: graphs are amazingly flexible data structures; if you have a multigraph or hypergraph representation, or a set of graphs, you can represent an awful lot of rich information. Don't knock graphs too much. You could build an awful lot of cool communication functionality, if you had really any rich social graph representation, not necessarily the 'perfect' one.

The author also writes: "In other domains, a big graph would be good for recommendations, but friendship is not transitive. There's just no way to tell if you'll get along with someone in my social circle, no matter how many friends we have in common." Of course, friendship isn't strictly transitive; otherwise the giant connected component of a social graph, would be one big clique; but friendship is _highly_ transitive. That's why recommendation works so well in Facebook. If A is friends with B, and A is friends with C, then there is a _vastly_ higher chance that B is friends with C, than with some other random person. Sociologists have called this 'triadic closure' and studied it for years: <http://en.wikipedia.org/wiki/Triadic_closure>

So, while the recommendations won't be perfect, as things like friendship aren't perfectly transitive, they'll potentially be very good. But what recommendation engine is perfect, anyway?

Finally, the author refers to the problem of finding an _adequate_ model as 'AI-hard' - well, as I've said, any model - even the most perfect one (unless we go and make a copy of the entire state of the world) - is going to sacrifice something. So I see why coming up with a perfect model is impossible. But as to coming up with a model that is _adequate_ for a great many of the possible things we might want to build; well, I'd say 'AI-hard' is an exaggeration.

<comment><USER25> Facebook has a heck of a lot more info on relationships than an undirected graph with a single edge type. In the front end alone, they now have a directed "follows" relationship. In their backend, they're keeping track of how much you pay attention to people, comment on their posts, click their links, etcetera, and using it, among other things, to decide what shows up in your news feed and what is silently dropped. Someone posted a link here not too long ago describing how to get the weights Facebook ascribes to your social connections, based on the above sort of metric.

<comment><USER24> Yes, of course they do; they have vast amounts of data; click streams, likes, comment text, etc.

But I guess I'm saying that the core metaphor, with which Facebook did much of its early growth, was that two people are 'friends', or are they are not; and that you see the activity of your friends, and sometimes see activity, and get recommendations, from the friends of your friends.

They built many iterations of the product, and got a very long way, by exposing a very simple social graph metaphor to their users. Even though that model drastically simplifies the world, it has proven to have a lot of utility for users.

Maybe now, because the users are consequently more educated about social networks, a more sophisticated metaphor would go further.

</comment></comment></comment><comment><USER26> rdf technology is coming on strong in late 2011; the tools are getting better fast -- we will be able to represent the social graph in more detail, and correlate it with the 'semantic graph' that shared human experience is coded in.

yes, RDF has taken a while to mature, but look at the time lag between Codd's paper and the commercial release of Oracle. 1000 flowers have been blooming for years and we know a lot about what works and what doesn't.

the trouble with foaf and other 'distributed social graph' is that muggles like Facebook the way it is... they don't care about data portability or privacy; unless a distributed system can provide a better user experience, it's got no hope.

<comment><USER27> I believe Maciej is saying that it's not just an issue with RDF or a technical problem really. He says: "Personally, I think finding an adequate data model for the totality of interpersonal connections is an AI-hard problem. But even if you disagree, it's clear that a plain old graph is not going to cut it."

<comment><USER28> That depends on your definition of a "plain old graph". If you allow arbitrary numbers of edges between nodes and allow edges to carry data, everything will be ok, right? (...right?)

<comment><USER29> In math... and we're talking math if we're talking RDF & graphs, right?... "arbitrary" is perilously close to a synonym for "infinite" and "unbounded".

<comment><USER30> Well, are relationships finite-dimensional?

</comment></comment></comment></comment></comment><comment><USER31> Well said. The ideal "social graph" is just an advertiser's wet dream, and they forget to consider whether it would be useful to the user. Or even possible.

</comment><comment><USER32> Russian guys on the photo

</comment><comment><USER33> """ Right now the social networking sites occupy a similar position to CompuServe, Prodigy, or AOL in the mid 90's. At that time each company was trying to figure out how to become a mass-market gateway to the Internet. Looking back now, their early attempts look ridiculous and doomed to failure, for we have seen the Web, and we have tasted of the blogroll and the lolcat and found that they were good. """

i've been saying this for ages but this guys puts it so much simpler i'm ashamed.

</comment><comment><USER34> discuss.</comment>


Ask HN: I want to quit my job. What am I doing? - <AUTHOR> Hey HN. Using a throwaway because I don't want to upset anybody.
I'm a developer (generalist), living in London, UK and working for a reasonably successful software company, in a reasonably successful position. I've been there for over 2yrs and it was my second job out of Uni, and where I've learned the majority of my skills. I'm 25, male.
For a few months now I've been considering quitting - I even tried once - because my heart isn't in it anymore. I'd planned to hand in my notice tomorrow. I've been fortunate and careful, and can afford to live off of savings for 2 or 3 months and still have left overs.
The trouble is, people are going to ask me, "So what's your plan next?" and the best answer I can think of is, "I'm not sure. I have a few ideas in the backlog."
I want to improve my skills, I want to work on some ideas I've had floating around, and I think if I'm "free" from employment I might be able to see a clearer path of what I want to do with my time. Ultimately, I'd like to be self-employed, but for now the most important thing to me is that I'm working on something where I'm learning a lot, being challenged, earning a modest salary and most of all, enjoying what I'm working on.
Given how indecisive I am about what I want to do, I'm afraid I'll just end up seeming like an entitled, waste-of-time person. That's not what I want.
I know there are many different paths to take in life, and I know I'm young so the world is my oyster. I'm kinda scared of what the future will hold if I do this, but I think if I stay at my job I'll be miserable.
I know there are folks out there who've been through similar things. I can't shake this feeling, it's been going on for months. Any advice? <comment><USER2> Find a new job, while you have your current job, but negotiate with the new company to start after N weeks.

The difference between a good job and a bad job is night and day. It's quite possible you can find somewhere that's very enjoyable. At the very least you can find something better.

<comment><USER3> +1 for a good job making all the difference. Everyone should do something they love, that challenges and vitalizes them. And if you are a young developer, coming out of a good position at a good company, with no dependents, you are in a position uniquely capable of achieving this. Shop around now, and pull the trigger when you have a signed offer letter.

Don't waste years at a place you don't love. Three weeks after finding a better place, you will wonder why you waited so long to make the leap.

</comment></comment><comment><USER4> Since your current job is "not painful" and you don't have a clear plan yet, don't quit. Try the following:

1\. See if you can change anything in the current job to make yourself happy - new project ? new team ? Most people quit because they don't like their boss or their peers. If that's not the case, work with them to make it more challenging.

2\. Use your spare time wisely for soul searching - network, talk to people and find something that will give you the kick. This may even help you become self employed.

Not having a job / not going to work / living off of savings are all unnecessary pressures.

</comment><comment><USER5> > I'd planned to hand in my notice tomorrow. I've been fortunate and careful, > and can afford to live off of savings for 2 or 3 months and still have left > overs.

Hmmm, Isn't 2-3 months worth of saving too low? For comparison, freelancers I know would feel nervous if they don't have cash that can cover living expense for at least 6 months.

I think you should take long vacation and think it over before quitting.

Or, try to secure some freelancing contracts on your area of interests before quitting your old job.

<comment><AUTHOR> Thanks for your reply!

To be honest, by my calculations I'd have roughly 10 months's worth of cash to live off, but I don't want to use it all. I want some of it eventually to go toward a big investment, and some to keep for when I end up in hot water not by my own choosing :)

As for a long vacation... I could possibly take a sabbatical, but I know that I wouldn't want to come back. I can't take any more days off as I've already used most of them, so it'd have to be a sabbatical.

The freelancing idea though, that's a goodun. I dunno where to start, to be honest, but it would be an interesting new experience.

</comment></comment><comment><USER6> If you're bored where you are, perhaps you should try a smaller company. One of the advantages of small companies is you often end up wearing a fair number of hats.

#

I'd also urge you in the strongest possible terms _not_ to live off your savings if you can help it. I've had to do it in the past (the company I was working for folded unexpectedly.) It was one of the most stressful and soul- crushing times of my life: sending job applications off and getting nothing back for sometimes weeks at a time, looking at my balance dwindling and wondering whether I'd be able to pay the rent next month....

Just feels like there's this crushing horizon of doom and no-one wants you, despite the fact you know you could do all those jobs.

I keep about two years wages in various degrees of fluidity (I think that's the word for it, how easily you can get to it) these days, and I still wouldn't want to do it. It's not a happy place to live for any length of time - and in the end you may, as I did, take something you don't _really_ want anyway just to have money coming in while you look for something better.

</comment><comment><USER7> Leaning toward becoming Self Employed . . .

Start listening to these . . . [http://www.startupsfortherestofus.com/](http://www.startupsfortherestofus.com/)

My advice . . .

Stick with your day job for a while . . . save money and fund your side projects, recurring revenue ideas.

Learn and make connections with like minded developers who are creating SaaS Apps and Recurring revenue.

Your day job is a big asset and can fund your own business especially in the beginning until you have spun up a few recurring revenue ideas.

</comment><comment><USER8> I hate to answer with a quote, but this one has been quite important for me lately:

"Your time is limited, so don't waste it living someone else's life. Don't be trapped by dogma – which is living with the results of other people's thinking. Don't let the noise of other's opinions drown out your own inner voice. And most important, have the courage to follow your heart and intuition." - Steve Jobs

<comment><AUTHOR> Raph, the fact that it is important to you is enough to suggest that it is your personal advice to me, so thanks :)

...I sure hope you're not using it as a cautionary tale ;)

</comment></comment><comment><USER9> In my opinion, there's high possibility that you're burned out at the moment.

The desire to quit is one of the things, which I observe when I run out of steam.

Don't rush doing something, which can cost you 6-12 months of your life.

You seem that you're making decisions under emotions, rather execute rationally planned scenario.

Take some break and after that think what you want to do and how to do it.

</comment><comment><USER10> Like others have said quitting without a plan is a bad idea. Start working on finding a job that's more in line with your personality.

You don't know if your ideas have a market. Get users if you think your ideas are worth pursuing. Sell first, build later. In the mean time build up cash to extend your runway. 2-3 months is too short.

</comment><comment><USER11> You might want to set up another revenue source before you quit whether is be freelancing, another job, etc. Personally I'd never leave a job before I did that, regardless of how disillusioned I was.

</comment><comment><USER12> I swear this post feels like I've typed it word for word. I'm pretty much in the same situation except I'm planning for a Masters next year. Hoping to see good advice here.

</comment><comment><USER13> Take a week or two of vacation, think things over. Sometimes just taking a break and relaxing can give you ideas and put things in perspective. It has worked for me in the past.

</comment><comment><USER14> Find a side project and work on it 2-3 hours every evening.

</comment><comment><USER15> The thing is if you quit before you have something else you have no leverage with your new employer, they can get you for whatever salary they offer?</comment>


How to make your responsive mobile website hurt my heart - <AUTHOR> https://elsyms.com/how-to-make-your-responsive-mobile-website-hurt-my-heart/ <comment><USER2> Maybe it was covered in this article and I just don't know the technical term for it, but my biggest pet peeve is when a page is taking forever to finalize the load, but the text is all there so I scroll down and start reading. The page then pops me back to the top of the page and I think it's finished so I scroll back down to where I was and continue reading, only to have it pop me back up to the top AGAIN because it wasn't finished after all.

<comment><USER3> My favorite related issue is when, during the 800 milliseconds it took my brain to activate the muscles required to precisely tap on a 12-pixel-high link, the position of the screen has shifted and I end up tapping something entirely else.

<comment><USER4> CircleCI is notorious for this. Not something you want from your build tool.

I'll add this too, using uBlock, within seconds of loading the page, it's already blocked some 500 requests.

</comment></comment></comment><comment><USER5> The scroll hijacking one is a personal pet peeve. Whatever genius developer that thought of that should be taken out back and shot.

Either that or they should have been required to write the thing while allowing us to set their scroll wheel speed.

/rant

</comment><comment><USER6> Why having webfonts at all? Every computer and mobile phone has tons of fonts already installed. Your fonts definitely don't look better. Please don't waste my bandwith with it.

Why do you make mobile sites that can't be zoomed? This is so annoying. Then sometimes zooming is possible but the sticky headers/footers also zoom and hide the actual content.

<comment><USER7> > Why having webfonts at all? Every computer and mobile phone has tons of > fonts already installed. Your fonts definitely doesn't look better. Please > don't waste my bandwith with it.

Designers are _really_ in love with using literally any font that's not a system font and will throw a fit if they can't do that. It's all _because branding_ , or something.

As a user I hate that crap. Quit wasting my disk and bandwidth with your cutesy garbage and just use system fonts. As a developer I hate that crap, because it's one more thing to worry about.

But the designers/marketers have won this one—they're willing to fight really hard for their special snowflake fonts and have sold it to the people who make decisions as being vital for branding, which is Super Important™.

Add allowing custom, downloaded fonts to the list of things the web is worse for supporting.

<comment><USER8> The reason designers use them is because 95% of their userbase values form over function.

You're obviously in the 5% which values function over form, but surely you can understand most people want things to look pretty, plus the company wants to have a cohesive brand.

I used to be a function-over-form advocate but was converted somewhere along the line after working with some awesome designers, doing lots of a/b testing and talking with the end user.

Both form and function are equally as important as each other.

<comment><USER9> _userbase values form over function_

any stats? I'd say it's the opposite. It would seem to me people want things to work, first and foremost.

 _Both form and function are equally as important_

This contradicts the previous statement, if your userbase is your first priority.

<comment><USER10> > any stats? I'd say it's the opposite. It would seem to me people want things > to work, first and foremost.

It is important to test these kind of assumptions. That's the reason why A/B testing and other analytics tools are used(not to mention communicating with the end user).

</comment></comment></comment></comment></comment><comment><USER11> Please add mystery-meat navigation to the list. It's so painful. I have no idea what those icons do and can't 'mouse over' like a desktop.

<comment><USER12> Seriously, what's wrong with the word "Menu"? It barely takes up any space.

<comment><USER13> Just put 菜单 and be done with it, right?

I think a large part of the push for icons is awareness that not everybody reads English.

<comment><USER12> I really think you're giving too much credit to the hamburger menu pushers. If you need multi-language, translate the word menu.

</comment></comment></comment></comment><comment><USER14> I'm surprised he didn't mention sticky headers/footers. Those can be a huge waste of space, especially if you're browsing in landscape.

<comment><USER7> #1 complaint on every platform, for me. Sticky is very bad. Disappearing on scroll down but reappearing on scroll up is even worse. Just let the things scroll off screen, I can scroll to the top if I want to see anything on the header (spoiler alert: I won't). Old-school sticky _sidebars_ (as in old frame layouts, for example) were totally fine on desktop, but are out of fashion now because they don't translate well to mobile.

I remove sticky elements with the dev console on anything I actually want to read that's longer than a few lines of text—though I can't do that on mobile, so it's worse there.

<comment><USER15> I even dislike that the URL bar on chrome mobile acts like this, even though I can't think of any good alternative.

> Old-school sticky sidebars (as in old frame layouts, for example) were > totally fine on desktop, but are out of fashion now because they don't > translate well to mobile.

What we need is the ability to focus on a div.

</comment></comment></comment><comment><USER16> All of these are bad on the desktop web. After all, some people still have phone company DSL.

</comment><comment><USER17> It's time for browsers to have absolute maximum speed/data settings, where they refuse to load any more once the limit is violated. These should come complete with a built-in dollar figure display (so if you're roaming or on a limited plan you can see exactly what your activity is costing you), and a shaming site with monthly telemetry on who cost users the most per visit.

</comment><comment><USER18> > If the web page has some sort of carousel without lazy loading, it wouldn't > take long to use up 10% of somebody's 1GB allowance.

If you do use lazy-loading, please be sure to do so in a way which works without JavaScript enabled (sadly, this is very uncommon). Mobile users are free to use browsers which load images on demand (indeed, I remember that approach from the 1990s), or perhaps browsers could agree on a standard for different resolutions of images, but breaking the Internet (which is what requiring JavaScript to view content is) to save some people some bandwidth is IMHO a bad idea.

[https://www.robinosborne.co.uk/2016/05/16/lazy-loading- image...](https://www.robinosborne.co.uk/2016/05/16/lazy-loading-images-dont- rely-on-javascript/) looks like a nice technique.

> Render as much server-side content as you can.

> Reduce/remove the third party dependencies you have on your pages.

> Lazy load images whilst maintaining page layout.

> Stop hacking fixes for your mistakes with Javascript.

All good advice, particularly the last bit.

</comment><comment><USER19> Google news falls foul of some of these. I hate how it takes over scrolling and also the annoying way it iframes of the pages you open. You don't own the internet google!

</comment><comment><USER20> Who doesn't do "mobile first" development now? Design the mobile version as your baseline, then _add luxury shit_ for the wide version.</comment>


10 things to know about sleep as the clocks go back - <AUTHOR> http://www.bbc.com/news/health-41666563 <comment><USER2> Just posted 2 hours earlier, 145+ points:

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


'He-Man' Is a Wimp Master (1985) - <AUTHOR> https://www.washingtonpost.com/archive/opinions/1985/04/21/he-man-is-a-wimp-master/b4ab8df1-e21f-42a1-bff9-8375b2308400 <comment><USER2> This is a very strange article read at 33 years' distance. it name checks Jesse Helms, Gary Owen, Alan Alda. Women can't serve in combat units. Greed is still good, All American, even. It was apparently acceptable to call someone a "pantywaist", a comedic word I grant you, but maybe somewhat too sexist. Maybe viewpoints have changed, and not all for the worse.</comment>


Z-Type: Typing Game + Shoot'Em Up (Entry for Mozilla Game On) - <AUTHOR> http://www.phoboslab.org/ztype/

<comment><USER2> Very nice game! As some others have said the progression speed was too slow, I got to level 25 before I got to see any ships basically...

There was one thing that bothered me multiple times though, I couldn't distinguish between t and f fast enough on some occasions, I would suggest switching to a different font.

Also, a High-score list would make things complete.

<comment><USER3> I decided for the Tungsten font over Helvetica/Arial because I felt it fits the game esthetically. I know that's a, from a user experience perspective, pretty stupid reason, but making this game look good was one of my priorities. Maybe I can shift a few pixel on the t/f to make it more clear.

I thought long about how to implement a highscore list, but with a JavaScript game there's really nothing stopping you from submitting fake scores. Even if I verify each word on the server side, a bot that plays the game would be trivial to implement. I have no idea how to make it at least a tiny bit "secure" :/

<comment><USER2> You could have one global list that essentially is a bot-competition (which I think is interesting in itself) and then allows users to create named lists, allowing friends to compete internally.

</comment></comment></comment><comment><USER4> I like that this game avoids the usual trap of typing challenges, namely treating a typo as a fatal problem with serious penalties. Perhaps in the typewriter days this made sense, but nowadays a quick typo and backspace simply causes a minor slowdown.

Z-Type's use of typo-free typing as a simple bonus multiplier provides a penalty for typos without treating them as fatal problems. I can type far more quickly with occasional corrected typos than I can if I slow down enough to make zero typos in the first place. Thanks for handling that case!

</comment><comment><USER5> Fantastic. Looking forward to seeing more games built using Impact. Is Z-Type going to be open sourced, or available on ImpactJS.com?

<comment><USER3> The source is pretty dirty right now, but I'll try to clean it up and release it publicly.

<comment><USER6> Would be nice to have to source -- I could tweak it for people like myself who are trying to learn the colemak layout. The initial word set would just come from the home-row and slowly branch out to other letter positions.

</comment></comment></comment><comment><USER7> I am not a gamer but that was really fun and had to force myself to close the tab to get back to work.

ps. maybe make an option for the font to be slightly larger for those with high-res monitors and/or bad eyesight

</comment><comment><USER8> Very fun. The game has just enough aesthetics to make every letter typed satisfying. I could even feel my typing improving over time.

I like the concept of the different ships, but the game doesn't get hard enough fast enough. I played through 30 levels before I got bored and stopped playing. Great potential, I can't wait to see what comes next.

<comment><USER3> I guess I'm just a slow typist. I will implement a hard mode soon.

Thanks for the feedback!

<comment><USER4> Rather than implementing a hard mode, why not just adapt to the user's typing rate? If the user types quickly and accurately, throw in a few more of the larger ships/words, or advance them to later levels more quickly.

You could also skip to the user's baseline level fairly easily. For instance, if the user types really well in an early level, throw in a quick "wormhole" with a sentence attached, and if they type all the words before it passes, they warp ahead a few levels.

</comment></comment></comment><comment><USER9> The game never seems to get more difficult - it's just an endurance thing.

<comment><USER10> Right around level 27 or so these baddies come in that shoot probably 20 or so individual letters at once at you, and that's when things start getting a bit more interesting...

<comment><USER11> they actually come in earlier, but if you're a fast typist and not too slow on the uptake, you can manage to shoot those before they shoot at you.

I agree, the game is a tad too simple if you're a reasonable typist. Perhaps stressing the accuracy multiplier a bit more would make things more interesting.

</comment></comment></comment><comment><USER12> Love it. Reminds me of Typing of the Dead.

<http://en.wikipedia.org/wiki/The_Typing_of_the_Dead>

</comment><comment><USER13> It's a good game and an interesting way to work on my typing. I only noticed that accurate typing gave a score multiplier around level 30. As a player, it would help to have more feedback on accuracy. As a quick suggestion, maybe some text could appear by the player's ship that says something like "50 keys!" or "100 key combo!".

</comment><comment><USER14> It would be really poignant if it made you type the words to "Anthem for Doomed Youth" by Wilfred Owen:

What passing-bells for these who die as cattle? \---Only the monstrous anger of the guns. Only the stuttering rifles' rapid rattle Can patter out their hasty orisons. No mockeries now for them; no prayers nor bells; Nor any voice of mourning save the choirs,--- The shrill, demented choirs of wailing shells; And bugles calling for them from sad shires.

</comment><comment><USER15> Very nice!

I think I got to level 35 or so I just didn't let the baddies get close ... but once you let them in an little they start shooting letters at you

</comment><comment><USER16> It crashed Chrome on Linux after a while; I'm using the beta channel.

</comment><comment><USER17> Deducting health on typos might be a nice addition, now there is almost no penalty

EDIT : oh never mind, there's a multiplier that resets on typos ...

</comment><comment><USER18> Fun! A game I'm good at for a change. It'd be great if you could add an estimate of typing speed at the end.

</comment><comment><USER19> Played it until my browser crashed at 61. Is it finite and does it ever get harder?</comment>


Why we need an NIH for cybersecurity - <AUTHOR> https://www.cyberscoop.com/nih-for-cybersecurity-dan-kaminsky/ <comment><USER2> Not sure having the government run a standards-making organization is the best idea. From the NIH storing smallpox vials, the NSA hoarding zero-day exploits, the infamous Obamacare website, to the OPM hack, the government might not be the right folks to LEAD the effort. It's not clear that a central organization would be more effective than federations of industry and government players.</comment>


Exploding head syndrome.  I kid you not. - <AUTHOR> http://en.wikipedia.org/wiki/Exploding_head_syndrome

<comment><USER3> Thank you for posting this. I "suffer" from EHS but never knew there was a name for it.

Just as the WP entry says, I experience it just after lying down to sleep. Probably happens 10 or 20 times a year. A loud banging, crashing, or tearing sound occurs in my head. My heart rate goes through the roof immediately, but it's not scary at all. It's very odd. :D

<comment><AUTHOR> Yeah, I actually have this too apparently, though it's very infrequent for me. I'm not sure what's weirder, that it happens, or that it has a name.

Just for the record, I actually found out about this here:

[http://www.reddit.com/r/IAmA/comments/nrf8s/iama_26_year_old...](http://www.reddit.com/r/IAmA/comments/nrf8s/iama_26_year_old_female_who_has_exploding_head/)

<comment><USER4> _sound occurs in my head_

What does that mean exactly? Could you describe it? Does it sound like physically outside but you realize by logic that it "didnt happen", or is it clear right away that it's an imaginary sound?

<comment><USER3> For me, it's usually like an electrical buzz. But sometimes it's more like a gunshot, a tearing sheet of paper, or an indecipherable vocal shout.

The sound does not feel dreamlike at all (like sounds you imagine while in a hypnagogic state.) I can imagine a first-timer might mistake it for an external event and rising in shock to look for the source of the disturbance.

The sound is of short duration (about 0.2s) and is loudest at the end of the sound, cutting off sharply into total silence ("...wwwWWWHOMP!") It's very loud, but not painful like a real report in a quiet room would be. The loudness feels like 120 dB or so. The sound is absolutely "pure," missing environmental cues like position, echo, and pressure. I perceive the location to be smack-dab in the middle of my head, not anywhere outside my physical body (a bit like headphones.) Because of this, and because I have been cued to the impending sound (see below), there is no danger of mistaking it for something real.

The chronology when my head goes boom:

T minus 30 seconds: I'm in bed, eyes closed. It always happens before or at the beginning of hypnagogia.

T minus 10 seconds: I get a feeling somewhat akin to a sudden pressure drop in my ears (but without any popping or physical symptoms). This is a cue that tells me to expect an explosion.

T: The pseudo-aural pressure cue suddenly ends by "transforming" into a short, explosive sound. Heart rate starts to rise rapidly. My eyes remain closed and my musculoskeletal system usually don't react, as the sound doesn't scare or surprise me.

T plus 5 seconds: Heart is beating as fast as it can go. At this point it feels almost exactly like right after snapping awake from a night terror, but without the fear component.

T plus 60 seconds: Heart rate begins to decline to normal levels.

</comment></comment></comment></comment><comment><USER5> Feels like a speeding locomotive rushing through my brain, while you're fully aware of the roaring fury of it and yet totally paralyzed. I can't even open my eyes. When I was 17 I'd get them quite often. One time in that period, my experience could have been described as paranormal. My eyes somehow opened, and the "energy" tore through of my body in a green light that swirled and floated throughout my bedroom. That particular type of experience only happened that one time.

</comment><comment><USER6> I'm really glad I have come across this... I've had this for a couple of years, about once or twice a month. For me it feels like something is applying a lot of pressure to the side of my head, accompanied by a very loud tingling sound... Only lasts for about two seconds, but not something I enjoy

</comment><comment><USER7> I too have this occasionally, never really thought it was odd though, I just get a loud bang which is always accompanied by a flash of white in my vision. I suppose exploding head is an apt name for it :)

I also experience sleep paralysis quite often, does anyone else? I wonder if that's related.

<comment><USER8> In my case the two tend to cluster together. I've found that the EHS is usually triggered by a small physical sound in the environment, like the house ticking as it cools. It was scary as hell for me when it first started happening, but I've grown accustomed to it.

I've never gotten used to the sleep paralysis, but thankfully it is much less common for me. Both seem to be triggered by stress in my case.

</comment></comment><comment><USER9> I used to get that all the time as a kid while waking up. A loud buzzing noise or a bang followed by paralysis, which freaked the hell out of me at the time. It reduced in frequency and eventually stopped when I was 15. I didn't know it was abnormal and never told anyone about it though.

</comment><comment><USER10> I'm hearing drums sometimes. Weird. Or knock on a door.

<comment><USER3> If it's not really, really loud and sudden, I would guess that not exploding head, but a hallucination common to hypnagogic states.

</comment></comment><comment><USER11> In the bible this is referred to as the sound of the river Jordan - <USER2> considered a spiritual experience. I used to get it in deep meditation. Blew my mind.

<comment><AUTHOR> That seems improbable. The Jordan river is mentioned only once in the Bible (Mark 1:5) and it has nothing to do with sound. Nowhere in the Bible do the words "sound" and "river" occur in the same verse. "Sound" and "Jordan" likewise are never found together in the same verse.

<comment><USER11> I count 179 mentions

[http://www.biblegateway.com/keyword/index.php?search=Jordan&...](http://www.biblegateway.com/keyword/index.php?search=Jordan&searchtype=all&version1=9&spanbegin=1&spanend=73&resultspp=500&displayas=long&sort=bookorder)

There are many translations.

"A voice of the howling of the shepherds! For destroyed was their robe of honour, A voice of the roaring of young lions! For destroyed was the excellency of Jordan."

Anyway I didn't come up with that idea. Its just something I read the meditator Yogananda say when I looked it up. He said that hearing the head exploding sound is this spiritual thing and that the bible among other spiritual text alludes to it esoterically when it mentions the roar of the Jordan and the crossing f the Jordan.

My head exploding experience sounded like the tremendous roar of a river inside my head. Happened a few times before I found that spiritual interpretation re: meditation. I haven't done much meditation since then.

<comment><AUTHOR> You're right. I thought the unqualified mentions of Jordan were referring to the country, not the river. But the country of Jordan didn't exist (at least not by that name) until 1921.

</comment></comment></comment></comment><comment><USER12> Reminds me of some other condition, I don't recall the name. I want to say "night terrors". My oldest had serious sleep issues when he was little. So I checked some book out of the library to try to get a handle on it. Most of it was drivel, like "god, I can't believe you thought someone would need that told to them". But it did have one piece of information in it that was useful, and that was about my oldest son occasionally getting up all upset after sleeping for roughly an hour. I eventually realized he only did this when physically exhausted but not mentally exhausted. So he would fall asleep but his mind was still racing. After an hour, he would sit up basically screaming, due to very vivid mental stuff going on. The book indicated he probably wasn't really awake at such times, but was reacting while asleep. I learned to not let him get so physically exhausted and it went away. The problem never returned.

I think it would be neat if someone who has EHS kept a diary/journal and tried to determine if there was some pattern, some trigger event or whatever, for them personally (my assumption being that triggers would vary from person to person but enough such data might yield some generalizations anyway). It sounds like it may be an auditory version of the visual stuff my son experienced.

<comment><USER3> I've snapped awake from night terrors many times, and my personal experience is that exploding head is an altogether different phenomenon (although the adrenaline rush is the same.)

<comment><USER12> Thanks. Though my recollection is that in theory people do not wake up from night terrors. They are asleep while sitting up screaming. I might run it past my son sometime and see what he remembers, even though he was quite young.</comment></comment></comment>


Packet copies: Expensive or cheap? - <AUTHOR> https://github.com/SnabbCo/snabbswitch/issues/648 <comment><USER2> If you think the cost of the instructions to express copying is the main problem I'd call your mental model flawed. That is not the thing to worry about, when moving data the issued instructions matters very little.

No, the thing to worry about is the memory subsystem. How does the data interact with the caches? What DRAM access patterns do I have? How do I flow data as efficiently as possible?

<comment><USER3> Not if you are writing a software based switch, especially one designed to be scriptable.

Which the author is.

Context is everything.

<comment><USER4> Can you elaborate? Is a a software based switch exempt from the memory subsystem?

<comment><USER5> I'm not OC but reading the author's project list, it seems to me that he is working heavily in networking optimization in cases where packages are small enough that won't be invalidated from cache until they are done.

If that were true, then the memory subsystem has little to play in this. However, users of this still have to take the memory in consideration when sending packages, hence the OC's comment about context is everything.

</comment></comment></comment></comment><comment><USER6> The big question is where the packet came from. If a program just produced it, it's probably in cache. If it came in from an I/O device, it probably isn't.

This is why message copying isn't a big cost in modern microkernels. Create message->IPC->copy message->process message is an in-cache operation, if the scheduler and the message passing system are on speaking terms.

<comment><USER7> There is a technology that allows incoming I/O data to be put directly into cache. Pretty useful! :)

I think this is the original introduction: [http://web.stanford.edu/group/comparch/papers/huggahalli05.p...](http://web.stanford.edu/group/comparch/papers/huggahalli05.pdf)

</comment></comment><comment><USER8> New to this, but basing such calculation on purely on CPU capacity would imply a bandwidth to memory (or some cache)

64 B / inst * 2 (read and writeback) * 3 inst / cycle * 3 Gcycle/sec > 1000 gigabytes/sec, which is insane considering 50GB/s is the norm to RAM right now.

*edit: Haswell L1 cache seems to allow a peak bandwidth of 64 byte loads + 32 byte store per cycle, so like other comments point out, this would match the CPU capacity. On the other hand, there is also latency. But it is hard for me to tell how latency factors into this.

Could someone explain how they would decide whether copying packets is cheap or not?

<comment><USER9> >Could someone explain how they would decide whether copying packets is cheap or not?

Run two machines. One runs packet copying software, the other runs non packet copying software. Both run on the same data set. Record the amount of electricity used. Multiply the numbers by the marginal electricity cost and compare. If the number produced by the packet copying machine is not significantly different from the machine that didn't copy packets, copying packets is cheap.

</comment></comment><comment><USER10> Note to Russian HN readers: I'm giving a talk about Snabb Switch in Moscow on Tuesday afternoon at HighLoad++.

</comment><comment><USER11> I worked on a router with multicast and we avoided packet copying with an interesting reference counting scheme:

When a packet arrives, its handle gets 64K references and its 16-bit reference counter has 0 references.

When we are done with the handle (packet transmitted), the references in the handle are added to the counter. If the result is 0, the packet can be freed.

When we duplicate a packet, always it's the case that there is a parent handle which gets split into children. So what do you do? You divide the references among the children: so now you have two handles with 32K references. First one is done, counter will have 32K. Second one is done, counter will have 0 and packet can be freed.

The advantage of this scheme is that there is only exactly one ADD to reference counter per duplicated packet.

For large packets this scheme will be faster than copying. For small packets, maybe not. Even the single ADD is probably a miss and involves moving a cache- line. (anyway, usually you want packet header to be in the handle, so small packets fit in the handle, large packets use buffers).

</comment><comment><USER12> Isn't that instruction timing data assuming a L1 cache hit?

</comment><comment><USER8> Thinking about it again, from my calculation below, if those packets are coming from RAM then you are bound to, say, 25GB/s incoming, 25GB/s outgoing.

Since Haswell L1 cache seems to allow a peak bandwidth of 64 byte loads + 32 byte store per cycle, so this would match the CPU throughput and then this suggests, if the lifecycle is "bring from ram" "copy in and out of L1 cache", "put back in RAM", then those copies may well be free given you are choking on RAM to begin with.</comment>