Announcement

Collapse
No announcement yet.

Warp: Facebook Open-Sources A Super Fast C/C++ Pre-Processor

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Warp: Facebook Open-Sources A Super Fast C/C++ Pre-Processor

    Phoronix: Warp: Facebook Open-Sources A Super Fast C/C++ Pre-Processor

    Following Facebook's announcement of the Hack language and being one of the organizations backing the new WebScaleSQL, Facebook developers ended out last week by announcing Warp, their latest open-source contribution...

    http://www.phoronix.com/vr.php?view=MTY0ODg

  • #2
    But...but...but...Facebook purchased Oculus Rift, and are therefore evil.

    Does not compute.

    *head assplodes*

    Comment


    • #3
      Sounds very useful. What would be even more useful is eliminating the unnecessary parts of a header for each use case: when including a header for class Foo, most code only needs to know about public members, how big class objects are, and what the vtable looks like. Changing private non-virtual functions (not called inline) or the type of private fields (in ways that don't change size/alignment) shouldn't require recompiling most sources.

      Comment


      • #4
        My gut feeling is that warp is probably good.

        A big chunk of a preprocessor job is to manage the dependencies which is a directed flow graph problem.

        I would say that FB must have a couple of experts in graph algos and possibly few good tricks to efficiently work with graphs.

        Comment


        • #5
          Originally posted by lano1106 View Post
          A big chunk of a preprocessor job is to manage the dependencies which is a directed flow graph problem.
          It's not. One #define rule can change what happens in a #included file. That's the biggest problem with the preprocessor.

          Comment


          • #6
            I was going to ask when it will be integrated to llvm or gcc preprocessors, then saw it was written in D.

            Comment


            • #7
              Originally posted by kaprikawn View Post
              But...but...but...Facebook purchased Oculus Rift, and are therefore evil.

              Does not compute.

              *head assplodes*
              If occulus rift is used internally by Facebook for development, you can expect nice things to come out of it.
              If occulus rift is used for Facebook customers, you can expect less nice things.

              Comment


              • #8
                Code from Facebook requires close examination

                Originally posted by erendorn View Post
                If occulus rift is used internally by Facebook for development, you can expect nice things to come out of it.
                If occulus rift is used for Facebook customers, you can expect less nice things.
                A lot more to this than Occupus Rift. I am not familiar with that device, but I am intimately familar with Facebook's reputation, refuse to have an account with them and encourage others to follow the FSF advice to stay away from their online "service."

                Due to the militantly anti-privacy nature of Facebook, all code coming from them needs to be examined closely by parties with competing interests. I do not have the skills to do this, but I know that malicious compilers have been made by hacking gcc as proof of concept. Probably this code will be fine, but I would wait to use it until it had been carefully done over. A compiler really has a lot of power over binaries made with it.

                I have applied this same standard to Google, and myself found an issue with Chromium: no matter how you set it up, and even with Javascript blocked, it reports too much fingerprintable information and Panopticlick always identified is as "unique." This I do not regard as an accident, and induced me to uninstall Chromium over browser fingerprinting.

                Comment


                • #9
                  Originally posted by curaga View Post
                  I was going to ask when it will be integrated to llvm or gcc preprocessors, then saw it was written in D.
                  Yes although it doesn't seem to be a huge project, hopefully someone can take the concepts and rewrite it in c/c++ so it can benefit llvm/gcc.

                  Comment


                  • #10
                    Originally posted by lano1106 View Post
                    My gut feeling is that warp is probably good.

                    A big chunk of a preprocessor job is to manage the dependencies which is a directed flow graph problem.

                    I would say that FB must have a couple of experts in graph algos and possibly few good tricks to efficiently work with graphs.
                    FB has hired experts from many fields, but the author of the tool is Walter Bright. Walter Bright is a self-taught compiler writer without a formal degree in computer science. Few years ago he did not know what higher order functions are, but he seems to know a thing or two about low level optimizations.

                    Of course the whole FB language ecosystem is silly. We're expecting a real module system in the coming versions of C++. The include based system is a temporary solution and almost no other language today uses that kind of legacy system. It's terribly inefficient. See these slides http://llvm.org/devmtg/2012-11/Gregor-Modules.pdf

                    But this tool is consistent with FB's eagerness towards PHP. PHP is probably the worst of the contemporary web programming languages. I'm not saying it won't work, but it was originally designed for small scale personal home pages, thus the name. A lot of work has been required to improve PHP. It still sucks compared to other similar languages with more thought on design, written by people with more formal academic knowledge. Facebook wanted to create a better compiler for PHP. They'd have come up with a much better tool with a better language (in terms of academic language research), but they probably wanted to produce a more reasonable tool for legions of cheap and ignorant mediocre programmers from public colleges and 3rd world countries with a weaker educational system.

                    Comment


                    • #11
                      Originally posted by tarceri View Post
                      Yes although it doesn't seem to be a huge project, hopefully someone can take the concepts and rewrite it in c/c++ so it can benefit llvm/gcc.
                      C++ is constantly improving. Many of D 1.0 features were later implemented in C++. Some features still look a bit different in C++, but it's only about the syntax and the look'n'feel. I'd expect D to have some effect on C++, but eventually C++ will likely win. People want a continuous standard and clear upgrade path. D breaks compatibility in too many ways and it has smaller ecosystem and very few commercial players shoving truckloads of money on it.

                      Comment


                      • #12
                        Originally posted by caligula View Post
                        C++ is constantly improving. Many of D 1.0 features were later implemented in C++. Some features still look a bit different in C++, but it's only about the syntax and the look'n'feel. I'd expect D to have some effect on C++, but eventually C++ will likely win. People want a continuous standard and clear upgrade path. D breaks compatibility in too many ways and it has smaller ecosystem and very few commercial players shoving truckloads of money on it.
                        I'm waiting for Rust: memory safe with much more low-level flexibility than D. In the mean-time D is a nice language which never took off, C++ is an ugly but powerful language that's getting more and more complex, and... why did this discussion devolve three ways into Warp, FB is evil, and language X >> lang Y?

                        Comment


                        • #13
                          Originally posted by Cyborg16 View Post
                          I'm waiting for Rust: memory safe with much more low-level flexibility than D. In the mean-time D is a nice language which never took off, C++ is an ugly but powerful language that's getting more and more complex, and... why did this discussion devolve three ways into Warp, FB is evil, and language X >> lang Y?
                          1. I'm waiting for Rust as well. Awesome language with so much potential. It's almost here!! >.<
                          2. Because it's the Phoronix forums. We can't keep on-topic for more than 5 posts (usually less... I've seen the very first comment derail the entire thread *shrug*)

                          Comment


                          • #14
                            Originally posted by Cyborg16 View Post
                            I'm waiting for Rust: memory safe with much more low-level flexibility than D. In the mean-time D is a nice language which never took off, C++ is an ugly but powerful language that's getting more and more complex, and... why did this discussion devolve three ways into Warp, FB is evil, and language X >> lang Y?
                            "FB is evil" is clearly trolling and off topic. Language X >> language Y is on-topic. I was merely explaining the issues behind slow compilation times in C++. I'd say the Warp is a great product, but it kind of solves a non-problem. If people didn't use such crap language likes C++ (the main problems are pre-processing, syntactical and it's lack of module system in this case) or used an improved future version of C++, there would be less need for Warp. You can think of it like the next step after fixing a slow algorithm by shoving more hardware on it. Now the algorithm is still weak, but you're using a micro-optimized I/O framework to mitigate the cost. The "Real Solution" would be to fix the language.

                            Comment


                            • #15
                              Originally posted by caligula View Post
                              FB has hired experts from many fields, but the author of the tool is Walter Bright. Walter Bright is a self-taught compiler writer without a formal degree in computer science. Few years ago he did not know what higher order functions are, but he seems to know a thing or two about low level optimizations.
                              Huh. What's with the bashing, and that "if-no-formal-education-he-must-be-clueless" attitude?

                              He's actually the designer of the D programming language. Funny nobody mentioned that...

                              I don't really find that surprising that he did work for Facebook, given that Andrei Alexandrescu (the interviewer in the announcement) works at Facebook nowadays, and knowing they are friends. Andrei himself is a big D proponent and guru (in addition to being a C++ guru).

                              Comment

                              Working...
                              X