"Small C++" Anyone?

D

Dennis \(Icarus\)

JohnQ said:
Yeah, but remember this thread started with the concept of "Small C++". I'm
actually aguing for that hypothetical (non-existent) language in competition
with C++ (or not because it's already been rejected there) in some nebulous
domain. I know it's a fuzzy stance, where C++ isn't chosen now, maybe "Small
C++" could be in the future.

Werll, right now in an exclusive competition, C++ would be used since
Small-C++ doesn't exist.
No...wait...it does for the most part. Just avoid using features that aren't
needed for that project.

The manager (or project leader/architect/lead engineer, whatever) should be
able to have reasonable confidence that given his specifications, the
programmers will produce what was envisioned.

Indeed. And that is the desired result regardless of language used, yes?

Well the thing is, I'm not arguing for those things. I'm just being
pessimistically optimistic that some kind of C++ will survive and grow
rather than become more and more a language used solely for "to the bare
metal" programming (which is why I like it though: turn-off, to me, is
"garbage collected language"). Hey, maybe that's _my_ job: to use C++ in
unexpected places. Not that I'd actually consider developing in an
environment that requires that the source code be divulged.

Ahh...well...according to the survey I posted, one of the reasons for the
rise of Java and C# was the "reduction in application development
complexity" due to these being "managed environments' - primarily automatic
garbage collection.
And since one of your goals was reduction of complexity......?

C++ will survive, and evolve as needed.

Yes, if they are C++ programmers. But if they were "Small C++" programmers,
s/he wouldn't have to be so concerned that taking eyes off of the
programmers for a few would cause the development to begin forking into
obfuscationland.

(We seem to be getting quite a bit of mileage on this topic, huh.)

Yeah, we do. I'll point out, again, that
a) C++ comes from C
b) C is the language that has an obfuscated code contest
c) Small-C++ derives from C++, which leaves it open to obfuscation as well.
Are you actually arguing that a nuclear reactor should be used for brewing
coffee?

;) (OK, no more analogies).

How does reviewing changes going into a released product equate to nuclear
reactors and brewing coffee?
You are suggesting that a long learning curve is indicative of power.

(This thread is getting pretty silly. You're obviously playing with me
now.)

I'm suggesting that C++ is a powerful language. Are you suggesting it isn't?
:)
OK. Well try to stay on topic then from now on, OK? :p

Ok, what topic would that be?
C++ vs small-C++? well...in order to discuss this in a bit more detail we'd
have to see something more concrete on what exactly small-C++ is.
Complexity in software development?
Complexity in implementing languages?
The role and responsibilities of a software development manager?
Management of software development projects?
Non-C++ templates?

So you just want a different syntax for templates?
Obviously you are asking if they will be gold plated. Overkill will be
avoided.

Such as?
This is how I see those things: cleaning up the small particles/crumbs first
and not concentrating on the big pile of stuff.

(OK I lied about "no more analogies").
(Also, I just realized that this discussion is like interface classes: all
specification and no implementation. That must be a sign.)

Actually, I've yet to see a specification. :)
Probably every C++ programmer before his fifth year of using the language.

And you KNOW that the staffing companies are hiring the C++ newbies to code
on multi-million dollar projects. (Well, I assume that hasn't changed
anyway: been there, done that).

Yes, as well as experienced folks.

Dennis
 
S

SasQ

Dnia Sun, 18 Mar 2007 13:29:30 +0100, Bo Persson napisa³(a):
I think it would be convenient to split the standard document
into some smaller parts - the core language definition in one,
the C standard library in another, the C++ [STL?] library in
another, maybe some "additional guarantees for most common
platforms" in another...

There are different chapters in the standard document. :)

Yes. But even then some subjects are broken on several chapters.
Like those built-in types definitions: what they are and what to
use them for, is in one chapter, but the size restrictions are
on another chapter, so someone [like me ;J] might overlook that.

Oh, I forgot to mention that it will be good also if the standard
would be accessible online to everyone interested. Now it's
accessible for a fee as a PDF or printed copy. Look on the WWW
Consortium: they release every technical document online in
HTML format for free.
If a language should be accessible for most users, its documentation
and definition also should be accessible for everyone interested.
It might be good also to create a place where language users
could post external libraries proposals, and other users
could compare it and choose the ones fullfilling their needs.
Languages [or platforms ;J] like Java or .NET has the little
advantage that all libraries are gathered in one place and
well defined/documented for their users.

