Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Python discussion, anybody?



On Fri, 27 Oct 2000, Stephen J. Turnbull wrote:

> To my mind, strong typing is about allowing the compiler to catch
> design errors, something compilers are not good at.  If you've written
> your interfaces correctly, you will not try to poke nantoka& pegs into
> struct _kantoka locations.  And if you do, unlike C and C++ which
> allow you to cast away the error, Python will bark at runtime.

  If I understand what you mean (not having used Python yet myself, but
impressed that someone finally took care of the bracket-indentation
redundency*), I have a half-baked idea that this sort of checking belongs
to a separate lint-type utility. I.e., rather than have to deal with the
inconveniences of strong-typing as in C++/Java/etc, wouldn't it be nice to
have a kind of linker-checker that traced back all the calls that could**
be made on objects to argument lists, constructed the necessary
interfaces, and made sure that all reference passed into a function
implement all the methods that might later be called.
  Does that make sense? Do any of the smalltalk like "see-what-happens"
weakly typed OO languages have this sort of feature/utility? Am I missing
something which makes this impossible (I'm not missing the fact that it
would be quite a challenge, and that 'exec' like functions will always be
a problem, but otherwise I gather there are optimizing linkers that do
this sort of backtracking)>?

cheers,
Todd

P.S. On the original point, I agree that not catching typos until runtime
(worse, not catching them at all) is a recipe for disaster. That little
'my' in Perl goes a long way.

* The next step is editor support for displaying a big left-side bracket
or verticle bar to highlight your blocks. Then let people fold
(open/close) those blocks. Anything (i.e., in a vi or emacs) like this
yet?

** "could" as in "there's a branch-path-which-exists", not as in the
uncomputable "it's actually possible". Which means that it would raise
false-alarms for programs which do nasty things like check the class of an
object and then implicitly down-cast.


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links