1. 35
  1. 8

    I have to say this post confused me a little bit with terminology leaving me spinning as to what was “Better C” and what was “the subset of D’ the author was writing about. I am a bit jet lagged and my reading concentration is low but still I think I would be confused even at normal capacity.

    I do wish the post had started with a more explicit abstract as follows:

    One draw back of the D language is that, while C libraries can be easily called from D, the converse is not true. The D language compiler now adds a new compiler switch -betterC that will compile a subset of the D language to a form that allows much easier linking from C code.

    And in the rest of the article, a clearer distinction (by more careful use of terminology) between the -betterC mode of the D language and the “A better C” Stroustrup paper and concepts, should be made.

    Very interesting material.

    1. 6

      This is really interesting!

      Add D to the list of 1000 things in CS I need to learn.

      1. 4

        Anyone that likes this should also check out SafeD:

        https://dlang.org/safed.html

        So, it’s one whole language that’s a quick-to-compile alternative to C++ with two, safe subsets depending on use.

        1. 5

          http://dlang.org/spec/function.html#function-safety is probably a better link. My understanding is that @safe is possible to use under -betterC, that is, they’re not really two separate subsets. -betterC is purely subtractive, that is, it’s not a disjoint subset, but purely a subset.

          1. 2

            Thanks, that’s a good catch. There’s probably overlap if each just subtract features from same language.

            1. 4

              Yes, -betterC (again, in my understanding) is essentially “remove the runtime”, and @safe is “disallow memory-unsafe operations,” so you could feasibly want to use one or both depending on your objectives. Since they’re sort of on different axes, I don’t think there’s overlap.