The also have the "advantage" of a single company promoting
their own standard. This leads to interesting portability
problems for platforms that are not directly supported.
Very expensive ones, sometimes.

Yeah I know, and that's a real flaw of those environments.
I've mentioned it only for the reason of the accessibility
and maintenance of their libraries.
For example, I work with IBM mainframes - a relatively low
volume, but very important platform. To run Java on this
system, you need special add-on hardware to implement the
standard requirements. Dotnet doesn't run at all.

Huh, and people say that Java runs on everything... :pPP
For x64 platforms, 32-bit ints acually have shorter
instructions than 64-bit operations. That somehow makes it
"natural" for the platform, in that AMD decided to keep
opcodes for 32-bit operations the same, and use extended
opcodes for 64-bit operations.

So there 'int' might be that "most convenient" 32 bits,
and there is still a 'long' type for those who want more ;)
So why 'long long int'?

I only wonder how the current standard deals with new 64-bit
platforms and if something is about to change in new C++0x
standard, or maybe precised. Because we've come to situation
that different compiler vendors use different "self-made
standards" for new 64-bit platforms and it's getting more
cloudy for programmers that it was when there was only 32-bit.
 
I

Ian Collins

JohnQ said:
"Development team" usually means a range of people from all over the place
with varying degrees of experience. If "the development team" is not like
one of those conglomerations of staffing agency provided groups, but rather
a contractor who specializes in the type of software to be custom produced
for a project (or a product), ... well even then, the architecting,
engineering, designing is going to (or should IMO) be the responsibility of
few people (many times one key person). I'm talking about serious software,
not just something that doesn't matter as long as it works.
Wow, you are so stuck in the 90s....
There's two kinds of managers: lightweights and heavyweights. The latter are
skilled in both the engineering aspects and the managerial aspects. The
former are (hehe, glorified secretaries! ;) ) just skilled in management
techniques. Anyway, chances are, the heavyweight manager will also be the
project leader and calling the shots and making the critical decisions.
Make that the 80s.
 
G

Grizlyk

Ian said:
EC++ removed templates, stripping the language of one of its core
components and forcing users to reinvent everything in the C++ standard
library.

I think standard library is not the same as templates. Templates is C++
language stuff (enough useful in comparison with nothing), but stdlib is
just implementation of concrete interface.

There are many other libraries in the world, with different interfaces and
some of them has appeared befor stdlib has been made, and many of them at
least not worse than stdlib (especially if you have seen some
implementations of stdlib early from 2000 year).

It is good, when C++ has well-known data types as list, array and algorithms
to work with them in standard manner (at least code will be more portable),
but for OOP, interface is one of easy changing thing, so it is always easy
to make adapter of concrete interface, adapting implementation from stdlib
as well as from other libs.

There are no inventions in the adaptors, because the trivial algorithms and
data types from stdlib has been defined not by C++.


--
Maksim A. Polyanin
http://grizlyk1.narod.ru/cpp_new

"In thi world of fairy tales rolls are liked olso"
/Gnume/
 
I

Ian Collins

Grizlyk said:
I think standard library is not the same as templates. Templates is C++
language stuff (enough useful in comparison with nothing), but stdlib is
just implementation of concrete interface.
The C++ standard library uses templates, don't forget it started life as
the Standard *Template* Library. EC++ removed templates, denying users
the C++ standard library and it did not provide an alternative. Big
mistake.
 
J

JohnQ

Ian Collins said:
Wow, you are so stuck in the 90s....
Make that the 80s.

Foundational principles never "go out of style". OTOH, the flavor-of-the-day
programming processes are just that: fads.

John
 
J

JohnQ

Dennis (Icarus) said:
Werll, right now in an exclusive competition, C++ would be used since
Small-C++ doesn't exist.
No...wait...it does for the most part. Just avoid using features that
aren't
needed for that project.

That doesn't help someone who wants to take apart the compiler and implement
features differently or add features.
Indeed. And that is the desired result regardless of language used, yes?

