[27968] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 9332 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 21 11:05:40 2006

Date: Wed, 21 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           Wed, 21 Jun 2006     Volume: 10 Number: 9332

Today's topics:
    Re: Binding array to pattern (Seymour J.)
    Re: Binding array to pattern (Seymour J.)
    Re: Help - Inline::C arrayref deref? <sisyphus1@nomail.afraid.org>
    Re: Help - Inline::C arrayref deref? xhoster@gmail.com
    Re: Reading the first .jpg file from a .rar archive? <David.Squire@no.spam.from.here.au>
    Re: Reading the first .jpg file from a .rar archive? <ksheka@gmail.com>
        save image from url to file - how to? <Oliver-Bleckmann@freenet.de>
    Re: save image from url to file - how to? <Oliver-Bleckmann@freenet.de>
    Re: save image from url to file - how to? <noreply@gunnar.cc>
    Re: What is Expressiveness in a Computer Language <find@my.address.elsewhere>
    Re: What is Expressiveness in a Computer Language <find@my.address.elsewhere>
    Re: What is Expressiveness in a Computer Language <jo@durchholz.org>
    Re: What is Expressiveness in a Computer Language <jo@durchholz.org>
    Re: What is Expressiveness in a Computer Language <robert.thorpe@antenova.com>
    Re: What is Expressiveness in a Computer Language <jo@durchholz.org>
    Re: What is Expressiveness in a Computer Language <marshall.spight@gmail.com>
    Re: What is Expressiveness in a Computer Language <marshall.spight@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Wed, 21 Jun 2006 10:00:31 -0300
From: "Shmuel (Seymour J.) Metz" <spamtrap@library.lspace.org.invalid>
Subject: Re: Binding array to pattern
Message-Id: <449950ff$3$fuzhry+tra$mr2ice@news.patriot.net>

In <slrne96asq.7n8.tadmc@magna.augustmail.com>, on 06/16/2006
   at 05:07 PM, Tad McClellan <tadmc@augustmail.com> said:

>Using grep() in this situation *simplifies* the logic (and avoids the
>potential bug).

Actually, both my code and yours have the same bug, pointed out by Mr.
Morrow.

-- 
Shmuel (Seymour J.) Metz, SysProg and JOAT  <http://patriot.net/~shmuel>

Unsolicited bulk E-mail subject to legal action.  I reserve the
right to publicly post or ridicule any abusive E-mail.  Reply to
domain Patriot dot net user shmuel+news to contact me.  Do not
reply to spamtrap@library.lspace.org



------------------------------

Date: Wed, 21 Jun 2006 09:56:40 -0300
From: "Shmuel (Seymour J.) Metz" <spamtrap@library.lspace.org.invalid>
Subject: Re: Binding array to pattern
Message-Id: <44995018$2$fuzhry+tra$mr2ice@news.patriot.net>

In <x7ac8cud7a.fsf@mail.sysarch.com>, on 06/16/2006
   at 03:12 PM, Uri Guttman <uri@stemsystems.com> said:

>again, you are somewhat unclear. 'put them in a message' means what?

A line or lines of text intended to be read by a human being.

>'all of the email' means what?

Dropped word; I meant all of the e-mail addresses.

>i smell an XY problem here. it is always best to explain the
>original problem

Well, in this case the original problem would have only confused the
issue, since most of the code has nothing to do with the original
point of failure. In debugging I always try to generate a small test
case.

>what is the format of the whois records?

Ad hoc. There are multiple conventions, and some seem to not follow
any conventions. The specific case that I'm trying to handle is where
there is a line of the form

   role: e-mail-address

Since there is no standard for recognizing abuse contacts, I'm
applying the heuristic to treat it as abuse if the string "abuse"
appears either in the role name or in the address.

If you want I can send you the entire program, but it is very much a
work in progress and will ultimately need significant cleanup.

-- 
Shmuel (Seymour J.) Metz, SysProg and JOAT  <http://patriot.net/~shmuel>

Unsolicited bulk E-mail subject to legal action.  I reserve the
right to publicly post or ridicule any abusive E-mail.  Reply to
domain Patriot dot net user shmuel+news to contact me.  Do not
reply to spamtrap@library.lspace.org



------------------------------

Date: Wed, 21 Jun 2006 23:16:29 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: Help - Inline::C arrayref deref?
Message-Id: <44994787$0$27623$afc38c87@news.optusnet.com.au>


