Novel Thoughts on Scripting and Languages

James Huang judoscript at hotmail.com
Sat Jan 11 02:40:33 EST 2003


Andrew Dalke <adalke at mindspring.com> wrote in message news:<avn0pk$cmq$1 at slb9.atl.mindspring.net>...
> James Huang:
> > Without static typing, what good does strongly-typedness do?
> 
> Because it's the objects that are typed.  Python variables are
> all references to objects, so their type is (philosohpically)
> "pointer to objects."
> 
> x = 200
> 
> creates an object of type 'int' and makes 'x' reference it.
> 
> y = "Hello"
> 
> creates an object of type 'str' and makes 'y' reference it.
> 
> x + y
> 
> gives an error because you can't do that with ints and strings.
> 

Of course, it's the same as in JudoScript...

> > If you can change the class on the fly, does this break the
> > strong-typedness? It's sort like (void*). JudoScript does the same
> > thing, because an object, after all, is a map with a list of
> > associated methods/functions; unless, of course, it is a Java object
> > or ActiveX.
> 
> Since you can cast in Java, doesn't that break strong-typing?

No, the cast-to type is a subclass. The variable assigned accepts that
class instance. Unless, of course, that class is java.lang.Object.
> 
> The old object is strongly typed.  The new object is strongly
> typed.  I've just changed the object type dynamically, that's all.
> 
> 
> > Python seems to have quite a few dangerous features that lack in Java
> > but do exist in C++. Java was born so many years after C++ and Python,
> > so there must be some reasons, I am afraid. Otherwise, with good
> > discipline, C++ can be just as good (except for garbage collection).
> 
> Man, you've bought the party line hook, line, and sinker.  (Umm,
> idiomatic expression meaning that I've heard that before from others,
> that it seems to come from Sun, and that I don't agree with it, nor
> that I believe you've thought it through enough to judge it.)
> 
> Java doesn't have:
>    Multiple inheritance
>    User-defined definitions for how instances interact with operators
>    Generics
> 
> The reason given for the first two is that "they are dangerous features
> and shouldn't be used."  But MI has its uses, as does redefining how
> operators work.  (I find the latter especially useful.)  And generics
> in Python and C++ are very powerful.  Last I heard, they will be
> added to Java "someday."  (Didn't bother to check if they exist
> already.)
> 
> Oh, and Java does have that weird "we have integers and Integers".
> (I've heard the expression 'boxed' vs. 'unboxed.')
> 
> Have you ever considered that the people who developed Java didn't
> develop a better language than those which existed before?
> 
> 
> 
> > It's the statical typing that make strong-typedness a big help for
> > boosting software quality -- the compiler! And that's what makes me
> > wonder people implement big software without the help of compilers.
> 
> The Python party line (which I agree with) is that there are plenty
> of other errors which can arise in programming.  Type checking is
> one way to find those errors, but a good regression suite -- which
> you need in any case -- catches nearly all the errors that type
> checking would have caught, and catch more.  The downside of static
> typing is that you have to enter in all those types, so the code is
> more verbose and harder to read, understand, and maintain.
> 
> > To me, Python and Java are similar because they both support class and
> > inheritance, and garbage collection. I wouldn't say C++ and Python are
> > similar. Of course, variable declaration or not, blah blah ...
> 
> Hmm... OCaml supports classes
> 
> http://caml.inria.fr/ocaml/htmlman/manual005.html#ss:classes-and-objects
> 
> and inheritance
> 
> http://caml.inria.fr/ocaml/htmlman/manual005.html#ss:inheritance
> 
> but it's a functional language.  I think again (as others have asserted)

I don't even know why I got into discussions about Java vs Python vs
C++ ... I generally avoid this kind of discussions, because they are
similar to me (ok, whatever it means). I mentioned that elsewhere in
this thread more than once. "Minor" differences of languages don't
interest me. If I want to compare languages, I'd rather compare Python
to Prolog, or Jython to JudoScript, because they *are* different.
JudoScript is born because it is different than Jython (certainly not
the syntax, and some people finally get it.)

> that your exprience in programming languages needs some broadening.
> 
> 
> 					Andrew
> 					dalke at dalkescientific.com

Java land is where I stand, and I lack passion for "similar"
languages, such as Rhino, BeanShell, Jython, JRuby, Jacl, J??? (for
Java). No difference to me. (I was trying to read an article comparing
some of these; I couldn't finish it.)

If I have time, I'd like to get into VHDL, or Francais, Japanese,
Espanol, Deutsche, Rus, Hebrew and Arabic, roughly in that order. That
would be real cool, wouldn't it?

Nice talking to you. It is fascinating to talk to you and this group
of knowledgeable and dedicated programmers, and wish you and all
others a good year of 2003!

Thank you,
-James




More information about the Python-list mailing list