It's hard to get that confidence with C++. Certainly with new programmers
but probably even with a lot of the gurus.
Ahh...well...according to the survey I posted, one of the reasons for the
rise of Java and C# was the "reduction in application development
complexity" due to these being "managed environments' - primarily
automatic
garbage collection.
And since one of your goals was reduction of complexity......?

The complexity that I started out talking about was the compiler
implementation complexity.
I furthered at some point (surely) that just moving complexity away from the
programmer while increasing greatly the compiler complexity is lame
non-solution.
C++ will survive, and evolve as needed.



Yeah, we do. I'll point out, again, that
a) C++ comes from C
b) C is the language that has an obfuscated code contest
c) Small-C++ derives from C++, which leaves it open to obfuscation as
well.

Faulty reasoning.
How does reviewing changes going into a released product equate to nuclear
reactors and brewing coffee?

C++ == nuclear reactor.
now.)

I'm suggesting that C++ is a powerful language. Are you suggesting it
isn't?
:)
Nope.


Ok, what topic would that be?
C++ vs small-C++? well...in order to discuss this in a bit more detail
we'd
have to see something more concrete on what exactly small-C++ is.
Complexity in software development?
Complexity in implementing languages?
The role and responsibilities of a software development manager?
Management of software development projects?

The language pretty much makes the requirements on the process controls. If
it's overkill, you'll spend more time than necessary doing busy work.
So you just want a different syntax for templates?

Apparently the D guy said he was able to reduce the implementation
complexity greatly by changing it. It may be a start.

I don't know. Probably partial specialization (?). Concepts... etc.
Actually, I've yet to see a specification. :)


Yes, as well as experienced folks.

Not that experienced folks don't still use every nook and cranny in C++
though.

John
 
D

Dennis \(Icarus\)

JohnQ said:
That doesn't help someone who wants to take apart the compiler and implement
features differently or add features.

Welcome back - glad you're feeling better.
I'm pretty sure GCC has been mentioned before in this thread.
That could foirm your starting point.
It's hard to get that confidence with C++. Certainly with new programmers
but probably even with a lot of the gurus.

So in what language(s) do you think its easy to have reasonable confidence
that, given their specification, the programmer will produce what was
envisions (vs what was written in the spec?)
The complexity that I started out talking about was the compiler
implementation complexity.
I furthered at some point (surely) that just moving complexity away from the
programmer while increasing greatly the compiler complexity is lame
non-solution.

And then starting talking about how one can writ hard-to-maintain code in
C++.
Faulty reasoning.

Feel free to point out why you think its faulty.
C++ == nuclear reactor.

Really? Ok. then what langauge is "brewing coffee?"? I'm guessing Java?

Good deal.

Apparently the D guy said he was able to reduce the implementation
complexity greatly by changing it. It may be a start.

Well, there ya go.
I don't know. Probably partial specialization (?). Concepts... etc.

Well, partial specialization of templates has a nice, concrete need.

Not that experienced folks don't still use every nook and cranny in C++
though.

And newbies do?
Although, if you look at the code experienced folks write, using the
template linraries, they will use a good bit of what you'd consign to the
dustbin.
:)

Dennis
 
J

JohnQ

SasQ said:
Dnia Sun, 18 Mar 2007 00:31:43 -0500, JohnQ napisa³(a):
What does "napisal(a)" mean?

"wrote" in Polish.
Did I write that?

Yes. In the post from 2007-03-16 23:40.
How much easier would C++ be if it made that assumption.

I don't know, but I think if C++ assume that bytes are always 8-bit,
people coding for the platform where bytes are more than 8 bits
would protest or can't use C++ for those platforms.
Well what if "Small C++" would target only 8-bits/byte hardware?

Noone's stopping you ;) If you don't want to support platforms with
other-than-8-bit bytes, feel free. C++ creators have had other aims.
C++ wants to be "everywhere"

Yes. So does Internet ;) And maybe you could write your posts for
this group only because of that creators of Internet protocols
didn't made any platform-specific assumptions. Where they want
8-bit and no more no less, they require OCTET. Mail protocols
are designed to send 7-bit characters and 8-bit also, because
they don't assume how many bits the characters should have.