"Lee" <leegee@gmail.com> wrote in message
news:1150880353.051288.269910@c74g2000cwc.googlegroups.com...
>
> xhoster@gmail.com wrote:
> > "Sisyphus" <sisyphus1@nomail.afraid.org> wrote:
> > > Also, I was puzzled by the SvREFCNT_inc() call in the original code.
> >
> > You are right, that also shouldn't be there.  I had cleaned it up but
> > forgot to mention doing so.  That one is particularly pernicious,
because
> > it causes the leak to occur in the regular Perl code.
>
> Could you please explain? I'm confused because my XS and perlguts is
> minimal. If I replace this:
>
> AV* av_pcm = newAV();
> if (SvROK(rpcm) && (SvTYPE(SvRV(rpcm)) == SVt_PVAV))
>     av_pcm = (AV*)SvREFCNT_inc(SvRV(rpcm));
>
> with this:
>
>     AV* av_pcm = newAV();
>     av_pcm = (AV*)(SvRV(rpcm));
>
> I get told, "Attempt to free unreferenced scalar: SV 0xb79d7540"
>
> Lee
>
It seems to depend upon the placement of the sv_2mortal call. In the below
script, the foo2 function will try to "free unreferenced scalar", but with
foo1 there's no such problem (and neither foo1 nor foo2 leak memory afaict):

-- av.pl --
use warnings;
use Inline C => Config => BUILD_NOISY => 1;

use Inline C => <<'EOC';

AV * foo1(SV * x) {
     AV * av_ret = newAV();
     sv_2mortal(av_ret);
     av_ret = (AV*)SvRV(x);
     return av_ret;
}


AV * foo2(SV * x) {
     AV * av_ret = newAV();
     av_ret = (AV*)SvRV(x);
     sv_2mortal(av_ret);
     return av_ret;
}

AV * foo3(SV * x) {
     AV * av_ret = newAV();
     av_ret = (AV*)SvRV(x);
     return av_ret;
}

EOC

@z = (1 .. 10);

print "Running 10 iterations of foo1\n";
for(1..10) {$x1 = foo1(\@z)}

print "Running 10 iterations of foo2\n";
for(1..10) {$x2 = foo2(\@z)}

print "Running 10 iterations of foo3\n";
for(1..10) {$x3 = foo3(\@z)}
__END__

I really don't know whether it's correct to be providing an AV* as the
argument to sv_2mortal(). There's no denying that it fixes the memory leak
problem, but it also produces the following warnings during the compilation
phase:

av_pl_4246.xs: In function `foo1':
av_pl_4246.xs:8: warning: passing arg 2 of `Perl_sv_2mortal' from
incompatible pointer type
av_pl_4246.xs: In function `foo2':
av_pl_4246.xs:17: warning: passing arg 2 of `Perl_sv_2mortal' from
incompatiblepointer type

The foo3 function leaks memory, but at least demonstrates (I hope) that the
refcount increase is not necessary.

Someone else may be able to provide more definitive advice - but, hopefully,
there's something here that helps.

Btw, the output of the above script (for me) is:

Name "main::x1" used only once: possible typo at av.pl line 32.
Name "main::x3" used only once: possible typo at av.pl line 38.
Name "main::x2" used only once: possible typo at av.pl line 35.
Running 10 iterations of foo1
Running 10 iterations of foo2
Attempt to free unreferenced scalar: SV 0x3f5d78, Perl interpreter: 0x3f416c
at av.pl line 35.
Attempt to free unreferenced scalar: SV 0x3f5d78, Perl interpreter: 0x3f416c
at av.pl line 35.
Attempt to free unreferenced scalar: SV 0x3f5d78, Perl interpreter: 0x3f416c
at av.pl line 35.
Attempt to free unreferenced scalar: SV 0x3f5d78, Perl interpreter: 0x3f416c
at av.pl line 35.
Attempt to free unreferenced scalar: SV 0x3f5d78, Perl interpreter: 0x3f416c
at av.pl line 35.
Attempt to free unreferenced scalar: SV 0x3f5d78, Perl interpreter: 0x3f416c
at av.pl line 35.
Attempt to free unreferenced scalar: SV 0x3f5d78, Perl interpreter: 0x3f416c
at av.pl line 35.
Attempt to free unreferenced scalar: SV 0x3f5d78, Perl interpreter: 0x3f416c
at av.pl line 35.
Attempt to free unreferenced scalar: SV 0x3f5d78, Perl interpreter: 0x3f416c
at av.pl line 35.
Attempt to free unreferenced scalar: SV 0x3f5d78, Perl interpreter: 0x3f416c
at av.pl line 35.
Running 10 iterations of foo3

