[28000] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 9364 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 23 21:10:16 2006

Date: Fri, 23 Jun 2006 18:10:08 -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, 23 Jun 2006     Volume: 10 Number: 9364

Today's topics:
    Re: What is Expressiveness in a Computer Language <marshall.spight@gmail.com>
    Re: What is Expressiveness in a Computer Language <marshall.spight@gmail.com>
    Re: What is Expressiveness in a Computer Language <marshall.spight@gmail.com>
    Re: What is Expressiveness in a Computer Language <dnew@san.rr.com>
    Re: What is Expressiveness in a Computer Language <duane@franz.com>
    Re: What is Expressiveness in a Computer Language <duane@franz.com>
    Re: What is Expressiveness in a Computer Language <rvtol+news@isolution.nl>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 23 Jun 2006 15:05:47 -0700
From: "Marshall" <marshall.spight@gmail.com>
Subject: Re: What is Expressiveness in a Computer Language
Message-Id: <1151100347.786836.128450@b68g2000cwa.googlegroups.com>

Chris Smith wrote:
> Marshall <marshall.spight@gmail.com> wrote:
> > Java has a static type system.
> > Java has runtime tags and tag checks.
>
> Yes.
>
> > The two are distinct, and neither one is less than complete
>
> How is neither one less than complete?

In the same way that a mule is less than a complete horse.

It is a small point, and probably not worth much attention.
In fact, I was probably just being fussy in the first place.


Marshall



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

Date: 23 Jun 2006 15:08:03 -0700
From: "Marshall" <marshall.spight@gmail.com>
Subject: Re: What is Expressiveness in a Computer Language
Message-Id: <1151100483.057344.310970@g10g2000cwb.googlegroups.com>

Rob Thorpe wrote:
>
> Can I make a type in C that can only have values between 1 and 10?
> How about a variable that can only hold odd numbers, or, to make it
> more difficult, say fibonacci numbers?

Well, of course you can't in *C*; you can barely zip you pants with C.
But I believe you can do the above in C++, can't you?


Marshall



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

Date: 23 Jun 2006 15:12:48 -0700
From: "Marshall" <marshall.spight@gmail.com>
Subject: Re: What is Expressiveness in a Computer Language
Message-Id: <1151100768.063223.120480@m73g2000cwd.googlegroups.com>

Chris Uppal wrote:
> Marshall wrote:
>
> [me:]
> > > But, as a sort of half-way, semi-formal, example: consider the type
> > > environment in a Java runtime.  The JVM does formal type-checking of
> > > classfiles as it loads them.  In most ways that checking is static --
> > > it's treating the bytecode as program text and doing a static analysis
> > > on it before allowing it to run (and rejecting what it can't prove to
> > > be acceptable by its criteria).  However, it isn't /entirely/ static
> > > because the collection of classes varies at runtime in a (potentially)
> > > highly dynamic way.  So it can't really examine the "whole" text of the
> > > program -- indeed there is no such thing.  So it ends up with a hybrid
> > > static/dynamic type system -- it records any assumptions it had to make
> > > in order to find a proof of the acceptability of the new code, and if
> > > (sometime in the future) another class is proposed which violates those
> > > assumptions, then that second class is rejected.
> >
> > I have to object to the term "hybrid".
> >
> > Java has a static type system.
> > Java has runtime tags and tag checks.
>
> It has both, agreed, but that isn't the full story.  I think I explained what I
> meant, and why I feel the term is justified as well as I can in the second half
> of the paragraph you quoted.  I doubt if I can do better.
>
> Maybe you are thinking that I mean that /because/ the JVM does verification,
> etc, at "runtime" the system is hybrid ?
>
> Anyway that is /not/ what I mean.  I'm (for these purposes) completely
> uninterested in the static checking done by the Java to bytecode translator,
> javac.  I'm interested in what happens to the high-level, statically typed, OO,
> language called "java bytecode" when the JVM sees it.  That language has a
> strict static type system which the JVM is required to check.  That's a
> /static/ check in my book -- it happens before the purportedly correct code is
> accepted, rather than while that code is running.
>
> I am also completely uninterested (for these immediate purposes) in the run
> time checking that the JVM does (the stuff that results in
> NoSuchMethodException, and the like).  In the wider context of the thread, I do
> want to call that kind of thing (dynamic) type checking -- but those checks are
> not why I call the JVMs type system hybrid either.
>
> Oh well, having got that far, I may as well take another stab at "hybrid".
> Since the JVM is running a static type system without access to the whole text
> of the program, there are some things that it is expected to check which it
> can't.   So it records preconditions on classes which might subsequently be
> loaded.  Those are added to the static checks on future classes, but -- as far
> as the original class is concerned -- those checks happen dynamically.  So part
> of the static type checking which is supposed to happen, has been postponed to
> a dynamic check.  It's that, and /only/ that which I meant by "hybrid".

That's fair, I guess. I wouldn't use the terms you do, but maybe that
doesn't matter very much assuming we understand each other
at this point.