I heard there were suggestions to introduce new built-in data types
to C++0x for programmers who want presice bit sizes: byte, word,
dword, qword etc. but I don't know the further story of that ideas.
Some compilers offer an extensions like _int16, _int32, _int64 etc.
for the same reason, but they're non-standard, so the code would
compile only on those compilers supporting those extensions.
What did you just say? I'm all for non-nebulousness. If even
the bits and "bytes" haven't been standardized, we're in
loads-O-trouble!
[snip]

Is it anymore clrear now? :)

It didn't answer the question of how specifying that bytes have 8 bits can
simplify compiler implementation and to what degree. A few more simplifying
assumptions and maybe even _I_ would be able to implement a compiler.
It's good to know well the tools used. You can't say "I don't
have to be a welder to weld".

But I want to gas weld only and I'm sure I'll never want or need to arc
weld. If so, then the super duper weld-O-matic is overkill for my purposes.
Suck for who? :)
I appreciate that I can write code in C++ and compile it on
a platform where bytes are 9-bits ;)

Sounds like a lot of effort for fringe cases.
Hard for you doesn't mean hard for everyone.

It wasn't hard for me. But surely for most people who can't sort out the
chaff from the wheat in the language, it must be nightmarish.
I don't like managers trying to stuff their hands into my code.
If they don't trust me, let they write that code by theirselves ;J

See, that's exactly the problem! I don't want a dozen cowboy coders doing
their own things all their own ways and then have to maintain that mess.
The more features language has, it always be the ones
who don't understand it well and use it a wrong way.
Like using a preprocessor to do obfuscating macros.
Using a type casting to fiddling bits inside objects.
Using inheritance for everything only to reuse code.
If you use a lighter without care, you can burn yourself.
Stroustrup said that in C you could shoot your foot if
you did something without care. C++ protects you from
aiming on your leg, but if you really want, it won't
stop you and you can shoot out all your leg then.
It's the "Trust the programmer" rule.


Yes, in some cases D's template syntax is better. But it's not
better in all the cases and there are cases where C++ wins.
C++ and D has simply a different set of features. Choose the
one you need for a particular job ;)


Sign of what? :) I knew at least five women who learned C++
with me on a university. And they understand it well ;)

Signs that a C++ is an ultra gearhead type of which most women are not.
Though there probably would be a few more (maybe 10 instead of the 5 you saw
once) with a language more easily used at a higher level since women have
the potential to be better designers IMO, partly because they think more
abstractly (umm, I think they do... once I figure out C++, I'll tackle
figuring out the other thing ;) ).
Strange, I spend more time in the problem space, on designing
and thinking about the program structure. Then it's easier to
sit down to the keyboard and code it in.

And once you begin doing that implementation, you mind quickly reverts to
thinking about all the corner cases and the like. The more features a
language has and the more of them you use, the more time your mind spends in
the solution space.
I use printf() (temporarily). Yep, I think C++ IO is obsolete
at the outset. C'mon now, it can't even decide on what a byte
is, and you want me to accept what it considers an input/output
to be. Surely you jest.

C'mon now, C lays on the same assumptions as C++ :p
BTW try this one with printf:

class SomeClass {
//..some stuff
};

SomeClass someObject;
printf("what '%' code should be placed here? :p", someObject);

C++ IO is object oriented. It HAVE TO be, because if you can
create new data types, you should also be able to use it with
IO the same way as built-in types. With printf you can't, because
it has '%' codes only for built-in types.
There's another reason behind using iostreams instead of printf:
iostream output operators are matched at compile time and in a
machine code there'll be only calls for the proper functions to
handle only proper data types, and nothing else. OTOH printf
have to parse format string at run-time every time it's called,
and choose the proper branch of execution for the particular type.
All that branches will be there in executable even if you print
only one type in a whole program. In a case of iostreams, there
could be only the ones used [code of the operator<<'s for the
used types only].

In this day of the GUI, how much do you need Std IO anyway.
No offence, I didn't mean anything bad. I've only said that you
might probably not understand that well the features of C++ you
found hard or unnecessary.

Thoroughly evaluated and trying to avoid based on that evaluation. It was a
lot easier at first to use C++ blindly, but after years of using it and
realizing what is required to get that funcitonality, it becomes easy to
reject.
It's nothing bad, I've been there too
and thought that C++ features unnecessary or strange. But if you
understand the reason why that features are where they are, and
what rationale directed C++ inventors, you start to see why that
features are good and are there for a reason.
If you haven't read Stroustrup's books yet, I encourage you
to do it. "The C++ Programming Language" is good for learning
C++ to understand it well and use it the proper way. "The C++
Design and Evolution" will show you the rationale behind every
language feature, how it evolved with time, what were the other
options and why the current ones had been choosed. And maybe it
will help you with making decissions and designing your
"Small C++" too ;)