Cheers,
Rob




------------------------------

Date: 21 Jun 2006 14:53:58 GMT
From: xhoster@gmail.com
Subject: Re: Help - Inline::C arrayref deref?
Message-Id: <20060621105448.265$Fg@newsreader.com>

"Lee" <leegee@gmail.com> wrote:
> xhoster@gmail.com wrote:
> > "Sisyphus" <sisyphus1@nomail.afraid.org> wrote:
> > > Also, I was puzzled by the SvREFCNT_inc() call in the original code.
> >
> > You are right, that also shouldn't be there.  I had cleaned it up but
> > forgot to mention doing so.  That one is particularly pernicious,
> > because it causes the leak to occur in the regular Perl code.
>
> Could you please explain? I'm confused because my XS and perlguts is
> minimal. If I replace this:
>
> AV* av_pcm = newAV();
> if (SvROK(rpcm) && (SvTYPE(SvRV(rpcm)) == SVt_PVAV))
>     av_pcm = (AV*)SvREFCNT_inc(SvRV(rpcm));
>
> with this:
>
>     AV* av_pcm = newAV();
>     av_pcm = (AV*)(SvRV(rpcm));
>
> I get told, "Attempt to free unreferenced scalar: SV 0xb79d7540"

I don't get that if I make that change on the code you originally posted in
the first post of this thread.  Are you sure you don't make some other
change too? Can you show the complete code for the new C sub?


Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


------------------------------

Date: Wed, 21 Jun 2006 14:34:02 +0100
From: David Squire <David.Squire@no.spam.from.here.au>
Subject: Re: Reading the first .jpg file from a .rar archive?
Message-Id: <e7bhsa$18p$1@news.ox.ac.uk>

K P S wrote:
> Can someone please point me to a small script to read the first .jpg
> file from a .rar archive?  I would like to create thumbnails of an
> archive based on the first image file in the archive.
> 
> Also, are there perl routines for image manipulation?  ie: scaleing an
> image and converting from .jpg to .png?
> 
> I'm obviously someone totally new to perl, so any help would be
> appreciated

Then you need to know about CPAN. Go to http://search.cpan.org/ and 
search for rar. At CPAN, you will find modules to help you with this and 
many other tasks.

DS


------------------------------

Date: 21 Jun 2006 06:49:32 -0700
From: "K P S" <ksheka@gmail.com>
Subject: Re: Reading the first .jpg file from a .rar archive?
Message-Id: <1150897772.614221.259030@y41g2000cwy.googlegroups.com>

David Squire wrote:
> K P S wrote:
> > Can someone please point me to a small script to read the first .jpg
> > file from a .rar archive?  I would like to create thumbnails of an
> > archive based on the first image file in the archive.
> >
> > Also, are there perl routines for image manipulation?  ie: scaleing an
> > image and converting from .jpg to .png?
> >
> > I'm obviously someone totally new to perl, so any help would be
> > appreciated
>
> Then you need to know about CPAN. Go to http://search.cpan.org/ and
> search for rar. At CPAN, you will find modules to help you with this and
> many other tasks.
> 
> DS

Thanks.  I'll give it a whirl.



------------------------------

Date: Wed, 21 Jun 2006 15:49:18 +0200
From: "Oliver Bleckmann" <Oliver-Bleckmann@freenet.de>
Subject: save image from url to file - how to?
Message-Id: <e7biqu$gmq$1@newsserver.rz.tu-ilmenau.de>

Hi,

ich versuche einige png-Grafiken automatisch mit get ein eine Datei zu 
schreiben,

quasi als open-get-print-close, das will aber nicht, die Dateien sind 
leer...

Wo liegt der Fehler? Ist get hier ungeeignet, gibt es einen speziellen 
Dateityp oder

Variablentyp, der hier verwendet werden muß oder liegt es am print?

Danke. 




------------------------------

Date: Wed, 21 Jun 2006 15:59:55 +0200
From: "Oliver Bleckmann" <Oliver-Bleckmann@freenet.de>
Subject: Re: save image from url to file - how to?
Message-Id: <e7bjf1$h2f$1@newsserver.rz.tu-ilmenau.de>


