Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 17th, 2005, 11:36 AM   #21
CodeJunkie
Programmer
 
Join Date: Aug 2005
Location: England
Posts: 37
Rep Power: 0 CodeJunkie is on a distinguished road
Thankyou much appreciated !
These errors are occuring during initialisation of the application...
Have even tried a simple "Hello world" with similair problems....
but like ya say will try a catchment block ... but if it fails to initialise would it still through the error?

(Dawei, i like your piece on polymorphism being a cross dressing parrot, very humourous !! (excellent read to))
CodeJunkie is offline   Reply With Quote
Old Aug 17th, 2005, 11:49 AM   #22
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
If "Hello, world!" gives you problems, but only on one PC, I recommend uninstalling and reinstalling the .NET framework and Visual Studio.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Aug 17th, 2005, 11:57 AM   #23
CodeJunkie
Programmer
 
Join Date: Aug 2005
Location: England
Posts: 37
Rep Power: 0 CodeJunkie is on a distinguished road
Really .... Is it the compiler do ya think???

"Hello world!" for example will through an error on all bar my own machine!
(Have compiled it to .exe - have even tryed including it into a "setup" program)

to be honest im not kean on VS.net do you have any better recommendations?
CodeJunkie is offline   Reply With Quote
Old Aug 17th, 2005, 12:03 PM   #24
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Well, you could always go with straight C++.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Aug 17th, 2005, 2:27 PM   #25
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
If you're using .NET, you're actually adding one variable to the mix. If you have two Intel machines running XP, you shouldn't have a problem if you use a C++ compiler blowing out native code. Bear in mind, however, that the processors in the two machines aren't necessarily just alike. One may have an expanded instruction set of one sort or another. One of the things you get to do in some IDEs (or by command line arguments) is to ask the compiler to generate code that might be specific to a more powerful processor, at the expense of portability to a less powerful one. Check your setting for the type of code to be generated and go for the least common denominator.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Aug 18th, 2005, 6:44 AM   #26
lectricpharaoh
Caffeinated Neural Net
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 925
Rep Power: 4 lectricpharaoh will become famous soon enough
Quote:
Originally Posted by CodeJunkie
Ok .... I guess what im trying to ask is... Whenever i have written programs in C or in Java despite compiling them various diffrent ways, whenever i try to run these on a diffrent platform they fail.... with varying errors.....
I guess what im tyring to find out.. is that when you purchase an application and attempt to install it , when you click on the icon the computer doesn`t display that "Exception in thread etc" or "Please install such n such", I guess what im trying to achieve is to find a programming language that intergrates with most machines.... that does run, when the user clicks on the icon my program is compatable with there machine... Is this to much to ask?, How do developers get round these issues?
You're talking about portability of the compiled/assembled code, rather than portability of the source code? Good luck. Outside of emulation, this is just not possible.

Every machine has its own hardware. First and foremost, you have different CPUs with radically different architectures, meaning they have different (even though often equivalent) machine instructions, they access memory differently (little-endian vs. big-endian byte ordering, memory alignment, amount of addressable memory), and other capabilities. Then you have the supporting hardware, such as the motherboard chipset and all peripherals. When I was younger, I had a computer based around Motorola's 68000 microprocessor. After I'd had the machine for some years, a friend pointed out his laser printer used a 68000 as well- it's essentially the same brain in different bodies; while both would understand the same machine instructions, code written for one would not work on the other.

Then you've got the issue of the operating system, if one exists. To do a task under Windows will require different code than under DOS or Linux, even on the same machine.

This is where languages like Java come in. Java code is essentially code targeted at a machine that doesn't actually exist, and the 'Java Virtual Machine' that you install to run Java programs is really just an emulator for this imaginary machine. The designers came up with a specification for the machine, code libraries, etc, and in theory, any compliant virtual machine should execute the code in the same manner. Of course, this is the ideal situation; in the real world, it sometimes doesn't work quite so smoothly.
__________________
A man's knowledge is like an expanding sphere, the surface corresponding to the boundary between the known and the unknown. As the sphere grows, so does its surface; the more a man learns, the more he realizes how much he does not know. Hence, the most ignorant man thinks he knows it all. - L. Sprague de Camp
lectricpharaoh is offline   Reply With Quote
Old Aug 18th, 2005, 7:30 AM   #27
CodeJunkie
Programmer
 
Join Date: Aug 2005
Location: England
Posts: 37
Rep Power: 0 CodeJunkie is on a distinguished road
So when emulation comes into play this would be the adpater that DaWei mentioned..????

So am i right in assuming (Is this correct that):
A program I.e Messenger that has been downloaded of the net.. when you click its icon, firstly to ensure compatability it would contain an adapter containing most commonly used instruction sets for diffrent machines (Gets the spark that dawei mentioned) which would enable the main program in its execution... the main program would be of a standardized code that the devolepers would know works and have tested on a variety of diffrent target platforms ??

So I would assume then that emulation to diffrent O/s`s and machines would be a very advanced form of a an adapter I.e an P.c to an Amiga for example?

