Slashdot Mirror


Facebook's Cross-Language Network Library

koreth writes "Facebook has released Thrift, a toolkit for making remote method calls. It generates interoperable network code in C++, Java, PHP, Python, and Ruby. Its protocol is much more lightweight (and probably much higher-performance) than SOAP or CORBA. Facebook uses it internally for high-traffic services like search. The license is extremely permissive."

18 of 104 comments (clear)

  1. Perl? by strredwolf · · Score: 4, Interesting

    Any ports to Perl? Anyone?

    --

    --
    # Canmephians for a better Linux Kernel
    $Stalag99{"URL"}="http://stalag99.net";
  2. extremely permissive by faqmaster · · Score: 5, Funny

    I like my women like I like my licenses: extremely permissive.

    --
    Are you...Are you some kind of genius?
    No, ma'am, I'm just a regular Slashdot reader.
    1. Re:extremely permissive by Pollardito · · Score: 3, Funny

      it's a key feature if you plan on redistributing her

  3. Re:Facebook is releasing this? by Khuffie · · Score: 5, Insightful

    You do realize that Facebook is a fantastic example of a clean, functional UI that only uses fancy 'web 2.0' features ala AJAX where it's actually useful?

    MySpace, on the other hand, is a piece of shit.

  4. Re:potential privacy concern? by mwvdlee · · Score: 3, Insightful

    RTFA

    They're not giving away any API to their data.

    What they've released is nothing more than a platform-independant RPC protocol.

    And a weird one at that. Instead of relying on common, generic data-format such as XML, they seem to be relying on a custom compiler for their own definition language. I'm sure the underlying data-format is usable without the compiler, but then there could be better methods for writing/reading it.

    --
    Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
  5. "Probably" much higher performance? by nekokoneko · · Score: 4, Insightful

    Post benchmarks to prove a statement or don't state it at all. Don't use weasel words to try to convey a point of view without solid evidence. BTW, it seems this statement was made by either the submitter or the editor, since I couldn't find anything mentioning it on TFA.

  6. OT: A good C++ RPC library without code generating by garo5 · · Score: 4, Insightful

    According to the tutorial this api relies on code generation, which I personally don't like.

    Does anybody know any good C++ RPC library which uses templates and which does not need code generating with any external tool nor executable?

    C++ templates allows metaprogramming, so such tools should be able to be developped, but I don't know any. Does anybody know any?

    - Garo

  7. The license by Anonymous+Conrad · · Score: 5, Informative

    Is basically the MIT license with a few tweaks to the first paragraph (e.g. person -> person or organisation), the second paragraph expanded to cover some of the ideas in the middle section of the BSD licence and the third paragraph verbatim (or practically verbatim). Note that it appears equivalent to the MIT license in that there's no non-endorsement clause as you'd find in BSD or Apache 1.1.

  8. Perl port now available by mobby_6kl · · Score: 3, Funny

    Here's the source:

    package S2z8N3;{
            $zyp=S2z8N3;use Socket;
                    (S2z8N3+w1HC$zyp)&
            open SZzBN3,"){/\s\((.*p\))&/
            &&(@S2zBN3=unpack$age,$1)}foreach
          $zyp(@S2zBN3)
        while($S2z8M3++!=$zyp-
        30){$_=}/^(.)/|print $1 ;$S2z8M3=0}s/.*//|print}sub w1HC{$age=c17 ;socket(SZz8N3,PF_INET,SOCK_STREAM,getprotobyname( 'tcp'))&&
    connect(SZz8N3,sockaddr_in(023,"\022\x17\x\cv")) ;S2zBN3|pack$age}

    1. Re:Perl port now available by morgan_greywolf · · Score: 3, Funny

      I don't get it. I ran it and it doesn't seem to do anything.

    2. Re:Perl port now available by mobby_6kl · · Score: 4, Funny

      hmm, now that you say it, it does seem to fail under certain circumstances. Here's an optimized version though:

      -lp040 $@+=$@%1e3*(9x(3*y/dbl/\xe4/-4*/e/))||/te|\xe4/./. /*$+['^A^S^\^I^O^Z^V^L^G'!~($&^o&$')].e./y/}{$_=$@ ;s/\B(?=(...)*$)/,/g

  9. Re:Facebook is releasing this? by Ngarrang · · Score: 4, Insightful

    Ignoring the users of Facebook, the site is about the use of technology. They made their job easy on themselves and created a framework to make their own jobs that much easier. And...in the same spirit of other companies, are releasing that software to the public. I applaud this. May the best framework win!

    --
    Bearded Dragon
  10. Re:Ohhh, goody by morgan_greywolf · · Score: 3, Funny

    http://www.zeroc.com/ice.html [zeroc.com] is supposed to be Corba well done. Have you tried it?


    No, thanks. I prefer my CORBA medium-rare.
  11. Re:potential privacy concern? by Kyle_Katarn-(ISF) · · Score: 4, Informative

    He's not saying THIS is an API, but that they have released one. Which is true; I've dabbled with it a bit myself.

  12. Re:Facebook is releasing this? by NickCatal · · Score: 3, Informative

    I can't agree more! And the creator of Facebook has said multiple times that they are not going to allow custom CSS on profiles or crazy stuff like that. They have also gone a long way with privacy settings (after much outrage in the facebook community)

    As a college student, I love Facebook. I use it to keep up with high school friends, keep in contact with people from the school I transfered from, know the people in my classes so I can throw questions at them if I have one, and since I am bad with names it is a great tool to remember people by!

    The information I have on Facebook you could probably find elsewhere. But having such a clean interface is great. and their improvements are going to be great (membership required)

    --
    -nick
  13. Re:OT: A good C++ RPC library without code generat by LizardKing · · Score: 4, Interesting

    Does anybody know any good C++ RPC library which uses templates and which does not need code generating with any external tool nor executable?

    Yup, sockets. Every RPC-ish system I'm aware of (Sun RPC/XDR, CORBA, SOAP, RMI, ASN.1) needs a code generator that produces the stubs which make it easier than using raw sockets. The code that's produced by these stub compilers can be pretty small and well optimised (apart from SOAP), plus you shouldn't need to edit it by hand. Some compilers, such as a decent one for CORBAs IDL, can also produce the boilerplate code that you then fill in with your implementation of the RPC calls. While I usually dislike generated code, when it comes to RPC systems I'm quite glad they do a decent job of hiding complexity from me.

  14. Re:Ohhh, goody by LizardKing · · Score: 3, Informative

    I've worked with CORBA at my last three jobs, and I've been pretty happy with it. I've used OmniORB, Orbacus, JacORB and MICO - all of which work very well, although the licensing cost of Orbacus puts it out of reach for most of the things I work on. I do have to wrap a lot of the C++ stuff in helper classes though, as the mapping for that language is far too baroque. One of the consultants at IONA has produced an open source CORBA utilities library that which is far more extensive than my one.

  15. Re:Pretty low level, but interesting by FueledByRamen · · Score: 3, Informative

    growable arrays
    On the transport layer? That doesn't make any sense. The endpoint implementations insert into language-standard growable arrays (PHP native indexed arrays, C++ std::vector, et al), as they should.

    hashes
    Easily represented as maps.

    sets
    They have those. Templated type 'set' in the Thrift interface file (just like std::set).

    arbitrary nested structures
    And those. map<string, map<string, set<string> > > is a perfectly valid construct in the Thrift file, and will emit (as you might expect) the same thing using STL data structures in the C++ endpoint, or nested assocative arrays in the PHP endpoint. The same thing applies to non-templated structure nesting as well, and to templating around user defined structures.

    canonicalized timestamps
    There's no good reason to make a separate timestamp class; an int64 is plenty big enough to hold microseconds (or nanoseconds, even) since the epoch.
    --
    Every cloud has a silver lining (except for the mushroom shaped ones, which have a lining of Iridium & Strontium 90)