473,769 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

c/pascal compiler differences

Hi,

I think I understand now a bit better what the difference is between a c
compiler and a pascal compiler.

For example:

When compiling source code with a pascal compiler. The pascal compiler will
simply stop when it is missing an implementation for a procedure or
whatever.

The c compiler however will simply continue compiling even if the
implementation for the headers/prototypes are missing.

The c linker will then report a big list of link errors.

Both methods have benefits and drawbacks. The pascal compiler is more
simple... it allows one to simply proceed from error to error until it
completely compiles and links.

The drawback of the c compiler might be the suspended error reporting...
it's a bit wacky... since one can not jump to the location where the stuff
is missing ?

or maybe one can... it's a bit wacky...

Though I can clearly see a benefit for a c compiler since it simply compiles
even though the implementation is completely missing.

One could later even make different implementations and simple re-use the
already compiled stuff and link against it.

So one can end up linking different kind of stuff against the same compiled
C file.

I think this is correct though I never really tried it.

Are there any good examples where this C/link freedom is used ?

Does a pascal compiler have the same link freedom ? ( meaning prototype
available but implementation missing )

I think not... ?

Bye,
Skybuck.
Nov 14 '05 #1
28 2274
"Skybuck Flying" <no****@hotmail .com> wrote in message
news:cg******** **@news2.tilbu1 .nb.home.nl...
I think I understand now a bit better what the difference is between a
c compiler and a pascal compiler.

For example:

When compiling source code with a pascal compiler. The pascal compiler
will simply stop when it is missing an implementation for a procedure
or whatever.

The c compiler however will simply continue compiling even if the
implementation for the headers/prototypes are missing.


Pascal was specifically designed to allow one-pass compilation. So
whenever something is missing, that's an instant error. C, also by
design, is much looser. You can put a "void writeln();" pretty much
anywhere in your code, and there is no error until you try to link
together an executable that doesn't have a writeln procedure somewhere.
There's a keyword "extern", but it may be omitted.

Groetjes,
Maarten Wiltink
Nov 14 '05 #2
Skybuck Flying wrote:

I think I understand now a bit better what the difference is
between a c compiler and a pascal compiler.


.... snip gross misconceptions ...

The fundamental difference is the source language. Anything else
is a frill. c.l.c deals solely with the language, and not the
compilers. The languages are defined by the ISO standards.

BTW, Pascal is always capitalized.

--
fix (vb.): 1. to paper over, obscure, hide from public view; 2.
to work around, in a way that produces unintended consequences
that are worse than the original problem. Usage: "Windows ME
fixes many of the shortcomings of Windows 98 SE". - Hutchison
Nov 14 '05 #3
> When compiling source code with a pascal compiler. The pascal compiler will
simply stop when it is missing an implementation for a procedure or
whatever.

The c compiler however will simply continue compiling even if the
implementation for the headers/prototypes are missing.

The c linker will then report a big list of link errors.


C got two stages of compiling, compilation and linking. Pascal doesn't
use linking (here it is a part of the normal compilation). In C it is
not a compilation error if an implementation of a method/variable is
missing; it is a linker error. In Pascal it is a compiler error as it
links while compiling.

Of course you can make a program with a button which, on clicking,
will run "MyMethod() " which is defined in "blah.h" but missing the
implementation. You can then compile ten different object files with
ten different implementations of MyMethod(), then link them into ten
different programs with ten different things happening when you click
the button.

But you can do that same thing in Pascal, make your onclick run
MyProcedure(), make ten different MyProcedure() implementations , then
add one of them to your uses. Generates the same as the C linker. It
will compile the whole thing everytime (unlike C where only the linker
is run), but in Pascal you can actually have all ten implementations
of MyProcedure() in the same project ;)
Nov 14 '05 #4

"Skybuck Flying" <no****@hotmail .com> wrote in message
news:cg******** **@news2.tilbu1 .nb.home.nl...
Does a pascal compiler have the same link freedom ? ( meaning prototype
available but implementation missing )

I think not... ?


As usual you think wrong. See the External Declarations entry in the Delphi
help. Pay particular attention to the $LINK compiler directive.
Nov 14 '05 #5

"Bruce Roberts" <be*@bounceitat tcanada.xnet> wrote in message
news:xx******** **********@news 20.bellglobal.c om...

"Skybuck Flying" <no****@hotmail .com> wrote in message
news:cg******** **@news2.tilbu1 .nb.home.nl...
Does a pascal compiler have the same link freedom ? ( meaning prototype
available but implementation missing )

I think not... ?
As usual you think wrong. See the External Declarations entry in the

Delphi help. Pay particular attention to the $LINK compiler directive.


When is it linked into it ?

Occurding to some posts... compiling and linking is the same thing in
pascal.

So it's actually linked in at compile time... that would be my guess.

That's still fundamentally different than C ;)

Unless I am mistaking :D
Nov 14 '05 #6

"Bruce Roberts" <be*@bounceitat tcanada.xnet> wrote in message
news:xx******** **********@news 20.bellglobal.c om...