Just a thought but is this correct:
Some computers architecture and the way instruction sets are dealt with there in would be more inept at running certain o/s`s (i take the intel badge and designed for WinXp comes into play here) so would this mean that as intel and Windows seem to be linked, that Windows would be more designed for Intel`s architecture not AMD`s and AMD would have compatibilty issues (Hence the instability sometimes)??

Last edited by CodeJunkie; Aug 18th, 2005 at 7:55 AM.
CodeJunkie is offline   Reply With Quote
Old Aug 19th, 2005, 3:08 AM   #28
lectricpharaoh
Caffeinated Neural Net
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 925
Rep Power: 4 lectricpharaoh will become famous soon enough
Quote:
Originally Posted by CodeJunkie
So when emulation comes into play this would be the adpater that DaWei mentioned..????

So am i right in assuming (Is this correct that):
A program I.e Messenger that has been downloaded of the net.. when you click its icon, firstly to ensure compatability it would contain an adapter containing most commonly used instruction sets for diffrent machines (Gets the spark that dawei mentioned) which would enable the main program in its execution... the main program would be of a standardized code that the devolepers would know works and have tested on a variety of diffrent target platforms ??
When Dawei mentioned an adapter, he was referring to the physical devices that you plug in to the wall to change the electrical current from one standard to another. For example, in Canada and the US, our electrical outlets have three prongs- two terminals and one ground- and supply approximately 110 volts at 60 hertz (one of the terminals alternates between positive and negative, hence alternating current). In other regions of the world, the standards are different, and without an adapter, you'll get sparks, in the literal sense. He was using a metaphor.

To apply it to software, if the software is not meant to run on a particular machine, then it cannot run on that machine under normal circumstances. You need something that sits between the program and the machine, and 'translates' it. Whether you call this an emulator, adapter, virtual machine, or something else is a moot point; the principle is the same. This is the kind of portability that Java aspires to.

There is another kind of portability, however. This is source code portability. When you write so-called portable code, this means you can compile it on different machines, creating a separate version of the program for each machine. Since some languages (notably C and C++) have certain standards regarding how things work and what library functions are part of the standard, regardless of what the platform is. Of course, in the real world, you often need to make use of features specific to the machine or OS, or at least use features that aren't standardized. Things like graphics, sound, and sockets programming fall into this category, but you can still try to isolate these parts of your program from the rest, making it easier to port to another system.

Finally, to get back on topic, assembly is NOT a language that lends itself in any way to portability. Assembly, by definition, is tightly coupled to the machine architecture. Yes, there are assemblers that can generate code for diferent platforms, but these are almost always on the same hardware. An example would be NASM's ability to generate code for DOS, Win32, and Linux.

Quote:
Originally Posted by CodeJunkie
So I would assume then that emulation to diffrent O/s`s and machines would be a very advanced form of a an adapter I.e an P.c to an Amiga for example?
See above. By the way, emulators can actually be implemented in software, hardware, or a combination of both. I remember back in the days of my Atari ST that there was a hardware 'bridge' that you could buy that was essentially an 80x86 CPU with some support electronics. In conjunction with emulation software, it apparently allowed the ST to double as a PC.

Quote:
Originally Posted by CodeJunkie
Just a thought but is this correct:
Some computers architecture and the way instruction sets are dealt with there in would be more inept at running certain o/s`s (i take the intel badge and designed for WinXp comes into play here) so would this mean that as intel and Windows seem to be linked, that Windows would be more designed for Intel`s architecture not AMD`s and AMD would have compatibilty issues (Hence the instability sometimes)??
Intel and AMD chips are, for the most part, completely compatible. Sometimes one chip will offer instructions that the other doesn't, but as compilers tend to default to instructions supported on both chips, it's usually not an issue. It's the same problem that will occur when compiling for a later chip, and then attempting to run the code on an earlier CPU (ie compiling for a Pentium4 target, then trying to run the generated code on a P2). Unless you really need to, it's a bad idea to limit yourself to a particular chip like this.

There are some other differences between the chips, but most of these will not affect the code in a functional manner. Examples might be a given instruction executing faster on one chip than another, sizeor organization of the on-chip cache (affecting memory access speeds), or how one might be able to execute more instructions in parallel than another. None of these will prevent the code from working, but might affect how quickly it runs.
__________________
A man's knowledge is like an expanding sphere, the surface corresponding to the boundary between the known and the unknown. As the sphere grows, so does its surface; the more a man learns, the more he realizes how much he does not know. Hence, the most ignorant man thinks he knows it all. - L. Sprague de Camp
lectricpharaoh is offline   Reply With Quote
Old Aug 19th, 2005, 6:47 PM   #29
CodeJunkie
Programmer
 
Join Date: Aug 2005
Location: England
Posts: 37
Rep Power: 0 CodeJunkie is on a distinguished road
thanx ... Much clearer...
Perhaps im opening up a can of worms here but i have to ask...
how can a chip offer diffrent instructions.. i thought that a processor simply deals with 1s and 0s And/Or/Not how do some chips offer more??
CodeJunkie is offline   Reply With Quote
Old Aug 19th, 2005, 6:57 PM   #30
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Built in math processes, interface to math coprocessors, internal RAM or ROM or IO, enhanced addressing modes, special multimedia instructions, a plethora of things. I highly recommend Google and reading, if you're truly interested. There is a ton of information available to you without us undertaking to personally tutor you in forum posts and responses.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:51 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC