473,385 Members | 1,531 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

C++'s interface with the Real World

I'm forking this from a reply to John Nagle in the smart_ptr<> thread.

To address some of the problems handled by the runtime environments of C#
and Java, it may be necessary to look beyond the C++ Standard. I believe
Microsoft post-DOS OSs are capable of detecting a null pointer access, and
throwing an exception to the program that attempted it. I've raised this
issues on the GCC mailing list (or newsgroup - I don't recall which), and
believe there was some interest in addressing the problem for other
environments. This discussion may suggest a way of doing the same for
Linux.

http://netlab.ru.is/exception/LinuxCXX.shtml

This really is the domain of the C++ ABI, and not the language standard.
There may be room in the standard for improving the language side of the
interface. I don't know.

My personal opinion is that there is no need for two (or three) languages to
create the kinds of products written in Java or C#. There may be a real
role for managed C++ and the CRL, such as creating C++ 'applets' in the
spirit of Java applets. The Java code to produce these animated graphics
is quite minimal, and uses nothing beyond the basic Java libraries:

http://mathworld.wolfram.com/topics/...3DApplets.html

Using Java3D I have created more sophisticated 3D applications which I can
share over the Internet as long as the person on the other end cares to
install Java3D. Although Java3D does have a bit of platform specific code,
the JVM makes porting it far easier than it might otherwise be. I can
therefore share my applets with people using different platforms without
any consideration of their platform on my part.

Clearly, in order to accomplish the same with C++ there would be a need to
restrict the available language features to those which do not require
direct access to system resources. Unfortunately, as I understand things,
managed C++ also adds non-standard features to the language. These
additions probably enhance the usability of the language in the CLR
environment, but they also represent a fork potentially leading to two
similar, yet incompatible languages.

One last comment on garbage collection. It's not a panacea. Though I never
actually got to the point of needing to address the problem, the Java3D
literatue discusses approaches to managing discarded objects; something
that is forced on C++ programmers. Though I believe C++ could and should
do a far better job of facilitating memory management, the fact that a C++
programmer has to take resource management seriously makes a C++ programmer
a better programmer.

--
If our hypothesis is about anything and not about some one or more
particular things, then our deductions constitute mathematics. Thus
mathematics may be defined as the subject in which we never know what we
are talking about, nor whether what we are saying is true.-Bertrand Russell
Jul 23 '05 #1
5 1197
Steven T. Hatton wrote:
I'm forking this from a reply to John Nagle in the smart_ptr<> thread.

To address some of the problems handled by the runtime environments of C#
and Java, it may be necessary to look beyond the C++ Standard. I believe
Microsoft post-DOS OSs are capable of detecting a null pointer access, and
throwing an exception to the program that attempted it. I've raised this
issues on the GCC mailing list (or newsgroup - I don't recall which), and
believe there was some interest in addressing the problem for other
environments. This discussion may suggest a way of doing the same for
Linux.

http://netlab.ru.is/exception/LinuxCXX.shtml

This really is the domain of the C++ ABI, and not the language standard.
There may be room in the standard for improving the language side of the
interface. I don't know.

My personal opinion is that there is no need for two (or three) languages to
create the kinds of products written in Java or C#. There may be a real
role for managed C++ and the CRL, such as creating C++ 'applets' in the
spirit of Java applets. The Java code to produce these animated graphics
is quite minimal, and uses nothing beyond the basic Java libraries:

http://mathworld.wolfram.com/topics/...3DApplets.html

Using Java3D I have created more sophisticated 3D applications which I can
share over the Internet as long as the person on the other end cares to
install Java3D. Although Java3D does have a bit of platform specific code,
the JVM makes porting it far easier than it might otherwise be. I can
therefore share my applets with people using different platforms without
any consideration of their platform on my part.

Clearly, in order to accomplish the same with C++ there would be a need to
restrict the available language features to those which do not require
direct access to system resources. Unfortunately, as I understand things,
managed C++ also adds non-standard features to the language. These
additions probably enhance the usability of the language in the CLR
environment, but they also represent a fork potentially leading to two
similar, yet incompatible languages.

One last comment on garbage collection. It's not a panacea. Though I never
actually got to the point of needing to address the problem, the Java3D
literatue discusses approaches to managing discarded objects; something
that is forced on C++ programmers. Though I believe C++ could and should
do a far better job of facilitating memory management, the fact that a C++
programmer has to take resource management seriously makes a C++ programmer
a better programmer.


Try posting to comp.std.c++. They deal with standards issues.

Larry
Jul 23 '05 #2
Larry I Smith wrote:
Steven T. Hatton wrote:
I'm forking this from a reply to John Nagle in the smart_ptr<> thread.

To address some of the problems handled by the runtime environments of C#
and Java, it may be necessary to look beyond the C++ Standard. I believe
Microsoft post-DOS OSs are capable of detecting a null pointer access,
and
throwing an exception to the program that attempted it. I've raised this
issues on the GCC mailing list (or newsgroup - I don't recall which), and
believe there was some interest in addressing the problem for other
environments. This discussion may suggest a way of doing the same for
Linux.

http://netlab.ru.is/exception/LinuxCXX.shtml

This really is the domain of the C++ ABI, and not the language standard.
There may be room in the standard for improving the language side of the
interface. I don't know.

My personal opinion is that there is no need for two (or three) languages
to
create the kinds of products written in Java or C#. There may be a real
role for managed C++ and the CRL, such as creating C++ 'applets' in the
spirit of Java applets. The Java code to produce these animated graphics
is quite minimal, and uses nothing beyond the basic Java libraries:

http://mathworld.wolfram.com/topics/...3DApplets.html

Using Java3D I have created more sophisticated 3D applications which I
can share over the Internet as long as the person on the other end cares
to
install Java3D. Although Java3D does have a bit of platform specific
code,
the JVM makes porting it far easier than it might otherwise be. I can
therefore share my applets with people using different platforms without
any consideration of their platform on my part.

Clearly, in order to accomplish the same with C++ there would be a need
to restrict the available language features to those which do not require
direct access to system resources. Unfortunately, as I understand
things,
managed C++ also adds non-standard features to the language. These
additions probably enhance the usability of the language in the CLR
environment, but they also represent a fork potentially leading to two
similar, yet incompatible languages.

One last comment on garbage collection. It's not a panacea. Though I
never actually got to the point of needing to address the problem, the
Java3D literatue discusses approaches to managing discarded objects;
something
that is forced on C++ programmers. Though I believe C++ could and should
do a far better job of facilitating memory management, the fact that a
C++ programmer has to take resource management seriously makes a C++
programmer a better programmer.


Try posting to comp.std.c++. They deal with standards issues.

Larry

Actually, I had intended this to go to comp.std.c++, I didn't notice I had
changed focus when I started the message.
--
If our hypothesis is about anything and not about some one or more
particular things, then our deductions constitute mathematics. Thus
mathematics may be defined as the subject in which we never know what we
are talking about, nor whether what we are saying is true.-Bertrand Russell
Jul 23 '05 #3

"Steven T. Hatton" <ch********@germania.sup> wrote in message
news:c7********************@speakeasy.net...
[SNIP]

Using Java3D I have created more sophisticated 3D applications which I can
share over the Internet as long as the person on the other end cares to
install Java3D. Although Java3D does have a bit of platform specific
code,
the JVM makes porting it far easier than it might otherwise be. I can
therefore share my applets with people using different platforms without
any consideration of their platform on my part.

Clearly, in order to accomplish the same with C++ there would be a need to
restrict the available language features to those which do not require
direct access to system resources.

[SNIP]

Here you're mixing two different things - the language & an additional API
library. For the implementation of your 3D application you need your
customer/user to install Java3D because you're using its features. So far so
good, but in this case what is the difference to C++ using OpenGL. You'll
need your customer/user to have OpenGL on his system (which is standard
today for Windows and Linux anyway) and you're fine. Naturally, to keep
portability alife you'll have to restrict yourself to the standardized
language and not use any extensions, but in Java you'll have to do the same.
(Forgive my ignorance as my Java knowledge is quite shallow, however I
assume that there exists various types of extensions to the core-language
too).

Cheers
Chris
Jul 23 '05 #4
Chris Theis wrote:

"Steven T. Hatton" <ch********@germania.sup> wrote in message
news:c7********************@speakeasy.net...
[SNIP] Here you're mixing two different things - the language & an additional API
library. For the implementation of your 3D application you need your
customer/user to install Java3D because you're using its features. So far
so good, but in this case what is the difference to C++ using OpenGL.
I cannot simply send you the OpenGL app I compile here on my Linux box and
expect it to run on a Windows, Mac, or Solaris box. I _can_ send you a
jarfile containing my Java3D code, and it _will_ run on your box if you
install Java3D. I believe I could even bundle the Java3D stuff, but I'm
not sure. What I was originally talking about was running it as an applet
in a web browser. I know there are plugins written in C++, but you can't
simply write C++ code and have it execute on virtually every computer
likely to visit your site.
You'll need your customer/user to have OpenGL on his system (which is
standard today for Windows and Linux anyway) and you're fine. Naturally,
to keep portability alife you'll have to restrict yourself to the
standardized language and not use any extensions, but in Java you'll have
to do the same. (Forgive my ignorance as my Java knowledge is quite
shallow, however I assume that there exists various types of extensions to
the core-language too).


The variants of Java are few if any. Microsoft tried that, and got taken to
court. Basically, if it is non-conforming, you can't legally call it Java.
--
If our hypothesis is about anything and not about some one or more
particular things, then our deductions constitute mathematics. Thus
mathematics may be defined as the subject in which we never know what we
are talking about, nor whether what we are saying is true.-Bertrand Russell
Jul 23 '05 #5
"Steven T. Hatton" <ch********@germania.sup> wrote in
news:_t********************@speakeasy.net:
Chris Theis wrote:

"Steven T. Hatton" <ch********@germania.sup> wrote in message
news:c7********************@speakeasy.net...
[SNIP]

Here you're mixing two different things - the language & an
additional API library. For the implementation of your 3D application
you need your customer/user to install Java3D because you're using
its features. So far so good, but in this case what is the difference
to C++ using OpenGL.


I cannot simply send you the OpenGL app I compile here on my Linux box
and expect it to run on a Windows, Mac, or Solaris box. I _can_ send
you a jarfile containing my Java3D code, and it _will_ run on your box
if you install Java3D.


Nitpick.... it may run on your box if you install Java3D _and_ a JRE,
potentially the "right" version of the JRE.
Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: Simon Harvey | last post by:
Festive greetings fellow programmers! I've been programming now for about 4, maybe 5 years now. 4 of those years were at university so and I havent had much work experience of making real world...
13
by: John Salerno | last post by:
Hi all. I have a question about interfaces now. According to the book I'm reading, when you implement an interface, the class or structure has to declare all the methods that the interface...
12
by: Meya-awe | last post by:
I am puzzled, what is the purpose of an interface? How does it work, what i mean is how does the compiler treats this? Why when we talk about separating user interface from business logic, an...
18
by: Bradley | last post by:
I'm trying to determine if there's a general rule for when an Interface should used vs. an Abstract Class. Is there any design advantage to using one or the other? Brad
12
by: you | last post by:
I may be just stupid, but I don't understand the point of using an Interface. I am going through a couple of books at the moment trying to teach myself a little vb.net. Just for the heck of...
6
by: Zach | last post by:
Hi everyone, I'm a bit of a newbie to C# programming so forgive this innocent question, but coming from a C++ background this seems very odd to me, and I'm hoping someone can shed some light...
7
by: _DD | last post by:
I've encountered situations that call for an interface but also require enums/constants that go hand-in-hand with the interface. Abstract classes won't do, cause I may need to inherit more than...
8
by: khalprin | last post by:
Hello, I'm trying to create a component that will be used from .net clients and COM clients. I've got an object model that looks something like this: ISystem IRuntime IConfiguration...
1
by: YellowfinTeam | last post by:
Laws and Myths of Usability & Interface Design Introduction Usability and relevance have been identified as the major factors preventing mass adoption of Business Intelligence applications....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.