"Skybuck Flying" <no****@hotmail .com> wrote in message
news:cg******** **@news2.tilbu1 .nb.home.nl...
Does a pascal compiler have the same link freedom ? ( meaning prototype
available but implementation missing )

I think not... ?
As usual you think wrong. See the External Declarations entry in the

Delphi help. Pay particular attention to the $LINK compiler directive.

That Delphi, not standard Pascal.
Nov 14 '05 #7

"Skybuck Flying" <no****@hotmail .com> wrote in message
news:cg******** **@news3.tilbu1 .nb.home.nl...
Occurding to some posts... compiling and linking is the same thing in
pascal.

So it's actually linked in at compile time... that would be my guess.

That's still fundamentally different than C ;)


Delphi first compiles units then it links the project. If all units are
up-to-date, essentially the only thing that happens is the linking.

Nov 14 '05 #8
"Skybuck Flying" <no****@hotmail .com> wrote in message
news:cg******** **@news3.tilbu1 .nb.home.nl...
[...]
Occurding to some posts... compiling and linking is the same thing in
pascal.


D-C-U.

Groetjes,
Maarten Wiltink
Nov 14 '05 #9
On Mon, 23 Aug 2004 17:02:47 +0200
"Skybuck Flying" <no****@hotmail .com> wrote:

"Bruce Roberts" <be*@bounceitat tcanada.xnet> wrote in message
news:xx******** **********@news 20.bellglobal.c om...

"Skybuck Flying" <no****@hotmail .com> wrote in message
news:cg******** **@news2.tilbu1 .nb.home.nl...
Does a pascal compiler have the same link freedom ? ( meaning
prototype available but implementation missing )

I think not... ?


As usual you think wrong. See the External Declarations entry in the

Delphi
help. Pay particular attention to the $LINK compiler directive.


When is it linked into it ?

Occurding to some posts... compiling and linking is the same thing in
pascal.

So it's actually linked in at compile time... that would be my guess.

That's still fundamentally different than C ;)

Unless I am mistaking :D


It all depends on WHICH Pascal variant you are talking about. I've used
versions of Pascal where the Linking was done at run time.

The original Pascal definition did not support separately compiled
modules so there was not much linking to be done. Later extensions added
separate compilation of modules at which point linkers became involved
and worked basically the same as they do for C. However, the language
definition still included (and probably still does) a requirement to
declare before first use, something the original C did not (I can't
remember if C99 has added that but some compilers provide it as an
extension). To allow for things like mutually recursive functions Pascal
included a forward declaration which gives the compiler the signature of
the function and tells it to resolve it further down the file.

Also, whilst Pascal and C are very different languages in many respects
there are implementations which provide mechanisms for linking C code
and Pascal code, so the linkage requirements of the languages can't be
mutually incompatible. However, the method for linking the two languages
is off topic for this group. :-)
--
Flash Gordon
Sometimes I think shooting would be far too good for some people.
Although my email address says spam, it is real and I read it.
Nov 14 '05 #10

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

Similar topics

4
4393
by: Chris Gordon-Smith | last post by:
I am tying to call a Pascal function from C++, and vice versa. Does anyone know how to do this, or where detailed information on this topic can be found? For the C++ to Pascal call I have tried declaring the Pascal function as:- extern "C" void PASCALTESTFUNC1(); within my C++ code. However, the linker is giving me an unresolved
4
2321
by: Hans-Marc Olsen | last post by:
C++ is only good for writing a compiler of a much superior language like Pascal. So use your C++ to write a PASCAL compiler or BASIC and use this.
14
23434
by: digital | last post by:
hello anyone... pls explain me , how different between function and procedure for C/C++ and Pascal. Thankx......
2
2165
by: gwlemyre | last post by:
I am not a PASCAL programmer and I saw this piece of code. procedure Expression; Forward; procedure Factor; begin if Look = '(' then begin Match('('); Expression; Match(')'); end
6
6913
by: kkrish | last post by:
hi, I am working on an old program written in c.The program uses a function like this "unsigned long int far pascal ReadFile(char *buff,unsigned long int *size)" . Is this a PASCAL function CALL from C?Do I need to have Pascal installed in my system.This has been written in Turbo C 2.0 under
5
3664
by: dhruba.bandopadhyay | last post by:
I am trying to port an old Pascal DOS game to DOS C/C++. I am wondering if anyone is familar with the dos & crt Pascal units and whether there are C/C++ equivalent libraries. Maybe dos.c & crt.c? Below lists names of variables, functions, types & weird interrupt procedures found in Pascal. Am wondering what can be done to get around them for use in C/C++. dos.pas crt.pas
41
18219
by: Miroslaw Makowiecki | last post by:
Where can I download Comeau compiler as a trial version? Thanks in advice.
7
5962
by: SMALLp | last post by:
Hy! I desperately need help! I need to make application that would accept Pascal code and check if it returns good results. My idea is (from a beginner point of view) to make application in python that would send code (text) to pascal compiler (Free pascal compiler that can be used from command prompt in windows) and it would return result and then application would show that result.
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7410
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6674
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5304
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3962
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3563
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.