c / pascal编译器差异 [英] c/pascal compiler differences

查看:58
本文介绍了c / pascal编译器差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我想我现在更了解ac

编译器和pascal编译器之间的区别。


例如:


使用pascal编译器编译源代码时。 pascal编译器将会在缺少程序实现时停止,或者b / b
无论如何。


c编译器然而即使缺少标头/原型的

实现,也会继续编译。


c链接器将报告一个很大的链接错误列表。


这两种方法都有其优点和缺点。 pascal编译器更简单... b $ b允许一个人简单地从错误转到错误,直到它完全编译和链接为止。


c编译器的缺点可能是挂起的错误报告...

它有点古怪...因为一个人无法跳转到那些东西的位置

不见了?


或者也许可以......它有点古怪......


虽然我可以清楚地看到ac编译器的一个好处,因为它简单地编译了

,即使实现完全缺失。


后来甚至可以做出不同的实现和简单的重新编译 - 使用

已编译的东西并链接到它。


所以最终可以将不同类型的东西链接到同一个编译的

C档。


我认为这是正确的,虽然我从来没有真正尝试过。


这个C有什么好的例子吗使用/链接自由?


pascal编译器是否具有相同的链接自由度? (意思是原型

可用,但实施缺失)


我认为不是......?


再见,

Skybuck。

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.

推荐答案

" Skybuck Flying" <无**** @ hotmail.com>在消息中写道

news:cg ********** @ news2.tilbu1.nb.home.nl ...
"Skybuck Flying" <no****@hotmail.com> wrote in message
news:cg**********@news2.tilbu1.nb.home.nl...
I我觉得我现在更了解一下
c编译器和pascal编译器之间的区别。

例如:

用pascal编译源代码时编译器。 pascal编译器只需在缺少某个程序的实现时就会停止。

即使
实现,c编译器也只会继续编译。缺少标题/原型。
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专门设计用于允许一次通过编译。所以当缺少某些东西时,这是一个即时错误。 C,也是通过

设计,更宽松。你可以放一个void writeln();你的代码中的任何地方几乎都是
,并且在你尝试将

链接在一个可执行的某个地方没有写入程序的可执行程序之前没有错误。

有一个关键字extern,但可能会被省略。


Groetjes,

Maarten Wiltink



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


Skybuck Flying写道:
Skybuck Flying wrote:

我想我现在更了解ac编译器和pascal编译器之间的区别是什么。

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




....消除严重误解......


根本区别在于源语言。还有其他的东西

是个褶边。 c.l.c仅处理语言,而不是

编译器。这些语言由ISO标准定义。


BTW,Pascal总是大写。


-

修复(vb。):1。纸张覆盖,模糊,隐藏在公众视野之外; 2.

以一种产生意想不到的后果的方式来解决,比原来的问题更糟糕。用法:Windows ME

修复了Windows 98 SE的许多缺点。 - Hutchison



.... 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


>用pascal编译器编译源代码时。 pascal编译器将
> When compiling source code with a pascal compiler. The pascal compiler will
只是在它缺少一个过程的实现或什么时候停止。

然而,c编译器只会继续编译,即使<缺少标头/原型的实现。

然后c链接器会报告一个很大的链接错误列表。
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有两个阶段的编译,编译和链接。 Pascal没有使用链接(这是正常编译的一部分)
。在C中,如果方法/变量的实现缺少
,则不是编译错误;这是一个链接器错误。在Pascal中,这是一个编译器错误,因为它在编译时链接了



当然你可以用一个按钮创建一个程序,点击后,

将运行MyMethod()它在blah.h中定义。但是错过了

的实现。然后,您可以使用

十个不同的MyMethod()实现编译十个不同的目标文件,然后将它们链接到十个不同的程序中,当您单击按钮。


但是你可以在Pascal中做同样的事情,让你的onclick运行

MyProcedure(),使十个不同MyProcedure()实现,然后

将其中一个添加到您的使用中。生成与C链接器相同的内容。它每次都会编译整个东西(不像C只运行链接器

),但是在Pascal中你可以实际拥有所有十个实现

of MyProcedure()在同一个项目中;)



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 ;)


这篇关于c / pascal编译器差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