Marshal



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

Date: Fri, 23 Jun 2006 22:23:19 GMT
From: Darren New <dnew@san.rr.com>
Subject: Re: What is Expressiveness in a Computer Language
Message-Id: <rRZmg.20658$uy3.7348@tornado.socal.rr.com>

Marshall wrote:
> point. My point was, I don't see why you'd be writing code using
> operators that you thought might not be applicable to the operands.

I see. I thought your point was that you might write code for which you 
didn't know the type of arguments. Unless you equate "type" with what 
smalltalk calls "protocol" (i.e., the type is the collection of 
operators applicable to values in the type), these are two different 
statements.

-- 
   Darren New / San Diego, CA, USA (PST)
     Native Americans used every part
     of the buffalo, including the wings.


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

Date: Fri, 23 Jun 2006 15:36:45 -0700
From: Duane Rettig <duane@franz.com>
Subject: Re: What is Expressiveness in a Computer Language
Message-Id: <o0bqsj33eq.fsf@franz.com>

"Marshall" <marshall.spight@gmail.com> writes:

> Pascal Costanza wrote:
>> Marshall wrote:
>> > Pascal Costanza wrote:
>> >> Consider a simple expression like 'a + b': In a dynamically typed
>> >> language, all I need to have in mind is that the program will attempt to
>> >> add two numbers. In a statically typed language, I additionally need to
>> >> know that there must a guarantee that a and b will always hold numbers.
>> >
>> > I still don't really see the difference.
>> >
>> > I would not expect that the dynamic programmer will be
>> > thinking that this code will have two numbers most of the
>> > time but sometimes not, and fail. I would expect that in both
>> > static and dynamic, the thought is that that code is adding
>> > two numbers, with the difference being the static context
>> > gives one a proof that this is so.
>>
>> There is a third option: it may be that at the point where I am writing
>> this code, I simply don't bother yet whether a and b will always be
>> numbers. In case something other than numbers pop up, I can then
>> make a decision how to proceed from there.
>
> Ouch; I have a really hard time understanding this.
>
> I can't see how you'd call + on a and b if you think they might
> not be numbers. If they could be something other than numbers,
> and you're treating them as if they are, is that sort of like
> doing a case analysis and only filling in one of the cases?
> If so, wouldn't you want to record that fact somehow?

But suppose + were polymorphic and someone (dynamically) added a
method on + to handle strings?  If the type error were that a and b
happened to be strings, there would be at least two courses of action
in the development of the program: limit a and b so that they are
never strings at this point, or define a method on + to add correct
functionality for the + operator.  Note that I use the term "correct",
because the correctness of the subprogram (including any added methods
on +) depends both on the correctness of usage within the language,
and also correctness of extensibilities allowed by the language for
the purpose of satisfying goals of the program.  In the many cases
where the eventual goals of the program are not known at the beginning
of the design, this extensibility is a good thing to have.

Note that the above paragraph explicitly leaves out Common Lisp,
because + is not extensible in CL.  CL does, however, allow for methods
to be defined on functions not already defined by the standard, so
the argument could still apply to some generic function named my-+,
or even on my-package::+ where the CL defined + operator is shadowed.

-- 
Duane Rettig    duane@franz.com    Franz Inc.  http://www.franz.com/
555 12th St., Suite 1450               http://www.555citycenter.com/
Oakland, Ca. 94607        Phone: (510) 452-2000; Fax: (510) 452-0182   


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

Date: Fri, 23 Jun 2006 15:39:46 -0700
From: Duane Rettig <duane@franz.com>
Subject: Re: What is Expressiveness in a Computer Language
Message-Id: <o07j37339p.fsf@franz.com>

Darren New <dnew@san.rr.com> writes:

> Marshall wrote:
>> I can't see how you'd call + on a and b if you think they might
>> not be numbers.
>
> Now substitute "<" for "+" and see if you can make the same argument. :-)

Sure.  Properly extended to handle strings, "abc" < "def" might return
true.

-- 
Duane Rettig    duane@franz.com    Franz Inc.  http://www.franz.com/
555 12th St., Suite 1450               http://www.555citycenter.com/
Oakland, Ca. 94607        Phone: (510) 452-2000; Fax: (510) 452-0182   


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

Date: Sat, 24 Jun 2006 02:58:02 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: What is Expressiveness in a Computer Language
Message-Id: <e7i9q9.184.1@news.isolution.nl>

Marshall schreef:
> Rob Thorpe:

>> Can I make a type in C that can only have values between 1 and 10?
>> How about a variable that can only hold odd numbers, or, to make it
>> more difficult, say fibonacci numbers?
>
> Well, of course you can't in *C*; you can barely zip you pants with C.
> But I believe you can do the above in C++, can't you?

You can write self-modifying code in C, so I don't see how you can not
do that in C.
;)

-- 
Affijn, Ruud

"Gewoon is een tijger."




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

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


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