5 ms·
Funny that D claims to be the language "what C++ wanted to be". It drops source compatibility to C and only provides ABI compatibility. Source: http://www.prow
by qznc 14y ago
Funny that D claims to be the language "what C++ wanted to be". It drops source compatibility to C and only provides ABI compatibility.
Source: http://www.prowiki.org/wiki4d/wiki.cgi http://www.prowiki.org/wiki4d/wiki.cgi
- tspiteri 14y agoFunnily, D demonstrates why C compatibility is so important: without C compatibility the adoption would be very low.
- betterunix 14y agoWhich is basically the only thing C has going for it: we have lots of systems written in C, and so C compatibility becomes important for new systems. C itself is not doing anything to make any system better (and C's focus on dangerous low-level operations has created a software ecosystem that is constantly teetering on the edge of oblivion), but nobody is willing to put in the effort needed to get rid of C and move the programming world forward.
- klodolph 14y agoYou're disparaging C for focusing on "dangerous low-level operations", but you should be singing its praises for delivering us from what came before it: truly low-level languages like assembler, dinosaurs like FORTRAN, and tentacled sea-monsters like ALGOL 68. > nobody is willing to put in the effort needed to get rid of C This statement is wrong on multiple levels. 1. People are willing to put in the effort to move beyond C, and it's been happening for four decades. C++, Java, Python, C#, Haskell, Ruby... 2. Getting rid of C for new projects universally is not really desirable. It's still the only thing I would choose for writing the majority of an OS kernel, where dangerous low-level operations are necessary. For the same reason, we will never ditch assembly. 3. Rewriting old C projects in newer languages is often ill-advised. Source code contains the knowledge of those who worked on it, it is used to describe solved problems. Rewriting code means solving those problems over again, relearning the encoded knowledge, and making bugs that were fixed long ago.
- jejones3141 14y agoAlgol 68 is really not that complicated. It goes to a lot of trouble about a few things that didn't turn out to be too important (e.g. the "book model" of I/O), but it is a model of simplicity and elegance in comparison with C++.
- klodolph 14y agoIt sounds like you're damning ALGOL 68 with faint praise. C++ is the exemplar of complexity and ad-hoc features. If you asked me how my blind date went, and I reply, "She smelled better than the inside of a septic tank," I'm sure you would know what's up.
- darkarmani 14y ago> Which is basically the only thing C has going for it...C's focus on dangerous low-level operations has created a software ecosystem that is constantly teetering on the edge of oblivion Wow! How would you propose giving access to low-level operations? Writing in assembly? > but nobody is willing to put in the effort needed to get rid of C and move the programming world forward. So, you want me to write DSP code in Python? How is that going to work?
- betterunix 14y ago"Wow! How would you propose giving access to low-level operations? Writing in assembly?" How about making it possible to get low-level pointers and to do low-level operations, but not force programmers to do such things just to do something as simple as concatenate two strings? "So, you want me to write DSP code in Python? How is that going to work?" Who said anything about Python? There are a lot of other languages out there. There are Lisp systems that will let you access special CPU opcodes, low-level pointers, memory-mapped I/O, etc. There are hard real-time systems written in Ada. Even if you could show that C is the absolutely best-performance language for some particular operation, why would you write an entire system in C? If it were me, I would write the one function in C, and then call it via an FFI in a high level language. Why constrain your ability to express your design for the sake of a single function?
- epsylon 14y agoAnother language, whose design is imho superior to both C++ and D is Eiffel. In his book Object-Oriented Software Construction, Bertrand Meyer explains how the language is developed to fit the OO paradigm. (I recognize though, that some of his arguments in favor of is own language are really ridiculously biased) As far as I know, Eiffel's support for a truely usable and flexible multiple inheritance is unique among all programming languages, due to a clever renaming mechanism. Sadly the language didn't gain much traction over the years (for reasons due to library support and lack of environments). With the whole revival of functional (and hybrid) languages, I think that good old structured OOP as Bertrand Meyer envisioned will remain the realm of C++ for performance critical applications and C#, Java (and others) for more entreprisey stuff.
- oddthink 14y agoWhen I'm thinking OO, I'm a big enough fan of the Liskov Substitution Principle that I still like Sather over Eiffel. The whole covariant argument thing seems like a solution in search of a problem. Well, a problem other than textbooky attempts to force a real-world ontology (Animal eats Food, Carnivore eats Meat) on the class hierarchy.
- epsylon 14y agoYep, as far as I understand that's one of the criticisms addressed to Eiffel. Covariance and contravariance in a type hierarchy both have their usefulness in a type hierarchy, though. I didn't know about Sather, I'll have a look at it. Thanks for that !