Surely they would if I was producing such a language. I started with D&E in
the early nineties. That and Coplien's book moved me from C to C++. I've
read at least part of most C++ texts (the parts that interest me). After a
decade and a half, some major parts of the standard are getting a bit long
in the tooth, along with the rationales for some of them. C++ is overly
general probably rather than "general purpose". It takes generality to the
extreme at the expense of being immediately useful in a lot of domains and
it's evolution is slow for the same reason. It's easy to say it is "a good
language" if you already know it and have used it for a decade, but
obviously that long training path is not a good goal if it can be avoided.
Again, there's probably things that could be done with a new language that
would make it greatly more accessible than C++ which is hampered with
backward compatibility. If there were such a new designed-to-be-accessible
language, maybe it would be chosen over C++ where C++ is and isn't now being
chosen.

At some point in a product's lifetime or a software company's evolution,
there may very well be desire to avoid building product on top of someone
else's technology. At one level one may say that programming with
technologies such as MS's COM or .net is banking too much on 3rd party
technology. At another level, one may decide that the decidedly
complex-to-implement features of C++ are too risky to buy into. I'm already
planning aversion to C++ complexity where and when it is practical in
preparation for the future. (I use templates, but not advanced templates and
not the STL, for example. If I can find a way out of them, I'll probably
take it).

John
 
J

JohnQ

Dennis (Icarus) said:
Uhmm...yes....yes you did. Check your "sent items" folder (or equivalent)
or
check google.



I thought we covered this, but we can do so again.
To summarize my understanding, "high-level" is, IIRC GUI, Databases, etc
However, folks use C++ to do GUI, Databases, etc, so it doesn't seem to be
kept "out of anything high level".


Apparently, Java and C# are filling a void. So much for C++ everywhere.
Well, lets see, you have bit shift operations in C++ so they are, indeed,
standardized.
Byte means different things to different platforms, but the most common
platforms do use 8 bits per byte.
However, the designers of C++ thought it shuld be able to range from
embedded controllers to supercomputer clusters.
And it does so.

And maybe a language that defines a byte as 8 bits would be less "general
purpose" but more useful and accessible to those not concerned about the
fringe cases. (And of course a boon to the would-be compiler developers who
cannot fathom doing that with C++).

For the myriad of reasons given since this thread started.
Could you be more specific then?

About what?
Well, programming itself is "hard".

Well it doesn't have to be. I mean, that would be a goal of "Small C++":
programming doesn't have to be so hard. From the get go, if the new
programmer could rely on an 8-bit byte and integer types of specific widths
exclusively, just that would help propel someone to productivity with a
language faster. type.h is probably where I'd start if I was to start laying
out "Small C++": a standard set of integer types of guaranteed width and no
nebulous integer types (no "is 32 bits on a 32 bit machine, 64 bits on a 64
bit machine" etc.).
Well...in order to start producing software in Small C++ you'd hae to have
a
compiler, and to get the compiler you'd have to have a language spec.

Or I could just stop using more and more of the C++ constructs and replace
them with my own. Yes, at some point there is limitation by not having
access to the compiler. At that point, someone may want to embark on
building a compiler system or solicit someone to do it.
An example is using the __int8 style integers exclusively in preparation for
a compiler that ONLY supports guaranteed width integers.
It's much easier for a bad coder. But [like Dennis mentioned already]
for a bad coder it's possible in any language.

He was off topic at that passage in his post. Yes, a logic error.

Off-topic? You're complaining that C++ features lead to unmaintainable
code,
I point out that its possible to do this in any lanaguage, including C,
and
you think this is a logic error?

Yes, because he confused "the possibility of" with "the probability of". He
was pointing out the former while I was talking about the latter.
Meaningless, since Small C++ doesn't exist?

It does though. Just not in an evolved or complete form. EC++ could be said
to be a "Small C++" of sorts, for instance. A strict subset to start from.
Then add a few ingredients, change some (8-bit bytes anyone?) and voila!
Ok, lets see Small-C++'s generics?

They're not built yet (if it will have them). But D has them in a
simpler-to-implement form than C++, so I hear anyway (probably too
"powerful" for my tastes though also).
I work with quite a few C++ developers who are women, and there were lots
at
the university I attended.
You don't know ANY?

Nope. You must be in India?
So you're out of touch then?

With that abhorant environment, yes. I hypothesize that it still happens the
same way. The same ads run in the papers and on the boards.
I'll point out that printf comes from C, and C doesn't define what a byte
is
either.
For consistency, you shouldn't use printf either.

I don't ever forsee using it in production code. Only during
development/debug. See, now there's another thing on the chopping block
maybe: C++ IO. (It seems we're making progress: templates and IO to be the
first to go after the 8-bit byte and guaranteed width integers are
formalized :) ).