"Oliver Bleckmann" <Oliver-Bleckmann@freenet.de> schrieb im Newsbeitrag 
news:e7biqu$gmq$1@newsserver.rz.tu-ilmenau.de...
> Hi,
>
> ich versuche einige png-Grafiken automatisch mit get ein eine Datei zu 
> schreiben,
>
> quasi als open-get-print-close, das will aber nicht, die Dateien sind 
> leer...
>
> Wo liegt der Fehler? Ist get hier ungeeignet, gibt es einen speziellen 
> Dateityp oder
>
> Variablentyp, der hier verwendet werden muß oder liegt es am print?
>
> Danke.

habs binmode fehlte 




------------------------------

Date: Wed, 21 Jun 2006 16:23:26 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: save image from url to file - how to?
Message-Id: <4ft36rF1kgtgbU1@individual.net>

Oliver Bleckmann wrote:
> ich versuche einige png-Grafiken automatisch mit get ein eine Datei zu 
> schreiben,
> 
> quasi als open-get-print-close, das will aber nicht, die Dateien sind 
> leer...
> 
> Wo liegt der Fehler?

Prata så man begriper, människa! Eller använd en lämpligare grupp: 
de.comp.lang.perl.misc

Oavsett vilket, tror jag du ökar chansen att få hjälp om du studerar och 
följer dessa riktlinjer för hur man formulerar en fråga: 
http://groups.google.com/group/comp.lang.perl.misc/msg/b1b69d3cbfeaa440

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: Wed, 21 Jun 2006 08:39:57 -0500
From: Matthias Blume <find@my.address.elsewhere>
Subject: Re: What is Expressiveness in a Computer Language
Message-Id: <m2u06ehbki.fsf@hanabi.local>

"Rob Thorpe" <robert.thorpe@antenova.com> writes:

> Matthias Blume wrote:
>> "Rob Thorpe" <robert.thorpe@antenova.com> writes:
>>
>> > I think we're discussing this at cross-purposes.  In a language like C
>> > or another statically typed language there is no information passed
>> > with values indicating their type.
>>
>> You seem to be confusing "does not have a type" with "no type
>> information is passed at runtime".
>>
>> > Have a look in a C compiler if you don't believe me.
>>
>> Believe me, I have.
>
> In a C compiler the compiler has no idea what the values are in the
> program.

It is no different from any other compiler, really.  If the compiler
sees the literal 1 in a context that demands type int, then it knows
perfectly well what value that is.

> It knows only their type in that it knows the type of the variable they
> are contained within.
> Would you agree with that?
>
>> > No it doesn't. Casting reinterprets a value of one type as a value of
>> > another type.
>> > There is a difference.  If I cast an unsigned integer 2000000000 to a
>> > signed integer in C on the machine I'm using then the result I will get
>> > will not make any sense.
>>
>> Which result are you getting?  What does it mean to "make sense"?
>
> Well the right one actually, bad example.
>
> But, if I cast an unsigned int 2500000000 to signed I get -1794967296.

So, why do you think this "does not make sense"?  And, as this example
illustrates, casting in C maps values to values.  Depending on the
types of the source and the target, a cast might change the underlying
representation, or it might leave it the same.  But it does produce a
value, and the result value is usually not the same as the argument
value, even if the representation is the same.

Matthias


------------------------------

Date: Wed, 21 Jun 2006 08:45:22 -0500
From: Matthias Blume <find@my.address.elsewhere>
Subject: Re: What is Expressiveness in a Computer Language
Message-Id: <m2psh2hbbh.fsf@hanabi.local>

Joachim Durchholz <jo@durchholz.org> writes:

