W
Walter Bright
JohnQ said:I didn't see anything about error processing on the mars site. What does D
provide in the way of error processing machinery?
What kind of errors are you referring to?
JohnQ said:I didn't see anything about error processing on the mars site. What does D
provide in the way of error processing machinery?
There is a lot of complexity in C++ that exists not to serve the problem
domain but to be backwards compatible with design decisions made 20-25
years ago. If you're willing to give up backwards source compatibility,
a lot of simplification can be done that does not give up the problem
domain.
Here's one small example: the use of < > to delineate template
arguments. It results in grammatical ambiguities, with wacky kludges to
work around them, and adds no power.
Here's a one huge example: exported templates. EDG reports taking 3 man
years just to implement that, whereas if C++ used a module system, then
one gets exported templates for free.
C++'s implementation difficulties have caused C++ users a decade of
troubles with incompatible, incomplete implementations. Being hard to
implement most definitely affects users in a negative way.
The advent of C++ saw a major shrinkage in the number of compiler
vendors - at one point in the 80's there were 30 (thirty) C compiler
vendors for the IBM PC. Where are they now? The implementation
difficulties of C++ were a factor in putting them out of business. Fewer
vendors is not to the users' benefit.
Here are some things that can be simplified:
http://www.digitalmars.com/d/template-comparison.html
Walter Bright said:What kind of errors are you referring to?
Walter Bright said:I've already explained here some of that.
D's templates are arguably more powerful than C++'s. You can decide for
yourself: http://www.digitalmars.com/d/template-comparison.html
Walter Bright said:I did, and there isn't.
BTW, you can pick up C++ compilers without exception handling and
templates by getting an older version of Zortech, Microsoft, or Borland.
How much $$$ are you willing to pay for one? <g>
C++ is already difficult to learn, use and maintain. I disagree about
implementation not being a concern.
And of course minimizing the complexity is the best solution of all.
Well probably not to the degree that I'd prefer then.
Obviously!
Trust me, I did.
JohnQ said:The kind that are traditionally handled in C++ with the exception machinery
or return codes or passed-in errror handlers, etc.
Dave Rahardja said:C++ is indeed difficult to learn. However, _subsetting_ the language is
not
the solution--moving to a _different_ language more suitable to the task
is.
Remember, the problems that programmers want to solve still exist.
The complexity of the language reflects the complexity of the problem
domain.
Subsetting the language is not going to make the complexity of the problem
domain go away--it just makes it more difficult for users to express it.
If you say so.
I think I've made just about as much of a point as I'm going to manage in
this
thread. I'll bow out with this summary of my opinion:
- Complexity in C++ is driven by many things, but primarily by a genuine
user
market demand to express more complex problem domains in that language.
- Subsetting C++ will necessarily reduce the problem domains that can be
expressed in the language.
- Having compiler writers deal with the complexity of the language is
preferable to having the users deal with the complexity of the problem
domain.
- There are alternative languages that can more simply express similar
problem
domains that C++ addresses. However, they are neither C++ nor a subset
thereof.
Both valid points. However, the C++ community constantly exerted pressure
on
the compiler writers to be more and more conformant--why? Because the
features
that C++ brings are genuinely useful in addressing real-world problems. To
again refer to the OP's assumption, a subset of C++ doesn't seem to
satisfy
the consumer, otherwise demand for a fully-conforming compiler would have
ceased when "enough" features were implemented by "most" compiler writers.
An example of a feature that most users can live without is the export
keyword
that you mentioned in another post. It seems that demand for it is very
low.
Although EDG spent a tremendous amount of time and money implementing it,
it
appears that the feature has not turned into a major competetive advantage
over other vendors, who have shown little interest in supporting it.
I'm sold on D! However, it was my assumption in this thread that
redefining
the syntax of the language was out of the question.
Dave said:I agree with you that the burden of backward compatibility has made C++ a
suboptimal language. A clean-sheet design could be much better. A brief
reading of D makes me appreciate the clarity of notation that it brings.
However, my post was framed in the context of the OP's desire to create a
"small C++", presumably agreeing on a _selection_ of features in C++ (written
in valid C++) that will benefit the compiler writers, and not rewriting the
language itself.
Ok.
Both valid points. However, the C++ community constantly exerted pressure on
the compiler writers to be more and more conformant--why? Because the features
that C++ brings are genuinely useful in addressing real-world problems. To
again refer to the OP's assumption, a subset of C++ doesn't seem to satisfy
the consumer, otherwise demand for a fully-conforming compiler would have
ceased when "enough" features were implemented by "most" compiler writers.
An example of a feature that most users can live without is the export keyword
that you mentioned in another post. It seems that demand for it is very low.
Although EDG spent a tremendous amount of time and money implementing it, it
appears that the feature has not turned into a major competetive advantage
over other vendors, who have shown little interest in supporting it.
I'm sold on D! However, it was my assumption in this thread that redefining
the syntax of the language was out of the question.
JohnQ said:A strict subset wasn't the goal for the final alternative language. An
exercise would be to see how close one could stay with C++ syntax, still
having adequate capability while removing the hard-to-implement things.
JohnQ said:writers.
Well maybe for lack of there being alternatives. Also, all the potential
participants probably aren't in the marketplace because they deem C++ to
inaccessible. If C++ is such a darned good general purpose language, why do
so many use java and C# and ....? (Because templates aren't nearly as
important as the facilities the other languages provide? Is C++ going to
become a "domain-specific language" because the focus is too much on low
level things? An OS-developer's language? Hardly seems like a general
purpose language if no one uses it for high level programming. A low-level
programming language?)
A strict subset wasn't the goal for the final alternative language. An
exercise would be to see how close one could stay with C++ syntax, still
having adequate capability while removing the hard-to-implement things.
Walter Bright said:No. Expressing certain things in C is pretty difficult, like:
1) exception handling
2) COMDATs
Since the Gnu D Compiler (GDC) works with the gnu compiler collection
(gcc), a port of GDC to any platform that gcc supports should be
straightforward. There is a newsgroup devoted to this, and you should be
able to find help if you get stuck.
Walter Bright said:Sounds to me like Java is for you.
Dennis (Icarus) said:I use C# because it deals much more cleanly with Microsoft's
COM/Automation
APIs.
If I'm out of that domain, I prefer to use C++.
I don't think so.
So what do you consider "high-level"?
And if these "hard-to-implement" things provide nice functionality?
Developers won't loo at the language and say...wow....that was easy to
implement!
They'll say...."darn, it doesn't have xxxxx - I'll look elsewhere"
Not necessarily a bad thing.
In fact, it is necessarily a bad thing to emasculate a general purpose
programming language. Use D, C#, Java, or roll your own
Ed said:GCC doesn't support, and likely never will, the platform I'm thinking
about.
JohnQ said:GUI, DB, business, application programming. (As opposed to device driver or
OS development).
There's usually 2 positions (not just for programming languages): you like
all the bells and whistles or you like simply elegant. I'm the latter and
C++ isn't in the latter category.
JohnQ said:That's the point, but to start from a nice subset of C++.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.