porting vs migrating

  • Thread starter subramanian100in
  • Start date
R

Richard Heathfield

(e-mail address removed), India said:
Is there any difference between porting and migrating.

Not as far as C is concerned. They both mean "copy the source code to
the new system, and re-compile". This is a trouble-free process taking
just a few seconds, if you wrote the C code properly.
 
W

websnarf

(e-mail address removed), India said:

Not as far as C is concerned. They both mean "copy the source code to
the new system, and re-compile". This is a trouble-free process taking
just a few seconds, if you wrote the C code properly.

Yes, unfortunately, this is a mainly theoretic view of the subject,
since there are almost no real world examples of this.
 
R

Richard Heathfield

(e-mail address removed) said:
Yes, unfortunately, this is a mainly theoretic view of the subject,
since there are almost no real world examples of this.

Of what? People writing C code properly?

In my universe, porting code between systems is normal, even
commonplace, and the most frequent porting issue for me is simply that
the compiler on one system picks up on some minor code flaw that the
other compiler ignored. The fix is generally a one-liner.
 
F

Flash Gordon

Yes, unfortunately, this is a mainly theoretic view of the subject,
since there are almost no real world examples of this.

Fortunately a major part of one of the projects I have worked on was one
such example. I was able to debug most of the embedded code on a
workstation which had better facilities than the embedded target, then I
just recompiled the same code for the embedded system and it worked.
 
B

Beej Jorgensen

Richard Heathfield said:
In my universe, porting code between systems is normal

Mine, too, but that was because we had a massive compatibility layer
underneath. I developed for three platforms simultaneously--the "port"
was basically a different Makefile.

But if you wanted it on a new platform, another engineer (or team of
engineers) came in and ported that compatibility layer. That was
not a one-liner.

-Beej
 
E

Eric Sosman

Yes, unfortunately, this is a mainly theoretic view of the subject,
since there are almost no real world examples of this.

That was true in the Bad Old Days, before the ANSI Standard.
A typical "portable" program from that era was larded and barded
with #ifdef and other preprocessor prestidigitation to the point
of near-unreadability. Porting was a struggle.

Them days, they be gone. The single most beneficial effect
of the Standard was, in my opinion, to make the Bad Old Ways of
the Bad Old Days largely unnecessary; C is now a far more portable
language than it was in the 1980's. There is a price to be paid,
of course: One can gain the benefit of the Standard only to the
degree that one is willing to live within its strictures. Some
remain unwilling to hobble their "creativity" and "freedom;" they
have a different view of C's portability than do others, probably
because of their experiences with their own programs.
 
C

CBFalconer

Is there any difference between porting and migrating.

The elk in Northern Canada and Alaska migrate. I have never heard
of them porting. Birds migrate, but very rarely port. Ships turn
to port (or starboard), but rarely migrate.

--
Some informative links:
<http://www.catb.org/~esr/faqs/smart-questions.html>
<http://www.caliburn.nl/topposting.html>
<http://www.netmeister.org/news/learn2quote.html>
<http://cfaj.freeshell.org/google/> (taming google)
<http://members.fortunecity.com/nnqweb/> (newusers)
 
B

Bill Reid

BWHAHAHAHAHAHA!!! I also like the part about
ports being a "trouble-free process taking just a few seconds,
if you wrote the C code properly"...isn't this the point where
he says, "I'm here all week, try the veal"?

Mine, too,

You live in his mother's basement too?
but that was because we had a massive compatibility layer
underneath.

Apparently not, because you just gave the correct answer for
actual real-world large-scale applications running on actual general
purpose computers...
I developed for three platforms simultaneously--the "port"
was basically a different Makefile.
Well, "basically" is the key word there, but I've seen compatibility
packages that supported like nine systems or more, without too much
drama. But, in order to to comply with the compatibility rules you had
to do a whole bunch of stuff that frequently causes group hissy-fits here...
But if you wanted it on a new platform, another engineer (or team of
engineers) came in and ported that compatibility layer. That was
not a one-liner.
Well, for mommy's basement fantasy "Hello World" programs,
it would be a zero-liner, just like Java "ports"...
 
B

Beej Jorgensen

Bill Reid said:
You live in his mother's basement too?
Well, for mommy's basement fantasy "Hello World" programs,
it would be a zero-liner, just like Java "ports"...

Well, I was being ironic.

Are you being ironic, too?

-Beej
 
S

Stan Milam

Richard said:
(e-mail address removed), India said:


