View mode: basic / threaded / horizontal-split · Log in · Help
October 23, 2010
Language progress? [partially OT]
Just a lazy note, don't take this too much seriously.

The Computer Language Benchmarks Game (Computer Shootout) has added some Clojure implementations, they are not tuned and refined yet (probably unlike the Free Pascal versions). This is one of the problems ("fasta"), there are two Free Pascal and two Clojure implementations:

http://shootout.alioth.debian.org/u64q/performance.php?test=fasta&sort=kb

The Clojure versions currently use about 370_000 KB of RAM to run, their source code is about 1_600 compressed bytes long, and their run time is about 30-38 seconds.

The Free Pascal versions use about 250 KB of RAM, their compressed source code is about 1_100-1_200 bytes long, and their runtime is 8-12 seconds.

I have written many small programs in Scheme, but for me that Free Pascal code is more readable than that Clojure code. Probably Free Pascal lacks some of the cool new features of Clojure (including a garbage collector), but I don't see much progress in languages development/hystory here ;-)


A question: Here for example the cheapest C program uses 452 KB of RAM. On average in the Shootout benchmarks Free Pascal uses less or quite less RAM than the D programs. Do you know why the Free Pascal programs use so little RAM?

Bye,
bearophile
October 23, 2010
Re: Language progress? [partially OT]
bearophile wrote:
> A question: Here for example the cheapest C program uses 452 KB of RAM. On
> average in the Shootout benchmarks Free Pascal uses less or quite less RAM
> than the D programs. Do you know why the Free Pascal programs use so little
> RAM?

Pascal doesn't use GC.
October 23, 2010
Re: Language progress? [partially OT]
Walter Bright:

> bearophile wrote:
> > A question: Here for example the cheapest C program uses 452 KB of RAM. On
> > average in the Shootout benchmarks Free Pascal uses less or quite less RAM
> > than the D programs. Do you know why the Free Pascal programs use so little
> > RAM?
> 
> Pascal doesn't use GC.

Sorry, I meant C there! My mistake!

Bye,
bearophile
October 23, 2010
Re: Language progress? [partially OT]
Walter Bright schrieb:
> bearophile wrote:
>> A question: Here for example the cheapest C program uses 452 KB of 
>> RAM. On average in the Shootout benchmarks Free Pascal uses less or quite less 
>> RAM than the D programs. Do you know why the Free Pascal programs use so 
>> little RAM?
> 
> Pascal doesn't use GC.
> 

Neither does C
October 23, 2010
Re: Language progress? [partially OT]
I still have found memories of Pascal (actually Turbo Pascal/Delphi).

Not sure about FreePascal, but I remember Turbo Pascal used to have a better 
memory allocator
than C.

In the old days (Windows 3.x) the runtime memory manager has more optimized 
than the C compiler
family. Please note I am speaking about  Borland compilers here.

That not being the case, I would say that whoever implemented the algorithms 
in C is not as good as
the one who did them in Pascal. Or did not use the proper compiler flags.

--
Paulo


"bearophile" <bearophileHUGS@lycos.com> wrote in message 
news:i9tio7$26dd$1@digitalmars.com...
> Just a lazy note, don't take this too much seriously.
>
> The Computer Language Benchmarks Game (Computer Shootout) has added some 
> Clojure implementations, they are not tuned and refined yet (probably 
> unlike the Free Pascal versions). This is one of the problems ("fasta"), 
> there are two Free Pascal and two Clojure implementations:
>
> http://shootout.alioth.debian.org/u64q/performance.php?test=fasta&sort=kb
>
> The Clojure versions currently use about 370_000 KB of RAM to run, their 
> source code is about 1_600 compressed bytes long, and their run time is 
> about 30-38 seconds.
>
> The Free Pascal versions use about 250 KB of RAM, their compressed source 
> code is about 1_100-1_200 bytes long, and their runtime is 8-12 seconds.
>
> I have written many small programs in Scheme, but for me that Free Pascal 
> code is more readable than that Clojure code. Probably Free Pascal lacks 
> some of the cool new features of Clojure (including a garbage collector), 
> but I don't see much progress in languages development/hystory here ;-)
>
>
> A question: Here for example the cheapest C program uses 452 KB of RAM. On 
> average in the Shootout benchmarks Free Pascal uses less or quite less RAM 
> than the D programs. Do you know why the Free Pascal programs use so 
> little RAM?
>
> Bye,
> bearophile
October 23, 2010
Re: Language progress? [partially OT]
Paulo Pinto:

> I would say that whoever implemented the algorithms 
> in C is not as good as
> the one who did them in Pascal. Or did not use the proper compiler flags.

I don't know the answer, but I think both those hypothesis are not substantiated by facts, because in the Shootout site the C compiler flags are chosen carefully (they are chosen for speed), while the C programs are probably written a bit better than the Free Pascal ones (Free Pascal uses ObjectPascal, it's a language quite far from the original Pascals). Maybe the Free Pascal compiler is just better than GCC regarding static/stack memory usage.

