Live data from Hacker News

Fighting spam with Haskell

code.facebook.com

51–60 of 98 posts

Re: Fighting spam with Haskell

#52
post #4

I am under the impression that a large part of engineering effort at established companies go into porting existing components to a deemed to be more appropriate language for that task. Is it plain impossible to pick the best fit language without implementing a solution in the first place and fleshing out the requirements and challenges that specific to the problem space? Or do the problems evolve fast enough that no…

Plan to migrate to a new implementation every time scale grows 10-100x. Scale changes the relative weights of the concerns in the tradeoff.

Re: Fighting spam with Haskell

#53
post #3

Facebook censors so much and swaps out links. I can't even post a link to https://scientificamerica.com . Their SSL cert is weak and should not be trusted. It is swapped out for phishing scams.

That URL is a typosquatting domain-parking site, so....

Re: Fighting spam with Haskell

#54
post #43

Earlier quoted context omitted.

Also the nice thing about Yesod, is the freely available online book[0]. [0] http://www.yesodweb.com/book

Has the book caught up with the software? Last I checked, the book was written in terms of obsolete APIs that didnt match the yesod-geneterated app boilerplate, and Snoyman said that he didn't have time yet to update the book.

I have been using this site for (yesod 1.4) [http://www.yesodweb.com/book/introduction] and I found the documentation current. Is there something that doesn't compile?

Re: Fighting spam with Haskell

#55
post #43

Earlier quoted context omitted.

Also the nice thing about Yesod, is the freely available online book[0]. [0] http://www.yesodweb.com/book

Has the book caught up with the software? Last I checked, the book was written in terms of obsolete APIs that didnt match the yesod-geneterated app boilerplate, and Snoyman said that he didn't have time yet to update the book.

I have the book print version and that certainly is outdated. But the online version isn't outdated (mostly). The current version of Yesod[0] is 1.4 and according to the book site it targets 1.4. That being said contributing to any of Michael Snoyman's (main yesod developer) project (including the book) is easy and fun. He is very responsive and friendly. :)

[0]https://hackage.haskell.org/package/yesod

Re: Fighting spam with Haskell

#56
post #39

Earlier quoted context omitted.

For example, let's say that one of the things you want to compute is the number of friends of the current user. This value is used all over the codebase, but it only makes sense in the context of the current request (because every request has a different idea of "the current user"). So this is a memoized value, even though in the language it looks like a top-level expression. Memoization only stores results during a…

Thanks for the response. Just trying to expand my brain here =), so I have a followup question. I always thought of memoization as storing the parameters to, and result of, a function call in a memotable. Doing some quick research, I came across this definition of memoization from NIST that sounds more general "Save (memoize) a computed answer for possible later reuse, rather than recomputing the answer." What I unde…

The memo table (map) is a bit of state that is maintained throughout the request's lifetime. When we compute a memoized value, it is inserted into the map, and if we need the value again we can just grab it from the map instead of recomputing it.

The "automatic" bit is that we insert the code that consults the map so the programmer doesn't have to write it. The map itself is already invisible, because it's inside the monad. So the overall effect is a form of automatic memoization.

Re: Fighting spam with Haskell

#57

I learned a few things from this post outside the usual "technical" explanations: 1. They have CORE Haskell contributors on their payroll to deliver this type of project (what this mean is that no... Haskell isn't any better than other language, it's just that they have people who know Haskell very very deep to the compiler level...) 2. In-house custom language eventually does not scale (the EOL is much much much sho…

What you should ask yourself then is, why did they hire core Haskell contributors?

Perhaps to avoid the same situation with FB Messenger Erlang to C++ conversion? What do you think?

Re: Fighting spam with Haskell

#58
post #11
post #9

Earlier quoted context omitted.

Yesod is the most actively developed and popular web framework for Haskell.

For my side project, I use yesod/websockets for the server and haxe for the client. I feel ok with that choice instead using hpaste. Though eventually I would like to see a complete haskell stack. @Lewissham: about the fourth attempt, it just so happens that this was my third attempt at getting something that was right for me as well as maintaining the typesafety. I do realize that code is still not as seamless as I…

Can you expand upon what you mean by complete Haskell stack ? What do you feel are currently missing from Yesod ?

Re: Fighting spam with Haskell

#59
post #17
post #16

Damn you FaceBook. I dislike the underlying premise, the adverts, and (especially) the "real names" policy. But... between great bits of Open Source like React, cool infrastructure projects like this, and a technical culture which seems a whole lot more open than many other big companies, it's getting kind-of hard to go on hating. Walk back a bit from the obsession with open plan offices, and I might just cave...

> But... between great bits of Open Source like React, cool infrastructure projects like this, and a technical culture which seems a whole lot more open than many other big companies, it's getting kind-of hard to go on hating. Walk back a bit from the obsession with open plan offices, and I might just cave... Wholeheartedly agree with you comment, Facebook's engineering blog is truly humbling. There is not a day wher…

Facebook could easily promote more privacy and anonymity while remaining profitable. It could have been a non-profit and aimed to make money without compromising privacy. It wouldn't be as profitable but that's a different story.

Re: Fighting spam with Haskell

#60
post #23

In the throughput graph, why does Haxl perform worse in the 3 most common request types?

The graph is sorted by performance, with the worst performing (not necessarily the most common) on the left. We've also done more profiling and optimisation since we took those measurements.

FXL employed some tricks that were sometimes beneficial, but often weren't - for example it memoized much more aggressively than we do in Haskell. Mostly that's a loss, but just occasionally it's a win. When a profile shows up one of these cases, we can squash it by fixing the original code.

What matters most is overall throughput for the typical workload, and we win comfortably there.

Post reply on HN