Not as far as C is concerned. They both mean "copy the source code to
the new system, and re-compile". This is a trouble-free process taking
just a few seconds, if you wrote the C code properly.

I think there may be a distinction here. Yes, migrating is moving and
recompiling all that properly, standard conforming, written code.
However, porting will have to be done for all that code written to
abstract away the OS or hardware platform, and that is where the devil
lives.

--
Regards,
Stan Milam
=============================================================
Charter Member of The Society for Mediocre Guitar Playing on
Expensive Instruments, Ltd.
=============================================================
 
S

Stephen Sprunk

Is there any difference between porting and migrating.

There's no formal definitions I'm aware of, but in general when you "port"
software, you are making it so that the code works on a new system in
addition to the old one, i.e. it has to work on both. In contrast, when you
"migrate" something, having it work on the old system is not a goal, so you
may make more disruptive changes.

For instance, many companies "migrated" apps from DOS to Windows. However,
they would then "port" the Windows app to MacOS. UNIX-ish apps tend to be
ported to dozens of systems.

Depending on how well your code is written, the process of porting or
migrating may take anywhere from minutes to years. Generally the first port
is hard, since it typically means creating a platform abstraction layer
(assuming your code didn't have one from the start), and after that they're
relatively easy. Migrations seem to always be hard, but they're hopefully
infrequent.

S
 
R

Richard Heathfield

Stan Milam said:
I think there may be a distinction here. Yes, migrating is moving and
recompiling all that properly, standard conforming, written code.
However, porting will have to be done for all that code written to
abstract away the OS or hardware platform, and that is where the devil
lives.

In situations where that's true, it's typically 1% of the code base or
less - and, as you suggest - if you're sensible you've carefully
isolated it to ease rewriting. And in situations where it's false, it's
false anyway.

The reason for my admittedly somewhat provocative reply is that there is
a perception amongst some clcers that you can't write real programs in
100% ISO C. Well, I would agree with the contention that you can't
write /all/ real programs in 100% ISO C, but the subset of programs
that you /can/ write is much, much larger than people realise. This is
probably at least in part because many of them have grown up in a GUI
world - if it don't have gooeys, it ain't really a program - but of
course this perception is utterly false.
 
J

jaysome

(e-mail address removed), India said:


Not as far as C is concerned. They both mean "copy the source code to
the new system, and re-compile". This is a trouble-free process taking
just a few seconds, if you wrote the C code properly.

I have this simple Standard C program:

#include <stdio.h>
int main(void)
{
printf("Hello world.\n");
return 0;
}

I copied the source code file from my IBM mainframe to my Windows box.
I compiled it using Microsoft VC++, but I got a lot of warnings:

hello.c(1) : error C2449: found '{' at file scope (missing function
header?)
hello.c(1) : error C2018: unknown character '0x89'
hello.c(1) : error C2018: unknown character '0x95'
hello.c(1) : error C2018: unknown character '0x83'
hello.c(1) : error C2018: unknown character '0x93'
hello.c(1) : error C2018: unknown character '0xa4'
hello.c(1) : error C2018: unknown character '0x84'
hello.c(1) : error C2018: unknown character '0x85'
hello.c(1) : error C2018: unknown character '0x40'
hello.c(1) : error C2018: unknown character '0xa2'
hello.c(1) : error C2018: unknown character '0xa3'
hello.c(1) : error C2018: unknown character '0x84'
hello.c(1) : error C2018: unknown character '0x89'
hello.c(1) : error C2018: unknown character '0x96'
hello.c(1) : error C2018: unknown character '0x88'
hello.c(1) : error C2018: unknown character '0x89'
hello.c(1) : error C2018: unknown character '0x95'
hello.c(1) : error C2018: unknown character '0xa3'
hello.c(1) : error C2018: unknown character '0x40'
hello.c(1) : error C2018: unknown character '0x94'
hello.c(1) : error C2018: unknown character '0x81'
hello.c(1) : error C2018: unknown character '0x89'
hello.c(1) : error C2018: unknown character '0x95'
hello.c(1) : error C2018: unknown character '0xa5'
hello.c(1) : error C2018: unknown character '0x96'
hello.c(1) : error C2018: unknown character '0x89'
hello.c(1) : error C2018: unknown character '0x84'
hello.c(1) : error C2018: unknown character '0xc0'
hello.c(1) : error C2018: unknown character '0x5'
hello.c(1) : error C2018: unknown character '0x97'
hello.c(1) : error C2018: unknown character '0x99'
hello.c(1) : error C2018: unknown character '0x89'
hello.c(1) : error C2018: unknown character '0x95'
hello.c(1) : error C2018: unknown character '0xa3'
hello.c(1) : error C2018: unknown character '0x86'
hello.c(1) : error C2018: unknown character '0x7f'
hello.c(1) : error C2018: unknown character '0xc8'
hello.c(1) : error C2018: unknown character '0x85'
hello.c(1) : error C2018: unknown character '0x93'
hello.c(1) : error C2018: unknown character '0x93'
hello.c(1) : error C2018: unknown character '0x96'
hello.c(1) : error C2018: unknown character '0x40'
hello.c(1) : error C2018: unknown character '0xa6'
hello.c(1) : error C2018: unknown character '0x96'
hello.c(1) : error C2018: unknown character '0x99'
hello.c(1) : error C2018: unknown character '0x93'
hello.c(1) : error C2018: unknown character '0x84'
hello.c(1) : error C2018: unknown character '0xe0'
hello.c(1) : error C2018: unknown character '0x95'
hello.c(1) : error C2018: unknown character '0x7f'
hello.c(1) : error C2018: unknown character '0x5'
hello.c(1) : error C2018: unknown character '0x99'
hello.c(1) : error C2018: unknown character '0x85'
hello.c(1) : error C2018: unknown character '0xa3'
hello.c(1) : error C2018: unknown character '0xa4'
hello.c(1) : error C2018: unknown character '0x99'
hello.c(1) : error C2018: unknown character '0x95'
hello.c(1) : error C2018: unknown character '0x40'
hello.c(1) : error C2018: unknown character '0xf0'
hello.c(1) : error C2018: unknown character '0xd0'
hello.c(2) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
hello.exe - 62 error(s), 0 warning(s)

I also compiled it with gcc and got an error:

gcc -Wall -W -o hello hello.c
main.c:1: parse error before `{'

When I look at the code on my monitor on my IBM mainframe it looks
like "portable" C. I suspect there is a character encoding issue and I
need to "migrate" the code from the IBM mainframe to my PC by using an
EBCDIC-to-ASCII translator, as I seem to recall that the encoding of
the character set is not specified by the C standard.

Best regards
 
S

santosh

jaysome said:
I have this simple Standard C program:

#include <stdio.h>
int main(void)
{
printf("Hello world.\n");
return 0;
}

I copied the source code file from my IBM mainframe to my Windows box.
I compiled it using Microsoft VC++, but I got a lot of warnings:

hello.c(1) : error C2449: found '{' at file scope (missing function
header?)
hello.c(1) : error C2018: unknown character '0x89'

hello.c(2) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
hello.exe - 62 error(s), 0 warning(s)

I also compiled it with gcc and got an error:

gcc -Wall -W -o hello hello.c
main.c:1: parse error before `{'

When I look at the code on my monitor on my IBM mainframe it looks
like "portable" C. I suspect there is a character encoding issue and I
need to "migrate" the code from the IBM mainframe to my PC by using an
EBCDIC-to-ASCII translator, as I seem to recall that the encoding of
the character set is not specified by the C standard.

But, this can be called porting or migrating, since it involves no
changes to the source itself, merely to the files that contain them.
Moreover, this is trivial conversion that'll take a few minutes at the
most.
 
S

santosh

santosh said:
jaysome said:
I have this simple Standard C program:

#include <stdio.h>
int main(void)
{
printf("Hello world.\n");
return 0;
}

I copied the source code file from my IBM mainframe to my Windows box.
I compiled it using Microsoft VC++, but I got a lot of warnings:

hello.c(1) : error C2449: found '{' at file scope (missing function
header?)
hello.c(1) : error C2018: unknown character '0x89'

hello.c(2) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
hello.exe - 62 error(s), 0 warning(s)

I also compiled it with gcc and got an error:

gcc -Wall -W -o hello hello.c
main.c:1: parse error before `{'

When I look at the code on my monitor on my IBM mainframe it looks
like "portable" C. I suspect there is a character encoding issue and I
need to "migrate" the code from the IBM mainframe to my PC by using an
EBCDIC-to-ASCII translator, as I seem to recall that the encoding of
the character set is not specified by the C standard.

But, this can be called porting or migrating, [ ... ]

Sorry, I meant to write:

But this can't be called porting or migrating, [ ... ]

Why do typos tend to strike in the worst possible space?
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top