[27942] in Perl-Users-Digest
Perl-Users Digest, Issue: 9306 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 16 11:06:13 2006
Date: Fri, 16 Jun 2006 08:05:04 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 16 Jun 2006 Volume: 10 Number: 9306
Today's topics:
Re: Auto flush doesn't work as expected <leifwessman@hotmail.com>
Re: Broken Pipe in Network Programming <tzz@lifelogs.com>
Re: can I trust on key %hash natural order? <ignoramus15879@NOSPAM.15879.invalid>
Flat file missing <ahqmed@hotmail.com>
Re: Perl - MultiUser Webserver Environment Help <tadmc@augustmail.com>
Re: Perl - MultiUser Webserver Environment Help <flavell@physics.gla.ac.uk>
Re: Perl Web Developer Wanted! <tadmc@augustmail.com>
Re: question on processing mysql <tadmc@augustmail.com>
Re: reference to object method <benmorrow@tiscali.co.uk>
Re: reference to object method <christoph.lamprecht.no.spam@web.de>
Re: Testing a new password <zen13097@zen.co.uk>
Re: What is Expressiveness in a Computer Language <no@address.spam>
Re: What is Expressiveness in a Computer Language <hendrik_maryns@despammed.com>
Re: What is Expressiveness in a Computer Language <robert.thorpe@antenova.com>
Re: What is Expressiveness in a Computer Language (=?iso-8859-1?q?Torben_=C6gidius_Mogensen?=)
Re: What is Expressiveness in a Computer Language (=?iso-8859-1?q?Torben_=C6gidius_Mogensen?=)
Re: What is Expressiveness in a Computer Language <rvtol+news@isolution.nl>
Re: What is Expressiveness in a Computer Language <pc@p-cos.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 16 Jun 2006 05:27:36 -0700
From: "Leif Wessman" <leifwessman@hotmail.com>
Subject: Re: Auto flush doesn't work as expected
Message-Id: <1150460856.147387.121120@f6g2000cwb.googlegroups.com>
I've found the problem. I was using a anti-virus software called
Kaspersky. They analyze all HTTP traffic. You can guess what the side
effect was...
Thanks for all help!
lawrence@hummer.not-here.net wrote:
> Worked for me ... how are you testing? (Hint: If your answer doesn't
> include 'telnet to port 80' you're testing it wrong.)
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Lawrence Statton - lawrenabae@abaluon.abaom s/aba/c/g
> Computer software consists of only two components: ones and
> zeros, in roughly equal proportions. All that is required is to
> sort them into the correct order.
------------------------------
Date: Fri, 16 Jun 2006 10:59:07 -0400
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Broken Pipe in Network Programming
Message-Id: <g6964j19mf8.fsf@CN1374059D0130.kendall.corp.akamai.com>
On 15 Jun 2006, janicehwang1325@yahoo.com wrote:
> I tried to program with preforking server and it works well for both
> IO::Socket as well as IO::Socket::SSL. However, due to my supervisor's
> request, he wants me to do it with threads. I did debug the program
> from the very beginning using a simple server and client and it works
> perfectly.
>
> As a result for my debugging yesterday, i found out that if i lock or
> using threads->join for my server program, the second client will wait
> till the first client to finish. That's why i am wondering could it be
> the problem of the database? since when i try to run the first client
> until there is nothing to send to server from that client, then i run
> the second one and it works! I wondering the inserting data into the
> database cause the problem.
OK, does IO::Socket work with threads without SSL?
With threads but without database interaction, do things work? (Try
writing the data to a file instead of the database.)
Keep eliminating variables. The simplest thing that fails is the
easiest thing to debug.
Without seeing your code, we'll keep giving you generic advice like
the above.
Ted
------------------------------
Date: Fri, 16 Jun 2006 15:03:24 GMT
From: Ignoramus15879 <ignoramus15879@NOSPAM.15879.invalid>
Subject: Re: can I trust on key %hash natural order?
Message-Id: <0Lzkg.9791$2c1.2914@fe58.usenetserver.com>
On 16 Jun 2006 01:37:42 -0700, filippo <filippo2991@virgilio.it> wrote:
> John Bokma ha scritto:
>
>> A common mistake I see very often is to extract a lot of data from a
>> database, and have the program do a lot of manipulation that could be done
>> by the database itself, and probably much more efficient.
>
> this is interesting. Actually this was my deliberate coose from the
> possible two:
>
> a)
> - query all data from database
> - cycle on this data
>
> b) query database into the cycle
>
> I choosed A because I though it was best to minimize the database load
> and query overhead.
I am not sure what you mean, but, in my experience, letting the
database compile statistics (counts, averages etc) is better than
selecting everything and doing it in perl. Database servers (my
experience mostly centers around MySQL) are much more efficient in
coming up with good query plans, than I used to think.
i
------------------------------
Date: 16 Jun 2006 07:56:07 -0700
From: "asg" <ahqmed@hotmail.com>
Subject: Flat file missing
Message-Id: <1150469767.836476.187140@h76g2000cwa.googlegroups.com>
i use the code below for a page counter. when it gets to around a 900
count, it resets to 1. any ideas as to why?
my $counterFile = "adcounter/page1";
if (-e $counterFile) {
open(COUNT,"$counterFile");
flock (COUNT, 2);
my $ergsege= <COUNT>;
close(COUNT);
$ergsege++;
open(COUNT,">$counterFile");
print (COUNT "$ergsege");
close(COUNT);
flock (COUNT, 8);
}
else{
my $ergsege= "1";
open(COUNT,">$counterFile");
flock (COUNT, 2);
print COUNT "1";
close(COUNT);
flock (COUNT, 8);
}
------------------------------
Date: Fri, 16 Jun 2006 07:15:15 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Perl - MultiUser Webserver Environment Help
Message-Id: <slrne9586j.6ne.tadmc@magna.augustmail.com>
Michael Vilain <vilain@spamcop.net> wrote:
> In article <slrne94crq.5n3.tadmc@magna.augustmail.com>,
> Tad McClellan <tadmc@augustmail.com> wrote:
>> lunardragoon@gmail.com <lunardragoon@gmail.com> wrote:
>>
>>
>> > My problem is, I need to find a way to make the
>> > Perl interpreter only allow listings of certain files and folders to
>> > come up when a user's script interacts with the files and folders on
>> > the server.
>>
>>
>> Your problem is: you need to find a way to make CGI programs
>> only allow listings of certain files and folders.
>>
>> You do that the same way whether your write your CGI programs
>> in Perl or Python or Visual Basic.
>>
>> ie. You do not have a Perl question here. You have a web
>> server configuration question.
> Well, I'll make it perl question.
You haven't done that yet...
> If you web server is running perl as
> a module (aka mod_perl),
Since the OP said:
I'm not using the mod_perl module
I figure he probably is not using the mod_perl module.
> If you run as a CGI, you can use CGIwrap (google for it) on
> Linux or MacOS to run CGI scripts as the owner of the file. Then it's a
> matter of using the umask and filesystem permissions correctly.
And how would that be different if the CGI program was written
in Python instead of Perl?
We still do not have a Perl question here.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 16 Jun 2006 14:56:17 +0100
From: "Alan J. Flavell" <flavell@physics.gla.ac.uk>
Subject: Re: Perl - MultiUser Webserver Environment Help
Message-Id: <Pine.LNX.4.64.0606161452030.21788@ppepc87.ph.gla.ac.uk>
On Fri, 16 Jun 2006, Tad McClellan wrote:
> And how would that be different if the CGI program was written
> in Python instead of Perl?
>
> We still do not have a Perl question here.
At risk of re-stating what's already obvious to you (but seemingly may
not be to the questioner) - the ability to partition a problem is (as
some think) *the* key to effective problem solving. The ability to
wheedle a one-off solution out of an off-topic newsgroup fades into
insignificance by comparison.
As such, the questioner is encouraged to work on their problem
partitioning skills for a life-long benefit, compared to any
five-minute fix they might get for the immediate question.
hth
--
------------------------------
Date: Fri, 16 Jun 2006 08:27:23 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Perl Web Developer Wanted!
Message-Id: <slrne95cdr.6ne.tadmc@magna.augustmail.com>
Mirco Wahab <peace.is.our.profession@gmx.de> wrote:
> Thus spoke Randal L. Schwartz (on 2006-06-16 04:49):
>
>> ... Do you want to work for an idiot? ...
>
> Isn't this what almost all people do almost every day ;-)
_I_ do not work for an idiot. [1]
[1] Shameless kissing up, since my boss reads this newsgroup. :-) :-)
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 16 Jun 2006 08:25:02 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: question on processing mysql
Message-Id: <slrne95c9d.6ne.tadmc@magna.augustmail.com>
Huub <> wrote:
> $record = 101;
> $sql = "select voorvoeg,naam from hvw where lidnr = $record";
> $sth = $dbh->prepare($sql);
> $sth->execute or die "SQL Error: $DBI::errstr\n";
> @row = $sth->fetchrow_array;
> print "Naam: @row\n";
>
> This works OK. However, when I put the lines "$sql = " and further in a
> (while-)loop
If you are having a problem with code that contains a while loop,
then you should post code that contains a while loop.
We cannot (generally) debug code that we cannot see.
> it doesn't do anything. Is this correct?
That depends on _why_ you put those lines in a loop. (and how
you coded the loop)
If you want to get the 1st result from different queries (ie. you
plan to have multiple values for $record), then putting those lines
in a loop is correct.
If you want to get all of the results from one particular query,
then you would put only the fetchrow_array() and print() parts
in a loop.
> Also I have tried to read all database fields at once, but that didn't
> work either,
How did you try to do it?
We cannot (generally) debug code that we cannot see.
> since "prepare" seems only to accept 1 parameter.
That is fine, since 1 parameter is all you need:
$sql = "select * from hvw where lidnr = $record";
> How can I
> do this effectively/efficiently?
You have not told us what it is that you _want_ to happen, that is,
we do not know what "this" you are asking about.
You should use placeholders (or bind variables) in your queries
so that the DBI can handle proper quoting for you:
$sql = 'select * from hvw where lidnr = ?';
...
$sth->execute($record) or die "SQL Error: $DBI::errstr\n";
> Hints or directions on where to find this info are appreciated.
Read the documentation for the modules that you use:
perldoc DBI
contains this code:
$sth = $dbh->prepare("SELECT foo, bar FROM table WHERE baz=?");
$sth->execute( $baz );
while ( @row = $sth->fetchrow_array ) {
print "@row\n";
}
Which is probably what you meant to ask for.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 16 Jun 2006 00:36:56 +0100
From: Ben Morrow <benmorrow@tiscali.co.uk>
Subject: Re: reference to object method
Message-Id: <oh79m3-ue2.ln1@osiris.mauzo.dyndns.org>
Quoth Ch Lamprecht <christoph.lamprecht.no.spam@web.de>:
> Uri Guttman wrote:
> >>>>>>"CL" == Ch Lamprecht <christoph.lamprecht.no.spam@web.de> writes:
> >
> >
> > CL> Uri Guttman wrote:
> > >>>>>>> "x" == xhoster <xhoster@gmail.com> writes:
> > x> Uri Guttman <uri@stemsystems.com> wrote:
> >
> > >> >> much better to use UNIVERSAL::can:
> >
> > >> >> my $meth = $obj->can( 'method_name' ) ;
> > >> >> >> $meth->( $arg ) ;
> > x> Doesn't that call the method as a regular subroutine, with $arg
> > >> where $self
> > x> should be?
> > x> Wouldn't that need to be: ?
> > x> $obj->$meth($arg);
> > >> my bad. brain wasn't fully engaged. and i have used can like that a
> > >> few
> > >> times so i should know how to call the method! your code is correct
> > >> there.
> >
> > CL> It will still call the method as a regular subroutine...
> > CL> So maybe it should be better written as
> >
> > CL> $meth->( $obj,$arg );
> >
> > no, xhoster's fix of my bug is correct. your way skips inheritance.
> >
> > $obj->$meth($arg);
> >
> so does his:
Err, yes... presumably that's the point of taking a ref to a method?
Xho's fix is correct, your way is ugly :).
Ben
--
#!/bin/sh
quine="echo 'eval \$quine' >> \$0; echo quined"
eval $quine
# [benmorrow@tiscali.co.uk]
------------------------------
Date: Fri, 16 Jun 2006 15:41:06 +0200
From: Ch Lamprecht <christoph.lamprecht.no.spam@web.de>
Subject: Re: reference to object method
Message-Id: <e6ucdf$2bc$1@online.de>
Ben Morrow wrote:
> Quoth Ch Lamprecht <christoph.lamprecht.no.spam@web.de>:
>
>>Uri Guttman wrote:
>>
>>>>>>>>"CL" == Ch Lamprecht <christoph.lamprecht.no.spam@web.de> writes:
>>>
>>>
>>> CL> Uri Guttman wrote:
>>> >>>>>>> "x" == xhoster <xhoster@gmail.com> writes:
>>> x> Uri Guttman <uri@stemsystems.com> wrote:
>>>
>>> >> >> much better to use UNIVERSAL::can:
>>>
>>> >> >> my $meth = $obj->can( 'method_name' ) ;
>>> >> >> >> $meth->( $arg ) ;
>>> x> Doesn't that call the method as a regular subroutine, with $arg
>>> >> where $self
>>> x> should be?
>>> x> Wouldn't that need to be: ?
>>> x> $obj->$meth($arg);
>>> >> my bad. brain wasn't fully engaged. and i have used can like that a
>>> >> few
>>> >> times so i should know how to call the method! your code is correct
>>> >> there.
>>>
>>> CL> It will still call the method as a regular subroutine...
>>> CL> So maybe it should be better written as
>>>
>>> CL> $meth->( $obj,$arg );
>>>
>>>no, xhoster's fix of my bug is correct. your way skips inheritance.
>>>
>>> $obj->$meth($arg);
>>>
>>
>>so does his:
>
>
> Err, yes... presumably that's the point of taking a ref to a method?
>
> Xho's fix is correct, your way is ugly :).
Just in case you are missing my point:
my $meth = $obj->can( 'method_name' ) ;
$meth wil now contain a coderef if 'method_name' was found.
According to perlref it would be called like:
&{$meth}($obj,$arg);
&$meth($obj,$arg);
$meth->($obj,$arg);
If you prefer to call it like so
$obj->$meth($arg);
I consider it to be misleading, because it looks like a method call without
being one. Someone reading that line might think, $meth contained a method-name...
Christoph
--
perl -e "print scalar reverse q/ed.enilno@ergn.l.hc/"
------------------------------
Date: 16 Jun 2006 12:47:25 GMT
From: Dave Weaver <zen13097@zen.co.uk>
Subject: Re: Testing a new password
Message-Id: <4492a85d$0$30711$fa0fcedb@news.zen.co.uk>
On 15 Jun 2006 17:28:48 GMT, Glenn Jackman <glennj@ncf.ca> wrote:
> At 2006-06-15 10:58AM, Mark Drummond <mark@gangwarily.ca> wrote:
> > for (my $i=0; $i < $passlen; $i++) {
> > $rand = int(rand $#chars+1);
> > $pass .= $chars[$rand];
> > }
>
> You could write this more tersely as:
> $pass .= $chars[int rand @chars] for (1..$passlen);
>
Or even more tersely (but, IMO, equally readably) as:
$pass .= $chars[rand @chars] for 1..$passlen;
------------------------------
Date: Fri, 16 Jun 2006 10:10:17 GMT
From: "Sacha" <no@address.spam>
Subject: Re: What is Expressiveness in a Computer Language
Message-Id: <dsvkg.484881$w52.12555370@phobos.telenet-ops.be>
"Joachim Durchholz" <jo@durchholz.org> wrote in message
news:e6tt7j$b41$1@online.de...
> Raffael Cavallaro schrieb:
>> On 2006-06-14 15:04:34 -0400, Joachim Durchholz <jo@durchholz.org> said:
>>
>>> Um... heterogenous lists are not necessarily a sign of expressiveness.
>>> The vast majority of cases can be transformed to homogenous lists
>>> (though these might then contain closures or OO objects).
>>>
>>> As to references to nonexistent functions - heck, I never missed these,
>>> not even in languages without type inference :-)
>>>
>>> [[snipped - doesn't seem to relate to your answer]]
>>
> Give a heterogenous list that would to too awkward to live in a
> statically-typed language.
Many lists are heterogenous, even in statically typed languages.
For instance lisp code are lists, with several kinds of atoms and
sub-lists..
A car dealer will sell cars, trucks and equipment..
In a statically typed language you would need to type the list on a common
ancestor...
What would then be the point of statical typing , as you stilll need to type
check
each element in order to process that list ? Sure you can do this in a
statically-typed
language, you just need to make sure some relevant ancestor exists. In my
experience
you'll end up with the base object-class more often than not, and that's
what i call
dynamic typing.
> Give a case of calling nonexistent functions that's useful.
I might want to test some other parts of my program before writing this
function.
Or maybe will my program compile that function depending on user input.
As long as i get a warning for calling a non-existing function, everything
is fine.
Sacha
------------------------------
Date: Fri, 16 Jun 2006 12:28:54 +0200
From: Hendrik Maryns <hendrik_maryns@despammed.com>
Subject: Re: What is Expressiveness in a Computer Language
Message-Id: <e6u156$3dd$1@newsserv.zdv.uni-tuebingen.de>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
Sacha schreef:
> "Joachim Durchholz" <jo@durchholz.org> wrote in message
> news:e6tt7j$b41$1@online.de...
>> Raffael Cavallaro schrieb:
>>> On 2006-06-14 15:04:34 -0400, Joachim Durchholz <jo@durchholz.org> said:
>>>
>>>> Um... heterogenous lists are not necessarily a sign of expressiveness.
>>>> The vast majority of cases can be transformed to homogenous lists
>>>> (though these might then contain closures or OO objects).
>>>>
>>>> As to references to nonexistent functions - heck, I never missed these,
>>>> not even in languages without type inference :-)
>>>>
>>>> [[snipped - doesn't seem to relate to your answer]]
>> Give a heterogenous list that would to too awkward to live in a
>> statically-typed language.
>
> Many lists are heterogenous, even in statically typed languages.
> For instance lisp code are lists, with several kinds of atoms and
> sub-lists..
> A car dealer will sell cars, trucks and equipment..
> In a statically typed language you would need to type the list on a common
> ancestor...
> What would then be the point of statical typing , as you stilll need to type
> check
> each element in order to process that list ? Sure you can do this in a
> statically-typed
> language, you just need to make sure some relevant ancestor exists. In my
> experience
> you'll end up with the base object-class more often than not, and that's
> what i call
> dynamic typing.
In my experience you won’t. I almost never have a List<Object> (Java),
and when I have one, I start thinking on how I can improve the code to
get rid of it.
H.
- --
Hendrik Maryns
==================
http://aouw.org
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
iD8DBQFEkofme+7xMGD3itQRAo0XAJ9DiG228ZKMLX8JH+u9X+6YGEHwgQCdH/Jn
kC/F/b5rbmUvUzKYIv8agis=
=iuV0
-----END PGP SIGNATURE-----
------------------------------
Date: 16 Jun 2006 03:40:46 -0700
From: "Rob Thorpe" <robert.thorpe@antenova.com>
Subject: Re: What is Expressiveness in a Computer Language
Message-Id: <1150454445.151167.283520@r2g2000cwb.googlegroups.com>
Torben =C6gidius Mogensen wrote:
> Pascal Costanza <pc@p-cos.net> writes:
>
> > Torben =C6gidius Mogensen wrote:
> >
> > > On a similar note, is a statically typed langauge more or less
> > > expressive than a dynamically typed language? Some would say less, as
> > > you can write programs in a dynamically typed language that you can't
> > > compile in a statically typed language (without a lot of encoding),
> > > whereas the converse isn't true.
> >
> > It's important to get the levels right here: A programming language
> > with a rich static type system is more expressive at the type level,
> > but less expressive at the base level (for some useful notion of
> > expressiveness ;).
> >
> > > However, I think this is misleading,
> > > as it ignores the feedback issue: It takes longer for the average
> > > programmer to get the program working in the dynamically typed
> > > language.
> >
> > This doesn't seem to capture what I hear from Haskell programmers who
> > say that it typically takes quite a while to convince the Haskell
> > compiler to accept their programs. (They perceive this to be
> > worthwhile because of some benefits wrt correctness they claim to get
> > in return.)
>
> That's the point: Bugs that in dynamically typed languages would
> require testing to find are found by the compiler in a statically
> typed language. So whil eit may take onger to get a program thatgets
> past the compiler, it takes less time to get a program that works.
In my experience the opposite is true for many programs.
Having to actually know the precise type of every variable while
writing the program is not necessary, it's a detail often not relevant
to the core problem. The language should be able to take care of
itself.
In complex routines it can be useful for the programmer to give types
and for the compiler to issue errors when they are contradicted. But
for most routines it's just an unnecessary chore that the compiler
forces on the programmer.
------------------------------
Date: 16 Jun 2006 13:38:26 +0200
From: torbenm@app-1.diku.dk (=?iso-8859-1?q?Torben_=C6gidius_Mogensen?=)
Subject: Re: What is Expressiveness in a Computer Language
Message-Id: <7zwtbh8h59.fsf@app-1.diku.dk>
Pascal Costanza <pc@p-cos.net> writes:
> Torben Ægidius Mogensen wrote:
> > So while it may take longer to get a program that gets
> > past the compiler, it takes less time to get a program that works.
>
> That's incorrect. See http://haskell.org/papers/NSWC/jfp.ps -
> especially Figure 3.
There are many other differences between these languages than static
vs. dynamic types, and some of these differences are likely to be more
significant. What you need to test is langauges with similar features
and syntax, except one is statically typed and the other dynamically
typed.
And since these languages would be quite similar, you can use the same
test persons: First let one half solve a problem in the statically
typed language and the other half the same problem in the dynamically
typed language, then swap for the next problem. If you let a dozen
persons each solve half a dozen problems, half in the statically typed
language and half in the dynamically typed language (using different
splits for each problem), you might get a useful figure.
Torben
------------------------------
Date: 16 Jun 2006 13:53:10 +0200
From: torbenm@app-1.diku.dk (=?iso-8859-1?q?Torben_=C6gidius_Mogensen?=)
Subject: Re: What is Expressiveness in a Computer Language
Message-Id: <7zslm58ggp.fsf@app-1.diku.dk>
"Rob Thorpe" <robert.thorpe@antenova.com> writes:
> Torben Ægidius Mogensen wrote:
> > That's the point: Bugs that in dynamically typed languages would
> > require testing to find are found by the compiler in a statically
> > typed language. So whil eit may take onger to get a program thatgets
> > past the compiler, it takes less time to get a program that works.
>
> In my experience the opposite is true for many programs.
> Having to actually know the precise type of every variable while
> writing the program is not necessary, it's a detail often not relevant
> to the core problem. The language should be able to take care of
> itself.
>
> In complex routines it can be useful for the programmer to give types
> and for the compiler to issue errors when they are contradicted. But
> for most routines it's just an unnecessary chore that the compiler
> forces on the programmer.
Indeed. So use a language with type inference.
Torben
------------------------------
Date: Fri, 16 Jun 2006 14:16:07 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: What is Expressiveness in a Computer Language
Message-Id: <e6ueor.1bk.1@news.isolution.nl>
Torben Ægidius Mogensen schreef:
> Bugs that in dynamically typed languages would
> require testing to find are found by the compiler in a statically
> typed language. So whil[e ]it may take [l]onger to get a program
that[ ]
> gets past the compiler, it takes less time to get a program that
works.
If it were that simple, I would say: compile time type inference is the
only way to go.
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Fri, 16 Jun 2006 16:48:28 +0200
From: Pascal Costanza <pc@p-cos.net>
Subject: Re: What is Expressiveness in a Computer Language
Message-Id: <4ffulsF1ie6ifU1@individual.net>
Torben Ægidius Mogensen wrote:
> Pascal Costanza <pc@p-cos.net> writes:
>
>> Torben Ægidius Mogensen wrote:
>
>>> So while it may take longer to get a program that gets
>>> past the compiler, it takes less time to get a program that works.
>> That's incorrect. See http://haskell.org/papers/NSWC/jfp.ps -
>> especially Figure 3.
>
> There are many other differences between these languages than static
> vs. dynamic types, and some of these differences are likely to be more
> significant. What you need to test is langauges with similar features
> and syntax, except one is statically typed and the other dynamically
> typed.
>
> And since these languages would be quite similar, you can use the same
> test persons: First let one half solve a problem in the statically
> typed language and the other half the same problem in the dynamically
> typed language, then swap for the next problem. If you let a dozen
> persons each solve half a dozen problems, half in the statically typed
> language and half in the dynamically typed language (using different
> splits for each problem), you might get a useful figure.
...and until then claims about the influence of static type systems on
the speed with which you can implement working programs are purely
guesswork. That's the only point I need to make to show that your
original unqualified statement, namely that it takes less time to get a
program that works, is incorrect.
Pascal
--
3rd European Lisp Workshop
July 3 - Nantes, France - co-located with ECOOP 2006
http://lisp-ecoop06.bknr.net/
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 9306
***************************************