Announcement

Collapse
No announcement yet.

Apple/LLVM and Clang/LLVM

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

  • #16
    Originally posted by Anandh View Post
    Is Clang/LLVM and Apple-LLVM (https://developer.apple.com/technologies/tools/) are all just same. Or is there any difference in that. Someone can please enlighten me on this. or even pointer to some good article to understand would be great.

    Thanks / Anandh
    "Apple LLVM" is not really a compiler, but a marketing name Apple uses to designate its parser, compiler and static analyzer tools for its IDE. It is indeed CLang/LLVM integrated into XCode, so they are the just the same.

    Comment


    • #17
      Originally posted by Anandh View Post
      Hello there,

      Am newbie in this compiler arena. I have little difficult in understanding various compiler and what does it actually means front-end and back-end in the context of compiler (e.g. I read LLVM compiler used as back-end for Clang.)

      Is Clang/LLVM and Apple-LLVM (https://developer.apple.com/technologies/tools/) are all just same. Or is there any difference in that. Someone can please enlighten me on this. or even pointer to some good article to understand would be great.

      Thanks / Anandh
      Hi,

      Some of my answers will be simplified.

      Apple/LLVM and clang/LLVM are basically same thing.
      Front-end contains the lexer (source code -> token stream), syntax analyzer (token stream -> AST), semantic analyzer (AST -> Intermediate Code).
      Back-end contains the code generator (Intermediate Code -> Machine Code -> Object File).
      Not sure whether the linker is part of the back-end or counts as a different module, but it does the (Object File(s) -> Binary) part.

      When you call
      Code:
      clang <options> <sourcefile1, ...>
      you basically run your source files through all these phases.

      As long as the difference between clang and gcc, there's not much. If you are going to program in Objective-C, then clang is MUCH better, but if C/C++ is your game, they both will perform perfectly fine. What systemd rulez said is complete bullshit.
      Better in clang: (a bit) better C++11 support, faster compile times, modular structure
      Better in gcc: more front-ends (more programming languages are supported), more architectures are supported
      The best thing you can do is write your code in a compiler independent way (normally this should not be a problem) and when you have production ready code, then benchmark the two binaries to see which one is better at that point.

      This was my answer, hope it helped.

      Unrelated:

      systemd rulez, are you the kind of person who always wanted an Apple device, but could never get one, so your "revenge" is calling everything Apple makes shit? I mean, your answers were so retarded, that I laughed my ass off! FYI you can donwload the source code of clang, so you can even check on that little "surveillance capability" which doesn't exist...

      Comment


      • #18
        @Vim_user & erendorn, Thanks for the clarification. But in the link http://www.stroustrup.com/compilers.html strourstrup says AppleC++ and ClangC++ as two different compiler. This is where my confusion started. can you explain what did he mean by AppleC++ and ClangC++?

        Comment


        • #19
          @Vim_user, erandorn, Thanks for the clarification. In the link wwwdotstroustrupdotcom/compilers.html, stroustrup talks about different compilers for C++ and he mentions AppleC++ and ClangC++.. This is where my confustion started. Can you throw some light on this?

          Thanks / Anandh

          Comment


          • #20
            I think he got just confused there because of Apple's marketing strategy to name it Apple LLVM when it is just Clang/LLVM integrated into an IDE.

            Comment


            • #21
              I'd say as Vim_User, as stated in the links below, the released versions may be different (as, code taken at different time), but it's the same project.
              http://developer.apple.com/library/m...1/clang.1.html
              http://stackoverflow.com/questions/1...nd-apple-clang

              Comment


              • #22
                Originally posted by Anandh View Post
                @Vim_user, erandorn, Thanks for the clarification. In the link wwwdotstroustrupdotcom/compilers.html, stroustrup talks about different compilers for C++ and he mentions AppleC++ and ClangC++.. This is where my confustion started. Can you throw some light on this?

                Thanks / Anandh
                Apple LLVM Compiler != clang / llvm from llvm.org.

                For example, Apple LLVM Compiler 3.1 is a modified version of LLVM between 3.0 and 3.1. Modifications are closed source.
                This is possible, because LLVM and CLANG are BSD licensed. This is something predicted because its BSD licensed thing.

                Apple LLVM is optimized for Apple platform. The results produced from both stacks can vary.

                I would use GCC, because it produces much faster binary for much more platforms, the compiler is GPL licensed - no buggy(open)/working(closed source) split present as with LLVM. The pro's of LLVM is that its modular and as such its to IR parsers are more capable to identify syntax bugs correctly.

                I would not consider LLVM to be a serious solution at any timepoint, just as I don't consider BSD to be anything serious unlike MacOSX for desktops and Linux for desktops and servers.

                But if you want to work gratis for Apple, you can ofc contribute to LLVM. Btw, GPL which unlike BSD really protects freedom of subject it covers, is banned from Apple.

                Comment


                • #23
                  Originally posted by brosis View Post
                  I would use GCC, because it produces much faster binary
                  Source?
                  Originally posted by brosis View Post
                  for much more platforms,
                  Which ones do you assume the OP is missing?

                  Originally posted by brosis View Post
                  ... - no buggy(open)/working(closed source) split present as with LLVM.
                  Source?

                  Originally posted by brosis View Post
                  But if you want to work gratis for Apple, you can ofc contribute to LLVM.
                  While Apple will work gratis for you.. not so bad.

                  Please stop trolling, and besides the OP already stated that (s)he wasn't interested in that kind of "discussion".

                  Comment


                  • #24
                    Originally posted by erendorn View Post
                    Please stop trolling, and besides the OP already stated that (s)he wasn't interested in that kind of "discussion".
                    Where is trolling? Your "source" questions?

                    Originally posted by erendorn View Post
                    Originally posted by brosis View Post
                    I would use GCC, because it produces much faster binary
                    Source?
                    Not source, binary.

                    Originally posted by erendorn View Post
                    Which ones do you assume the OP is missing?
                    Troll. It is fact GCC supports much more platforms, it is feature - not everyone needs all features. For example LLVM is miles behind GCC in speed, not everyone one needs speed as well.

                    Originally posted by erendorn View Post
                    Originally posted by brosis View Post
                    no buggy(open)/working(closed source) split present as with LLVM.
                    Source?
                    Here and here - "License: Proprietary freeware with opensource components".

                    Originally posted by erendorn View Post
                    While Apple will work gratis for you.. not so bad.
                    1) Its not my problem how Apple does business.
                    2) Apple banned GPL, so Apple is not my problem as well.
                    3) I don't use Apple either, not my problem.
                    4) If Apple cared, they'd modularize GNU GCC or use any copyleft license. I see LLVM strictly as opencore - opencore concept is "rip off what you can". So, why bother?

                    Comment


                    • #25
                      Originally posted by Anandh View Post
                      Systemed rulz, My question is not related anything with GCC or which compiler is best. My question is all about the difference between Clang::LLVM and Apple::LLVM-if there is or both are same. please reply only if you can answer anything relevant to the question of this thread.
                      Apple's LLVM is just a branch of upstream Clang/LLVM. Upstream may have more bug fixes or performance work that Apple's branches lack, since most work happens on the main branch. Apple's branch may have some new OS X or iOS fixes, which get upstreamed in most cases (saves them work in the long run to do so).

                      In general, it's like a distribution's Linux kernel. Same thing, but older and maybe with some distro-specific patches that generally get upstreamed eventually.

                      Comment


                      • #26
                        Originally posted by brosis View Post
                        1) Its not my problem how Apple does business.
                        2) Apple banned GPL, so Apple is not my problem as well.
                        3) I don't use Apple either, not my problem.
                        4) If Apple cared, they'd modularize GNU GCC or use any copyleft license. I see LLVM strictly as opencore - opencore concept is "rip off what you can". So, why bother?
                        For what it's worth, I don't think any company "bans" GPL -- they're just complying with the terms of the GPL license by making sure they don't mix GPL-licensed code in with proprietary-licensed code.

                        Comment


                        • #27
                          Originally posted by bridgman View Post
                          For what it's worth, I don't think any company "bans" GPL -- they're just complying with the terms of the GPL license by making sure they don't mix GPL-licensed code in with proprietary-licensed code.
                          The TOS for the iTunes Store and the App Store from Apple are not GPL compatible, which caused GPL licensed software to be removed from them: https://www.fsf.org/blogs/licensing/...pl-enforcement

                          Comment


                          • #28
                            Originally posted by Vim_User View Post
                            The TOS for the iTunes Store and the App Store from Apple are not GPL compatible, which caused GPL licensed software to be removed from them: https://www.fsf.org/blogs/licensing/...pl-enforcement
                            Interesting, so the TOS's don't have a carve-out for free software. Didn't know about that, thanks !

                            Comment

                            Working...
                            X