Announcement

Collapse
No announcement yet.

D Language Still Showing Promise, Advancements

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

  • D Language Still Showing Promise, Advancements

    Phoronix: D Language Still Showing Promise, Advancements

    The D programming language continues to advance and show signs of promise as a high-quality computer programming language that may eventually prove competition for C. Last month there was the 2013 D programming language conference where a lot was discussed...

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

  • #2
    Will never replace C/C++ until they drop the GC, there's no real argument for GC in a systems language, using C++11 smart pointers feels really good.

    Comment


    • #3
      Just as a heads-up, all the conference videos can also be found on YouTube here:
      http://www.youtube.com/channel/UCzYz...oQaQYXw/videos

      Originally posted by peppercats View Post
      Will never replace C/C++ until they drop the GC, there's no real argument for GC in a systems language, using C++11 smart pointers feels really good.
      Nope. GC can actually be more efficient than manual memory management. And those who absolutely must go around it, it's easy to either turn it off or simply avoid using functions that invoke it. See this presentation for more information on the subject:
      http://www.youtube.com/watch?v=1MF5bcmvJ0o

      Comment


      • #4
        Originally posted by GreatEmerald View Post
        Nope. GC can actually be more efficient than manual memory management.
        no
        And those who absolutely must go around it, it's easy to either turn it off
        Enjoy not being able to use the standard library.

        Comment


        • #5
          Originally posted by peppercats View Post
          no
          Yes. Have you looked at the presentation?

          Originally posted by peppercats View Post
          Enjoy not being able to use the standard library.
          Not all standard library functions invoke it; and whenever you need to use something that does invoke it, and you do that sparingly, the GC won't slow you down. Again, refer to the presentations. Here they are using D in a game engine by avoiding GC. Here they are using D in a performance-critical environment and still have the GC enabled.

          Comment


          • #6
            Well, GC can be more efficient than manual memory management, if the manual management is badly implemented .

            D is more an alternative to C++ than to C, due to its high complexity and similar features. On the other hand, Go can be viewed as a better C (possibly slower and not as versatile, but with great improvements and simplicity.)

            Comment


            • #7
              There is also Rust, which is exactly like D (C ABI compatible, focus on productivity and clarity, neat syntax) except it uses manual memory management if you really want it.

              I always see D as the performance nuts Java or C# - you get native performance and garbage collection, better features (function pointers / references, lambdas, and contracts are wonderful, global scope, and C# delegates don't compare) and I see Rust as the functional programmers C++ (syntax brevity, less boilerplate, only downsides are that it carries over some syntax pitfalls).

              Comment


              • #8
                Originally posted by stqn View Post
                Well, GC can be more efficient than manual memory management, if the manual management is badly implemented .

                D is more an alternative to C++ than to C, due to its high complexity and similar features. On the other hand, Go can be viewed as a better C (possibly slower and not as versatile, but with great improvements and simplicity.)
                The problem with GC is not speed, but lack of control, IMHO. I want to know when things get collected, for low level programming. So, the smart pointer idea works better than GC for that type of work, I think

                I agree that D compares with C++, not C. I was surprised when I saw Michael's article.

                Go, sure, it is interesting. I don't think it is a C replacement, but it might become a low level language of interest for many applications. What I have in mind is that easy multithreading will become more and more relevant. Where I work, we are using 24 virtual processors in our workstations. I can see 100 arm cores running desktops in a few years. Giving people a language that is 20% slower _per_ core, but allows them to easily distribute the code to a 100 threads, hell, isn't that sweet!

                Comment


                • #9
                  Another solution for the pointer, garbage collection problem is Automated Reference Counting:
                  http://en.wikipedia.org/wiki/Automat...rence_Counting
                  http://stackoverflow.com/questions/8...-pros-and-cons
                  Seems very promising, next big thing in programming languages.

                  Love the concept of ranges and slices in D.
                  Although using a syntax with open interval for the upper limit comes over a little non-intuitive and strange to me.

                  http://dlang.org/d-array-article.html

                  (Even saw an example that needed to do extra calculations because it was one less than the actual end.
                  The choice of how ranges work could have been better.)
                  Last edited by plonoma; 06-19-2013, 01:41 PM.

                  Comment


                  • #10
                    Originally posted by plonoma View Post
                    Another solution for the pointer, garbage collection problem is Automated Reference Counting:
                    http://en.wikipedia.org/wiki/Automat...rence_Counting
                    http://stackoverflow.com/questions/8...-pros-and-cons
                    Seems very promising.

                    Love the concept of ranges in D.
                    Although using a syntax that tells not to include the number that says where to stop comes over a little non-intuitive and strange to me.
                    (Even saw an example that needed to do extra calculations because it was one less than the actual end. The choice of how ranges work could have been better.)
                    You mean the ARC that got added in C++11 in the form of Smart Pointers, Shared Pointers and Widgets? :P

                    Comment


                    • #11
                      The D devs are very aware of the common points of criticism (in short: dynamic/shared libs, stop-the-world GC), and limiting the amount of allocations in phobos is AFAIU on the todo list.

                      There was a concurrent gc library for D1 (CDGC) but it hasn't been ported to D2. It looks like it will be, though.

                      Anyway, the CDGC author's dconf talk: Concurrent Garbage Collection for D by Leandro Lucarella

                      Comment


                      • #12
                        Originally posted by Ericg View Post
                        You mean the ARC that got added in C++11 in the form of Smart Pointers, Shared Pointers and Widgets? :P
                        Yeah, something like this kinda. ARC is neat because it pushes things to compile time.
                        Read up on the C++11 new pointers and have found some problems with it: http://www.codeproject.com/Articles/...Smart-Pointers
                        Seems like we need some better semantics than C++ can provide, and the earlier attempts is now starting to create legacy stuff.
                        The behaviour is still not really consistent and you need to take special precautions to not fail.
                        It's coming closer but it's still not as reliable and error-resilient as I would like it to be.

                        Comment


                        • #13
                          First off, D isn't a C substitute. It's a C++ substitute. If you're in the market for a C substitute, try golang.

                          Now, while I detest big OO languages like C++ and Java, D at least does it right. In fact, If you entertain the basic premise that large OO language are some times necessary - say, for closed source game engines where there must be some very good abstractions around some very tough math, D is C++ done right.
                          D takes every feature C++ has to offer, and redoes it in retrospect properly. The syntax is coherent and consistent. The standard library isn't the random grab bag that C++ is but has some very specific goals and functions. And most importantly D was designed from the grounds up with a vision in mind unlike the randomness C++ has become.

                          So, if you're a C++ programmer that is working on a pet project, you might as well go with D. You won't regret it. If you're part of some closed source library project that has the leeway to experiment a little, D just might be right for you.
                          Even if you're a hobbyist that dislikes C++, you can do well to learn some D (like myself) so you can fine tune your hate of the concept rather than the implementation Then you can go ahead and fall in love with golang :P

                          Comment


                          • #14
                            Originally posted by c117152 View Post
                            Even if you're a hobbyist that dislikes C++, you can do well to learn some D (like myself)
                            Indeed. Though I like both the concept and implementation. Writing in D is just a lot faster and easier than writing in C (and to a slightly lesser extent than C++), and just like C++ and unlike Java it doesn't force you to use OOP. So in a way it's a good C replacement as well, although C isn't as direct a competitor as C++ is. Also, like Walter Bright said in the keynote, its nice and coherent syntax makes you feel good about writing code in D, because the resulting code is just aesthetic-looking and is very readable, if you use the proper language features (templates, array slicing, contracts, Ddoc, unit tests etc.).

                            Comment


                            • #15
                              Originally posted by phoronix View Post
                              Phoronix: D Language Still Showing Promise, Advancements

                              provably correct, and of industrial quality. By provably correct they mean it provides provable memory safety, provable purity and immutability,
                              http://www.phoronix.com/vr.php?view=MTM5MTg
                              At first I toght about being "probably", not "provably". Then I found this word exists and as wiktionary puts, it comes from provable -> -> proven -> prove -> proof

                              I'm not a native speaker, so this amuses me and I always find words I don't know to learn more about the English language

                              Comment

                              Working...
                              X