John
 
J

JohnQ

Dennis (Icarus) said:
Hope you get to feeling better soon.

Thank you. I'm back, but I do feel that I've been spending too much time
having fun "inventing a new language" rather than on more immediately
important things (building software with what is currently available: C++).
So, this thread will hopefully wind down if it hasn't been beat to death
already.

John
 
J

JohnQ

Dennis (Icarus) said:
Welcome back - glad you're feeling better.
Thanks.

I'm pretty sure GCC has been mentioned before in this thread.
That could foirm your starting point.

I think I've already said that starting with a full C++ compiler would be
too hard. That's why I brought up EC++ I believe: starting with a compiler
that does only that subset, or the cfront subset may be a good starting
point (starting point for further stripping? 8-bit bytes anyone?).
So in what language(s) do you think its easy to have reasonable confidence
that, given their specification, the programmer will produce what was
envisions (vs what was written in the spec?)

Small C++! Why? Because thought would be given to the feature set, much
moreso than it was with C++, to ensure it was harder to "shoot your whole
foot off" or even shoot yourself in the foot.
And then starting talking about how one can writ hard-to-maintain code in
C++.

I didn't say 'can', I suggested 'taught'! I said something like "writing C++
has the obfuscation already built-in... no need to make any special effort
to write obfuscated C++ code!".
Feel free to point out why you think its faulty.

"possibility of" and "probability of" are different. Combine this with what
I just said above.
Really? Ok. then what langauge is "brewing coffee?"? I'm guessing Java?

Hehe. I didn't even intend that pun. No, I wasn't suggesting Java. Nor any
other existing language. I hesitated to say Small C++ because I didn't want
it to be on the extreme end of coffee brewer (which sounds more like RAD
tool).
Good deal.



Well, there ya go.

I meant a starting place to look for how to implement templates. D is too
much language just like C++ is to be Small C++. It's probably even bigger:
garbage collected, nixed preprocessor (both of which I would not want in
Small C++: I want the preprocessor, I don't want garbage collection
built-in).
Well, partial specialization of templates has a nice, concrete need.

Apparently so do 9-bit bytes, but that makes the language a bit too broad if
you ask me. Eventually, the language itself will become unmaintainable.
And newbies do?

What, program by the examples they see in books? Yes they do.
Although, if you look at the code experienced folks write, using the
template linraries, they will use a good bit of what you'd consign to the
dustbin.

Probably, but because they are so enamoured with templates that they overuse
the paradigm. Maybe template use should be restricted (by coding standard or
whatever) to containers/algorithms only.

John
 
J

JohnQ

I don't believe that deleting a bunch of standard features in DMC++ (or
any other C++ compiler) is going to make it a more attractive product. It
runs contrary to all my experience in this business.

There have been two major attempts at reengineering C++: Java, which tries
to improve things by removing the hard stuff, and D, which tries to
redesign the hard stuff so it isn't hard anymore.