Bye,
bearophile
October 23, 2010
Re: Language progress? [partially OT]
Sat, 23 Oct 2010 08:10:50 -0400, bearophile wrote:

> Paulo Pinto:
> 
>> I would say that whoever implemented the algorithms in C is not as good
>> as
>> the one who did them in Pascal. Or did not use the proper compiler
>> flags.
> 
> I don't know the answer, but I think both those hypothesis are not
> substantiated by facts, because in the Shootout site the C compiler
> flags are chosen carefully (they are chosen for speed), while the C
> programs are probably written a bit better than the Free Pascal ones

> Maybe the Free Pascal compiler is just better than
> GCC regarding static/stack memory usage.

My guess is, Pascal enforces a coding style that tries to minimize 
resource use. For example all local variables need to be defined before 
statements. It also lacks many high level constructs, which might contain 
inefficiencies the programmer isn't aware of.

> (Free Pascal uses ObjectPascal, it's a language quite far from the
> original Pascals).

I can assure you that most commercial / hobbyist users of Pascal haven't 
used the original Pascal since Moses was born. The early Turbo Pascal 
already got units (1987) and object-oriented features [ == Object Pascal ] 
(1986 Mac, 1989 PC). Might be the case that you weren't even born when 
Object Pascal came.
October 23, 2010
Re: Language progress? [partially OT]
retard wrote:
> I can assure you that most commercial / hobbyist users of Pascal haven't 
> used the original Pascal since Moses was born.

I tried to use Pascal around 1979-1980. It's probably the most unusable language 
ever invented. Every commercial implementation of it had to have a boatload of 
extensions to make it work.

The problem was, of course, every vendor implemented a different boatload.
October 23, 2010
Re: Language progress? [partially OT]
On Sat, 2010-10-23 at 15:23 -0700, Walter Bright wrote:
> retard wrote:
> > I can assure you that most commercial / hobbyist users of Pascal haven't 
> > used the original Pascal since Moses was born.
> 
> I tried to use Pascal around 1979-1980. It's probably the most unusable language 
> ever invented. Every commercial implementation of it had to have a boatload of 
> extensions to make it work.
> 
> The problem was, of course, every vendor implemented a different boatload.

Pascal was never really intended as a production language, it was
intended for teaching programming and the abstract concepts behind
programming.  I suggest that in the period 1972-82 it achieved its goals
admirably.  From 1984 onwards it was clearly becoming insufficient for
the task and things moved on.

Most of the commercial Pascal varieties tried to be variants on Modula-2
but labelled themselves Pascal, and here lie the real problems and the
hassles that led to Pascal ending up with a bad name -- one it should
not be landed with in perpituity. 
-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder@ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel@russel.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
October 24, 2010
Re: Language progress? [partially OT]
Russel Winder wrote:
> Pascal was never really intended as a production language, it was
> intended for teaching programming and the abstract concepts behind
> programming.  I suggest that in the period 1972-82 it achieved its goals
> admirably.  From 1984 onwards it was clearly becoming insufficient for
> the task and things moved on.
> 
> Most of the commercial Pascal varieties tried to be variants on Modula-2
> but labelled themselves Pascal, and here lie the real problems and the
> hassles that led to Pascal ending up with a bad name -- one it should
> not be landed with in perpituity. 

I think Pascal did a good job of promoting "structured programming", the 
buzzword of the 70's.

"User Friendly" was the buzzword of the 80s.

"Object Oriented" for the 90s.

"Generic" for the 00s.

"Functional" for the teens, I suppose. Too soon to tell.

I'm less forgiving of Pascal than you are. I have the original PUM&R, and yes, 
it was designed as a teaching language. But still, a teaching language shouldn't 
be so awfully crippled and with such huge mistakes (array handling).

Modula-2 failed because by the time it appeared, everyone fed up with Pascal's 
failings had moved to C (and then C++). I remember a Modula-2 vendor telling me 
in the late 80's that they'd screwed up and backed the wrong horse, they should 
have gone with C++.

Modula-2 also screwed up by not calling itself Pascal-2.

I used OMSI Pascal in 1978 or so, I don't think it was related to Modula-2. 
Naturally, it had extensions, too. Pascal is unusable without extensions, even 
for simple programs.

Pascal annoyed me so much, and C was *so* much better, I never gave M2 a serious 
look. Consider this: C today is still a dominant language, and is largely 
unchanged from the early 80's. But Pascal evolved into Modula, Modula 2, Oberon, 
Delphi, Object Pascal, etc., always trying to find a workable combination of 
features. Meanwhile, the world passed it by.
« First   ‹ Prev
1 2
Top | Discussion index | About this forum | D home