On 8 Mai, 22:06, Marco van de Voort <mar...@[EMAIL PROTECTED]
> wrote:
> On 2008-05-08, thomas.mer...@[EMAIL PROTECTED]
<thomas.mer...@[EMAIL PROTECTED]
> wrote:
>
> >> > standard Pascal. The area covered by the standard C library
> >> > is IMHO also a little bit bigger.
>
> >> Maybe. I never counted both, but the difference is not even close as
a basis
> >> for C's "****tability".
>
> > That is one opinion, but not my opinion.
> > I suggest your talk about that with people who know
> > both languages and their libraries inside out.
>
> Well, I base myself on K & R (appendix C of the 2nd edition to be
exact).
That is a good C reference. For a ****table Pascal the ISO 7185
Pascal (available here: http://www.standardpascal.org/iso7185.html)
minus the things that are not available under Borland Pascal/Delphi
must be used (this is descibed as answer to "Is it possible to write
in a Pascal subset that will be acceptable to both ISO 7185 Pascal
and Delphi?" here: http://www.standardpascal.org/pascalfaq.html)
> I count 100 calls tops (and that includes some limit constants). Aside
> from basic file I/O (which is the roughly the same subset in Pascal)
Well not exactly. What about 'remove', 'rename', 'fseek', 'ftell'?
AFAICS ISO 7185 Pascal does not contain something equivalent.
The string functions of string.h are ugly but better than nothing.
In ISO 7185 Pascal I did not find string functions at all (I know
that the type 'string' is common in various Pascal dialects, but
AFAICS there is none in the standard. The include file math.h
contains more trigonometric functions than standard Pascal.
What about rand, malloc, realloc, getenv, bsearch, qsort.
I am sure that there are similar functions available in every
dialect of Pascal, but seemingly not in the standard. The functions
setjmp and longjmp can be used to emulate an exception handling
that is missing in C and standard Pascal. You already mentioned
signal.h and time.h which can also be useful.
> I count gettime, system() and signal as the other OS wrapping
> functions (of which signal is not implemented on non Unices, or
> only for runtime internal exceptions)
At least under windows the signal handling is present.
Additionally many POSIX functions are ****ted to different
operating systems as well (Ok, they are not granted to be
available, but the probability to find them is not zero
and they usually use a C interface).
> I couldn't do the same quickly for pascal, but my guestimate would be
40-50
> calls (built-ins inclusive). So it boils all down to gettime, system and
> signal?
Not really as shown above.
BTW. A quick look at the Seed7 do***entation of the predefined
types (at: http://seed7.sourceforge.net/manual/types.htm)
revealed that they define
100 operators (like + - * / div, rem, mdiv, mod, and, or, not)
84 relations (like < > <= >= = <>)
192 functions (like pred, succ, abs, atan2, compare, hashCode)
79 statements and procedures (like read, write, for)
19 assignment statements ( := )
For this list I examined only the types
boolean, integer, bigInteger, rational, bigRational, float, char,
string, array, hash, set, struct, ptr, enumeration, color, time
duration, file and text.
I did not take into account other stuff like
reflection, graphics, scanner, charsets, directory,
file management and more.
Compared to standard C and standard Pascal the size of the Seed7
library is not bad (But there is still much room for improvement).
> >> In some form or the other, if you interface or emulate them yes.
However it
> >> doesn't matter if you do that from C or Pascal.
>
> > As I explaind already, my critical points about Pascal's
> > ****tability start with the language itself (else/otherwise
> > clause for case statements,
>
> That is a dialect question, not ****tability. And it is not that strange
in C
> land either (mixing prototypes with original K&R C, dialects that
consider
> void * compatible with any pointer, vs the ones that still use char *
for
> that)
>
> > file buffer variables
>
> What exactly?
I was speaking of f^ and the procedures 'get' and 'put' which are
AFAIK not present under Delphi.
> > OTOH in C there are not such
> > issues (as long as you refrain from using Microsofts (and others)
> > extensions).
>
> Well, see above. C hasn't been constant in the history also. The MS
> extensions are often just that, pre-standard implementations that
deviate
> from the final standard.
>
> > IMHO avoiding extensions of the language in C is easy while
> > in Pascal it is sometimes unavoidable.
>
> You point to few original sources or own research for that conclusion.
You
> might be right, but I don't have the information to reach the same
> conclusion.
I hope that there are more links to original sources this time.
Greetings Thomas Mertes
Seed7 Homepage: http://seed7.sourceforge.net
Seed7 - The extensible programming language: User defined statements
and operators, abstract data types, templates without special
syntax, OO with interfaces and multiple dispatch, statically typed,
interpreted or compiled, ****table, runs under linux/unix/windows.


|