That sounds reasonable. But you took away my preprocessor and added garbage
collection. :( I think your goals with D are to have everything including
the kitchen sink in it (C++ is a bit like that already): you'll have
concepts, partial specialization... etc. I'm not convinced all that is
necessary and if not, it complicates the general case for the fringe cases.
It's the more-is-more language. Small C++ is envisioned as the less-is-more
language. The advantage that Small C++ would have over D (in addition to
ease of use) would be that "anyone" could "trivially" implement it.
Infrastructure buildout would not have to proceed at the traditional snail's
pace since one would essentially be one's own compiler system provider
directly from the rawest material.

John
 
I

Ian Collins

JohnQ said:
Foundational principles never "go out of style". OTOH, the flavor-of-the-day
programming processes are just that: fads.
Autocracy or teamwork, I know which I prefer.
 
D

Dennis \(Icarus\)

JohnQ said:
I think I've already said that starting with a full C++ compiler would be
too hard. That's why I brought up EC++ I believe: starting with a compiler
that does only that subset, or the cfront subset may be a good starting
point (starting point for further stripping? 8-bit bytes anyone?).


Small C++! Why? Because thought would be given to the feature set, much
moreso than it was with C++, to ensure it was harder to "shoot your whole
foot off" or even shoot yourself in the foot.

I note the use of the future tense "would be"
Ok, letsd try this. We'll start off with the same requirements.
Ill use C++, you can use Small C++.
We'll see who finishes first. I'll admit I have an advantage in that my
language and compiler.....exists.

Interesting that you find no other language in which you have reasonable
confidence that, given the specification, that the programmer will prodce
the desired result.

I didn't say 'can', I suggested 'taught'! I said something like "writing C++
has the obfuscation already built-in... no need to make any special effort
to write obfuscated C++ code!".

And I said that since C++ derives from C, and C is the one language I know
that has a contest whose purpose is to write obfuscated code, it seems
logical that Small-C++ would also "have obfuscation built in".
"possibility of" and "probability of" are different. Combine this with what
I just said above.

So with C, no possibility of programmers writing obfuscated code. Only with
C++ does obfuscation come into the picture?

I meant a starting place to look for how to implement templates. D is too
much language just like C++ is to be Small C++. It's probably even bigger:
garbage collected, nixed preprocessor (both of which I would not want in
Small C++: I want the preprocessor, I don't want garbage collection
built-in).

Well, in the survey results I posted, they emphasised the "managed"
environment in reducing application complexity.
Apparently so do 9-bit bytes, but that makes the language a bit too broad if
you ask me. Eventually, the language itself will become unmaintainable.

Yes, since there are machine architectures with 9-bit bytes.
Having the language with the flexibility to handle such architectures is a
good thing, IMO.
What, program by the examples they see in books? Yes they do.

Uhm...."(And newbies do) use every nook and cranny in C++"?
Probably, but because they are so enamoured with templates that they overuse
the paradigm. Maybe template use should be restricted (by coding standard or
whatever) to containers/algorithms only.

And therein lies a problem.
If you have a header file, which allows the definition of templates in
Small-C++, then a developer will be able to use the same syntax.
Or will these headers be "marked" in some way which lets them use templates,
but nothing else?

Dennis
 
D

Dennis \(Icarus\)

JohnQ said:
BTW try this one with printf:

class SomeClass {
//..some stuff
};

SomeClass someObject;
printf("what '%' code should be placed here? :p", someObject);

C++ IO is object oriented. It HAVE TO be, because if you can
create new data types, you should also be able to use it with
IO the same way as built-in types. With printf you can't, because
it has '%' codes only for built-in types.
There's another reason behind using iostreams instead of printf:
iostream output operators are matched at compile time and in a
machine code there'll be only calls for the proper functions to
handle only proper data types, and nothing else. OTOH printf
have to parse format string at run-time every time it's called,
and choose the proper branch of execution for the particular type.
All that branches will be there in executable even if you print
only one type in a whole program. In a case of iostreams, there
could be only the ones used [code of the operator<<'s for the
used types only].

In this day of the GUI, how much do you need Std IO anyway.

John, there are these neat things called "files".
They're a sequence of bytes sitting out on persistent storage.
InputFule >> MyObject;
OutputFile << MyObject;

Surely they would if I was producing such a language. I started with D&E in
the early nineties. That and Coplien's book moved me from C to C++. I've
read at least part of most C++ texts (the parts that interest me). After a
decade and a half, some major parts of the standard are getting a bit long
in the tooth, along with the rationales for some of them. C++ is overly
general probably rather than "general purpose". It takes generality to the
extreme at the expense of being immediately useful in a lot of domains and
it's evolution is slow for the same reason. It's easy to say it is "a good
language" if you already know it and have used it for a decade, but
obviously that long training path is not a good goal if it can be avoided.
Again, there's probably things that could be done with a new language that
would make it greatly more accessible than C++ which is hampered with
backward compatibility. If there were such a new designed-to-be-accessible
language, maybe it would be chosen over C++ where C++ is and isn't now being
chosen.

At some point in a product's lifetime or a software company's evolution,
there may very well be desire to avoid building product on top of someone
else's technology. At one level one may say that programming with
technologies such as MS's COM or .net is banking too much on 3rd party
technology. At another level, one may decide that the decidedly
complex-to-implement features of C++ are too risky to buy into. I'm already
planning aversion to C++ complexity where and when it is practical in
preparation for the future. (I use templates, but not advanced templates and
not the STL, for example. If I can find a way out of them, I'll probably
take it).

Ok, so you'll avoid using standard genertic containers in place of what you
write yourself.
And you think it'll be easier for new hires to use the ones you create as
opposed to the STL?

for my masters thesis, I implemented a C compiler for microprogramming.
I developed a couple of extensions to better handle the specifics for
microcode.
Took me about 6 months, using flex and bison.

Those tools are freely available.
Go for it. :)