> Matthias Blume schrieb:
>> Joachim Durchholz <jo@durchholz.org> writes:
>> 
>>> Matthias Blume schrieb:
>>>> Perhaps better: A language is statically typed if its definition
>>>> includes (or ever better: is based on) a static type system, i.e., a
>>>> static semantics with typing judgments derivable by typing rules.
>>>> Usually typing judgmets associate program phrases ("expressions") with
>>>> types given a typing environment.
>>> This is defining a single term ("statically typed") using three
>>> undefined terms ("typing judgements", "typing rules", "typing
>>> environment").
>> This was not meant to be a rigorous definition.
>
> Rigorous or not, introducing additional undefined terms doesn't help
> with explaining a term.

I think you missed my point.  My point was that a language is
statically typed IF IT IS DEFINED THAT WAY, i.e., if it has a static
type system that is PART OF THE LANGUAGE DEFINITION.  The details are
up to each individual definition.

>> Also, I'm not going to repeat the textbook definitions for those
>> three standard terms here.
>
> These terms certainly aren't standard for Perl, Python, Java, or Lisp,

Indeed.  That's because these languages are not statically typed.


------------------------------

Date: Wed, 21 Jun 2006 16:15:45 +0200
From: Joachim Durchholz <jo@durchholz.org>
Subject: Re: What is Expressiveness in a Computer Language
Message-Id: <e7bka4$7no$1@online.de>

Chris Uppal schrieb:
> Chris Smith wrote:
>> I think Marshall got this one right.  The two are accomplishing
>> different things.  In one case (the dynamic case) I am safeguarding
>> against negative consequences of the program behaving in certain non-
>> sensical ways.  In the other (the static case) I am proving theorems
>> about the impossibility of this non-sensical behavior ever happening.
> 
> And so conflating the two notions of type (-checking) as a kind of category
> error ?  If so then I see what you mean, and it's a useful distinction, but am
> unconvinced that it's /so/ helpful a perspective that I would want to exclude
> other perspectives which /do/ see the two as more-or-less trivial variants on
> the same underlying idea.

It is indeed helpful.
Just think of all the unit tests that you don't have to write.

Regards,
Jo


------------------------------

Date: Wed, 21 Jun 2006 16:17:14 +0200
From: Joachim Durchholz <jo@durchholz.org>
Subject: Re: What is Expressiveness in a Computer Language
Message-Id: <e7bkcs$7no$2@online.de>

Matthias Blume schrieb:
> Joachim Durchholz <jo@durchholz.org> writes:
> 
>> Matthias Blume schrieb:
>>> Joachim Durchholz <jo@durchholz.org> writes:
>>>
>>>> Matthias Blume schrieb:
>>>>> Perhaps better: A language is statically typed if its definition
>>>>> includes (or ever better: is based on) a static type system, i.e., a
>>>>> static semantics with typing judgments derivable by typing rules.
>>>>> Usually typing judgmets associate program phrases ("expressions") with
>>>>> types given a typing environment.
>>>> This is defining a single term ("statically typed") using three
>>>> undefined terms ("typing judgements", "typing rules", "typing
>>>> environment").
>>> This was not meant to be a rigorous definition.
>> Rigorous or not, introducing additional undefined terms doesn't help
>> with explaining a term.
> 
> I think you missed my point.  My point was that a language is
> statically typed IF IT IS DEFINED THAT WAY, i.e., if it has a static
> type system that is PART OF THE LANGUAGE DEFINITION.  The details are
> up to each individual definition.

Well, that certainly makes more sense to me.

Regards,
Jo


------------------------------

Date: 21 Jun 2006 07:17:09 -0700
From: "Rob Thorpe" <robert.thorpe@antenova.com>
Subject: Re: What is Expressiveness in a Computer Language
Message-Id: <1150899429.801658.16120@r2g2000cwb.googlegroups.com>

Matthias Blume wrote:
> "Rob Thorpe" <robert.thorpe@antenova.com> writes:
> > Matthias Blume wrote:
> >> "Rob Thorpe" <robert.thorpe@antenova.com> writes:
> >>
> >> > I think we're discussing this at cross-purposes.  In a language like C
> >> > or another statically typed language there is no information passed
> >> > with values indicating their type.
> >>
> >> You seem to be confusing "does not have a type" with "no type
> >> information is passed at runtime".
> >>
> >> > Have a look in a C compiler if you don't believe me.
> >>
> >> Believe me, I have.
> >
> > In a C compiler the compiler has no idea what the values are in the
> > program.
>
> It is no different from any other compiler, really.  If the compiler
> sees the literal 1 in a context that demands type int, then it knows
> perfectly well what value that is.

Well, with a literal yes.  But with the value of some variable x at
runtime it only know the type because it knows the type of the
variable.  Similarly the type of values generated by an expression are
only known because the type the expression generates is known.

> > It knows only their type in that it knows the type of the variable they
> > are contained within.
> > Would you agree with that?

Would you?

> >> > No it doesn't. Casting reinterprets a value of one type as a value of
> >> > another type.
> >> > There is a difference.  If I cast an unsigned integer 2000000000 to a
> >> > signed integer in C on the machine I'm using then the result I will get
> >> > will not make any sense.
> >>
> >> Which result are you getting?  What does it mean to "make sense"?
> >
> > Well the right one actually, bad example.
> >
> > But, if I cast an unsigned int 2500000000 to signed I get -1794967296.
>
> So, why do you think this "does not make sense"?

Well, it makes sense in terms of the C spec certainly.
It does not make sense in that it does not emit an error.

>And, as this example
> illustrates, casting in C maps values to values.  Depending on the
> types of the source and the target, a cast might change the underlying
> representation, or it might leave it the same.  But it does produce a
> value, and the result value is usually not the same as the argument
> value, even if the representation is the same.

Yes. I'm not arguing with that.



------------------------------

Date: Wed, 21 Jun 2006 16:32:47 +0200
From: Joachim Durchholz <jo@durchholz.org>
Subject: Re: What is Expressiveness in a Computer Language
Message-Id: <e7bla2$9h1$1@online.de>

Pascal Costanza schrieb:
> Static type systems potentially change the semantics of a 
> language in ways that cannot be captured by dynamically typed languages 
> anymore, and vice versa.

Very true.

I also suspect that's also why adding type inference to a 
dynamically-typed language doesn't give you all the benefits of static 
typing: the added-on type system is (usually) too weak to express really 
interesting guarantees, usually because the language's semantics isn't 
tailored towards making the inference steps easy enough.

Conversely, I suspect that adding dynamic typing to statically-typed 
languages tends to miss the most interesting applications, mostly 
because all the features that can "simply be done" in a 
dynamically-typed language have to be retrofitted to the 
statically-typed language on a case-by-case basis.

In both cases, the language designers often don't know the facilities of 
the opposed camp well enough to really assess the trade-offs they are doing.

> There is, of course, room for research on performing static type checks 
> in a running system, for example immediately after or before a software 
> update is applied, or maybe even on separate type checking on software 
> increments such that guarantees for their composition can be derived. 
> However, I am not aware of a lot of work in that area, maybe because the 
> static typing community is too focused on compile-time issues.

I think it's mostly because it's intimidating.

The core semantics of an ideal language fits on a single sheet of paper, 
to facilitate proofs of language properties. Type checking 
dynamically-loaded code probably wouldn't fit on that sheet of paper.
(The non-core semantics is then usually a set of transformation rules 
that map the constructs that the programmer sees to constructs of the 
core language.)

Regards,
Jo


------------------------------

Date: 21 Jun 2006 08:00:19 -0700
From: "Marshall" <marshall.spight@gmail.com>
Subject: Re: What is Expressiveness in a Computer Language
Message-Id: <1150902019.850531.204740@g10g2000cwb.googlegroups.com>

Chris Smith wrote:
>
>  When I used the word "type" above, I was adopting the
> working definition of a type from the dynamic sense.  That is, I'm
> considering whether statically typed languages may be considered to also
> have dynamic types, and it's pretty clear to me that they do.

I suppose this statement has to be evaluated on the basis of a
definition of "dynamic types." I don't have a firm definition for
that term, but my working model is runtime type tags. In which
case, I would say that among statically typed languages,
Java does have dynamic types, but C does not. C++ is
somewhere in the middle.


Marshall



------------------------------

Date: 21 Jun 2006 08:04:35 -0700
From: "Marshall" <marshall.spight@gmail.com>
Subject: Re: What is Expressiveness in a Computer Language
Message-Id: <1150902275.129780.50260@p79g2000cwp.googlegroups.com>

Joachim Durchholz wrote:
>
> Hmm... I think this distinction doesn't cover all cases.
>
> Assume a language that
> a) defines that a program is "type-correct" iff HM inference establishes
> that there are no type errors
> b) compiles a type-incorrect program anyway, with an establishes
> rigorous semantics for such programs (e.g. by throwing exceptions as
> appropriate).
> The compiler might actually refuse to compile type-incorrect programs,
> depending on compiler flags and/or declarations in the code.
>
> Typed ("strongly typed") it is, but is it statically typed or
> dynamically typed?

I think what this highlights is the fact that our existing terminology
is not up to the task of representing all the possible design
choices we could make. Some parts of dynamic vs. static
a mutually exclusive; some parts are orthogonal. Maybe
we have reached the point where trying to cram everything
in two one of two possible ways of doing things isn't going
to cut it any more.

Could it be that the US two-party system has influenced our
thinking?</joke>


Marshall



------------------------------

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 9332
***************************************


home help back first fref pref prev next nref lref last post