Strong type checking... 
Author Message
 Strong type checking...

        My company will be beginning a new project shortly and we are
still considering both languages and operating systems.  The languages
that are effectively in the running are: C++, Smalltalk, and Eiffel.
Because this is going to be a large (250,000 - 1,000,000 C equivelent line)
project involving about 12 to 20 programmers, strong type checking is
kinda important.  So ... can anyone tell me if there is a way to:
        a) Add strong type checking to Smalltalk (this method only
           takes numbers, for example, and then have all the source code
           scanned to insure that this is the case).
        b) Provide statistics that show that the advantages of *not*
           needing to do your own garbage collection (free/malloc, new/delete)
           outweigh the lack of type checking from the standpoint of building
           robust applications.

Essentially we are looking for a way to increase the robustness of Smalltalk
without losing the rapid response during development and the powerful
development environment.

                        In advance, thanks,

                                        -Mark Roulo



Mon, 25 Aug 1997 05:12:41 GMT  
 Strong type checking...
|>   My company will be beginning a new project shortly and we are
|> still considering both languages and operating systems.  The languages
|> that are effectively in the running are: C++, Smalltalk, and Eiffel.
|> Because this is going to be a large (250,000 - 1,000,000 C equivelent line)
|> project involving about 12 to 20 programmers, strong type checking is
|> kinda important.  So ... can anyone tell me if there is a way to:
|>   a) Add strong type checking to Smalltalk (this method only
|>      takes numbers, for example, and then have all the source code
|>      scanned to insure that this is the case).

ParcPlace VisualWorks has a ClassReporter that reads the class comment and then scans
the methods for compliance with specified "type".
The comment needs to look like:

Instance Variables:
edit                         <Boolean>               Do we edit an entity or creating a e
showEmpty              <ValueHolder on: Boolean>                       show (true)-

Class Variables:
......

The ClassReporter will test whether you use the defined object types and tell you when you
assign other objects. It will also report methods where you have assigned different types of
objects to a temporary variable.  

I have found this a useful feature, although with proper design of your classes and methods
it serves more as an assurance that everything is okay.

|>   b) Provide statistics that show that the advantages of *not*
|>      needing to do your own garbage collection (free/malloc, new/delete)
|>      outweigh the lack of type checking from the standpoint of building
|>      robust applications.

Run a tool like Purify (no adverti{*filter*}t intended) on your C program and you will appreciate
garbage collection, especially in a project that involves quite a number of programmers.

|> Essentially we are looking for a way to increase the robustness of Smalltalk
|> without losing the rapid response during development and the powerful
|> development environment.
|>
|>                   In advance, thanks,
|>
|>                                   -Mark Roulo

Regards,

        Manfred



Mon, 25 Aug 1997 08:41:50 GMT  
 Strong type checking...
Are you really sure that this is a problem. Everyone without experience
in Smalltalk thinks the lack of static type checking is a problem.

In my experience it is a minor problem. As an example I can site a
system that I am principal constructor of and that went through an
exhaustive system test before release. About 50 bugs were found, none
of them would have been caugt by static type checking.
The most common bug in a Smalltalk system is forgetting to handle nil
values. In Smalltalk you get a runtime exeption  when that happens and
often can continue work. In the statically typed languages and
implementation that I know of the system will go down when it encounters
a bug of this type sometimes (Windows, Macintosh) bringing down the
operating system with it.

Best regards,
Niklas

-------------------------------------------------------------------------
Niklas Bjornerstedt
Entra Data AB, Sweden       tel: +46-8-80 97 00
Gustavslundsv. 151 G        fax: +46-8-26 04 76



Mon, 25 Aug 1997 14:44:14 GMT  
 Strong type checking...

Quote:
>    My company will be beginning a new project shortly and we are
>still considering both languages and operating systems.  The languages
>that are effectively in the running are: C++, Smalltalk, and Eiffel.
>Because this is going to be a large (250,000 - 1,000,000 C equivelent line)
>project involving about 12 to 20 programmers, strong type checking is
>kinda important.  So ... can anyone tell me if there is a way to:
>    a) Add strong type checking to Smalltalk (this method only
>       takes numbers, for example, and then have all the source code
>       scanned to insure that this is the case).
>    b) Provide statistics that show that the advantages of *not*
>       needing to do your own garbage collection (free/malloc, new/delete)
>       outweigh the lack of type checking from the standpoint of building
>       robust applications.

>Essentially we are looking for a way to increase the robustness of Smalltalk
>without losing the rapid response during development and the powerful


First, you might consider the implications of going to Smalltalk.  The code
required will be significantly less than C, on the order of 50,000 to
200,000 lines if Capers Jones extensive database is correct.