Dennis
 
D

Dennis \(Icarus\)

JohnQ said:
Apparently, Java and C# are filling a void. So much for C++ everywhere.

It pretty much is everywhere.
Not so Java or C#.

And maybe a language that defines a byte as 8 bits would be less "general
purpose" but more useful and accessible to those not concerned about the
fringe cases. (And of course a boon to the would-be compiler developers who
cannot fathom doing that with C++).

And such a langauge can restrict itself out of existence.
Think of how many laguages that defined pointers as 16-bit addresses would
still be in use in desktop apps since we've moved into 32-bit years ago, and
are now embracing 64-bit.
For the myriad of reasons given since this thread started.

Ok, so why do you use it?
About what?

Uhmm...about Small-C++?
Well it doesn't have to be. I mean, that would be a goal of "Small C++":
programming doesn't have to be so hard. From the get go, if the new
programmer could rely on an 8-bit byte and integer types of specific widths
exclusively, just that would help propel someone to productivity with a
language faster. type.h is probably where I'd start if I was to start laying
out "Small C++": a standard set of integer types of guaranteed width and no
nebulous integer types (no "is 32 bits on a 32 bit machine, 64 bits on a 64
bit machine" etc.).

Ahh..so someone having difficulty with "int" and float" would find them
immediately accessible if they know that both are 32-bit?
:)

So you have int as 32-bit exclusively, then it performs poorly on 16-bit
CPUs compared to ones that use the "native type".
Or I could just stop using more and more of the C++ constructs and replace
them with my own. Yes, at some point there is limitation by not having
access to the compiler. At that point, someone may want to embark on
building a compiler system or solicit someone to do it.
An example is using the __int8 style integers exclusively in preparation for
a compiler that ONLY supports guaranteed width integers.

Go for it.
It's much easier for a bad coder. But [like Dennis mentioned already]
for a bad coder it's possible in any language.

He was off topic at that passage in his post. Yes, a logic error.

Off-topic? You're complaining that C++ features lead to unmaintainable
code,
I point out that its possible to do this in any lanaguage, including C,
and
you think this is a logic error?

Yes, because he confused "the possibility of" with "the probability of". He
was pointing out the former while I was talking about the latter.

Ahh...so you think a given deveoper has a lower probability of writing
obfuscated code in C, vs C++?
:)
It does though. Just not in an evolved or complete form. EC++ could be said
to be a "Small C++" of sorts, for instance. A strict subset to start from.
Then add a few ingredients, change some (8-bit bytes anyone?) and voila!

Ok, so there ya go.
Have fun :)
They're not built yet (if it will have them). But D has them in a
simpler-to-implement form than C++, so I hear anyway (probably too
"powerful" for my tastes though also).

Yeah, probably so.
Nope. You must be in India?

No, the states. You?

I don't ever forsee using it in production code. Only during
development/debug. See, now there's another thing on the chopping block
maybe: C++ IO. (It seems we're making progress: templates and IO to be the
first to go after the 8-bit byte and guaranteed width integers are
formalized :) ).

Well , best get started on it.

Dennis
 

Ask a Question

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.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top