If you use ENFIN Smalltalk with Synchronicity, 80% of that code will be
autogenerated and you won't have to worry about typing it.  We do it for
you where necessary.  For example, when automating the Smalltalk object
request broker for dealing with relational databases, we do typing because
each database supports specific types.  You can do typing the same way for
yourself in your code.

The bottom line is that you will only need to write 10,000 to 40,000 lines
of code.  This is a small system that one or two good Smalltalkers could
handle.

Jeff Sutherland
Easel Corp.



Tue, 26 Aug 1997 20:56:06 GMT  
 Strong type checking...

Quote:
>a) Add strong type checking to Smalltalk (this method only
>       takes numbers, for example, and then have all the source code
>       scanned to insure that this is the case).

The theme of my diploma thesis was "The use of typing in Smalltalk".
Unfortunately it's written in german :)
Nevertheless, here's the URL:
http://www.informatik.uni-stuttgart.de/zd/buecherei/studienarbeiten/F...

In my opinion, typing in Smalltalk is useful because
it helps the programmer to read and understand existing code. In
smalltalk programmers do programming mostly by reading existing
methods. If they see a variable, they have to follow the source of the
creation of the object which is bounded to this variable via other
methods in other classes, a process which iterates usually some times.

With (strong) typing, one can see which object is bound to a variable
simply by reading the type of the variable.

Unfortunately, Smalltalk programmers don't use typing because there
is no type system in most ST-systems.

But there are some Smalltalk dialects with Strong Typing:

1) The TS-System of Johnson, Graver and Zurawski
see e.g.:
R. E. Johnson, J. Graver, L. Zurawski: TS: An Optimizing Compiler for Smalltalk,
                           in:
                           Proceedings of the ACM Conference on
                           Object-Oriented Programming, Languages and Applications,
                           pages 18-25, 1988

2) Strongtalk (even if i don't know whether they have a product out now)
see e.g.:
  G. Bracha, D. Grisworld: Strongtalk: Typechecking Smalltalk in a
                           Production Environment, in:
                           Proceedings of the ACM Conference on
                           Object-Oriented Programming, Languages and Applications,
                           pages 215ff, 1993

A reference which might help you too is the following book:
J. Palsberg, M. I. Schwartzbach: Object-Oriented Type Systems,
John Wiley & Sons, 1994

Greets, Fritz Hohl

--

Rotebuehlstr. 108, 70197 Stuttgart



Fri, 29 Aug 1997 23:28:56 GMT  
 Strong type checking...
|>   My company will be beginning a new project shortly and we are
|> still considering both languages and operating systems.  The languages
|> that are effectively in the running are: C++, Smalltalk, and Eiffel.
|> Because this is going to be a large (250,000 - 1,000,000 C equivelent line)
|> project involving about 12 to 20 programmers, strong type checking is
|> kinda important.  So ... can anyone tell me if there is a way to:
|>   a) Add strong type checking to Smalltalk (this method only
|>      takes numbers, for example, and then have all the source code
|>      scanned to insure that this is the case).

SmalltalkAgents (and most other Smalltalks) provides a mustBeKindOf: instance
method of Object that can do this for you, ie.

myMethod: myArgument

    "make sure we have valid input"
    myArgument mustBeKindOf: Vegetable.

    "now do something with it"
    mySalad add: myArgument.

Call myMethod: with on an instance of Cow and it generates an exception.

|>   b) Provide statistics that show that the advantages of *not*
|>      needing to do your own garbage collection (free/malloc, new/delete)
|>      outweigh the lack of type checking from the standpoint of building
|>      robust applications.

I'm sure the guys from Easel will parade out some numbers for you.
I've certainly been on the wrong end of a memory leak on several occasions,
and it's painful to track one down.

--
                                   _____________
                                   |        ___/_
                                   |        |/  /
                                   --  /\  //  /--
                                   ||  ||  /  /||
                                   ||  || /  / ||
                                   ||  ||/  /  ||
John Kuszewski                     ||  |/  /|  ||

                                   \/ /  / ||  \/
that's MISTER protein G to you!     |/__/|      |
                                      /_________|



Sat, 06 Sep 1997 00:33:07 GMT  
 Strong type checking...
I couldn't get into netcom.com to mail this, so I am postin to the group.

Quote:

>The languages
> that are effectively in the running are: C++, Smalltalk, and Eiffel.
> Because this is going to be a large (250,000 - 1,000,000 C equivelent line)
> project involving about 12 to 20 programmers, strong type checking is
> kinda important.  So ... can anyone tell me if there is a way to:
>    a) Add strong type checking to Smalltalk (this method only
>       takes numbers, for example, and then have all the source code
>       scanned to insure that this is the case).

Just as a curiosity, by "strong" type checking do you primarily mean "static" type
checking? Most people do, and there is no way to support static type checking in
Smalltalk without seriously altering the syntax of the language.

Allow me to explain my terms. The "strength" of a language's type scheme is (IMHO)
the degree to which type information determines program behavior. There is a continuum
here from assembly programming (virtually no type information at all) to ML, Ada, and
(shudder) C++. "Static" type checking implies that the language semantics which are
dependent on type information are *fully* known at *compile* time. "Dynamic" type checking
comprises a continuum of languages which do not satisfy the static typing constraints.

C++ is mostly statically typed. I believe that Eiffel is less static. Smalltalk is almost
fully dynamic. All of the above languages have "strong" type checking by my definitions.
Static type checking is widely regarded as contributing to a "safer" programming
environment, but it sure seems to me that the great productivity increases are mostly
being seen using dynamically typed languages. I read somewhere on the net that perhaps
only 10% of bugs are caught by static typing; I'm not sure how much I believe that, but
I have found that dynamically-typed languages tend to fail more "softly."

Quote:
>    b) Provide statistics that show that the advantages of *not*
>       needing to do your own garbage collection (free/malloc, new/delete)
>       outweigh the lack of type checking from the standpoint of building
>       robust applications.

Sorry, no statistics here, but I just want to say that you can have your cake and
eat it, too. Try out a functional language like ML or Haskell. They have strong, static
type schemes, *and* a garbage-collected run-time environment. With ML you also get
a truly wonderful method of code reuse in their functor specifications. For more
details you might try reading comp.lang.ml, or comp.lang.functional. There is also
an excellent bunch of papers at ftp://cs.nebula.yale.edu/pub/yale-fp/papers.
Unfortunately, this directory does not contain the paper I would most suggest reading,
and I have lost the URL for it.

"Haskell vs. Ada vs. C++ vs. Awk vs. ... An Experiment in Software
    Prototyping Productivity" by Paul Hudak and Mark Jones

This paper reports on work done by the Office of Naval Research doing a side by side
comparison of code developed by experts for a subsystem of a new Naval programming
project. It compares the productivity and code quality for this project as developed
in Haskell, Ada, Ada9x, Awk, Rapide, Griffin, Proteus, and Relational Lisp. It is
really worth the time to read.

Some rise, some climb, some crawl, to get to...



Sun, 07 Sep 1997 11:41:53 GMT  
 Strong type checking...

Quote:

>I couldn't get into netcom.com to mail this, so I am postin to the group.

>>The languages
>> that are effectively in the running are: C++, Smalltalk, and Eiffel.
>> Because this is going to be a large (250,000 - 1,000,000 C equivelent line)
>> project involving about 12 to 20 programmers, strong type checking is
>> kinda important.  So ... can anyone tell me if there is a way to:
>>        a) Add strong type checking to Smalltalk (this method only
>>           takes numbers, for example, and then have all the source code
>>           scanned to insure that this is the case).
>Just as a curiosity, by "strong" type checking do you primarily mean "static" type
>checking? Most people do, and there is no way to support static type checking in
>Smalltalk without seriously altering the syntax of the language.

There is a strongly typed variant of Smalltalk called Strongtalk,
but I can't find a reference to it right now...

[partially correct descriptions of C++/Eiffel/Ada type systems deleted]

Quote:
>>        b) Provide statistics that show that the advantages of *not*
>>           needing to do your own garbage collection (free/malloc, new/delete)
>>           outweigh the lack of type checking from the standpoint of building
>>           robust applications.

Aren't you comparing apples and oranges?  Type checking and GC
are orthogonal.  Eiffel is statically typed and has a GC.  C++
can have a GC added to it (I've used a GC in C++; mixed results).
The Miranda and ML language families are implicitly typed and
have GC.  Assembly language is untyped and has no GC.  Ada is
statically typed and has no GC (that I know of).

Quote:
>"Haskell vs. Ada vs. C++ vs. Awk vs. ... An Experiment in Software
>    Prototyping Productivity" by Paul Hudak and Mark Jones


An excellent paper.  Try:

  ftp://nebula.systemsz.cs.yale.edu/pub/yale-fp/papers/NSWC/jfp.ps

Just a general comment: choosing a language solely on the basis
of application size and type system is a bad idea.  Things like
portability, availability (of compilers and tools and programmers),
efficiency, safety, etc. are also very important.

--
    ciao,
    milo
================================================================
    John DiCamillo                        Pinin' for the fjords?



Tue, 09 Sep 1997 04:46:23 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Strong type checking ... (not really)

2. Strong type checking + Heterogenous con

3. Strong type checking is good, but...

4. Strong type checking + Heterogenous containers?? Which OOPL??

5. is Java getting close to Ada strong type checking with this tool?

6. Flying With Python (Strong versus Weak Typing) [actually, Static vs Dynamic typing]

7. Strong static typing does not work

8. Strong typed variables

9. Strong typing header needed

10. Strong Typing

11. Strong/Weak typing

12. Escape from strong typing (was: swap(x,y))

 

 
Powered by phpBB® Forum Software