Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!uwvax!daffy!saavik.cs.wisc.edu!quale From: quale@saavik.cs.wisc.edu (Douglas E. Quale) Newsgroups: comp.lang.misc Subject: Re: Run-time Type Errors in Smalltalk Message-ID: <1991May17.051840.26916@daffy.cs.wisc.edu> Date: 17 May 91 05:18:40 GMT References: <1991May16.011804.21042@tkou02.enet.dec.com> <1991May16.153308.4054@spool.cs.wisc.edu> <1991May17.011209.29486@tkou02.enet.dec.com> Sender: news@daffy.cs.wisc.edu (The News) Organization: University of Wisconsin -- Madison Lines: 41 In article <1991May17.011209.29486@tkou02.enet.dec.com> diamond@jit533.enet@tkou02.enet.dec.com (Norman Diamond) writes: >In article <1991May16.153308.4054@spool.cs.wisc.edu> quale@picard.cs.wisc.edu (Douglas E. Quale) writes: >>In article <1991May16.011804.21042@tkou02.enet.dec.com> diamond@jit533.enet@tkou02.enet.dec.com (Norman Diamond) writes: >>>[ugly C syntax to do programmer-computed dynamic typing of some X11 values] >>I think there are reasons why the X Toolkit Intrinsics doesn't do this. >>One of the design goals was binary compatibility with past versions. > >Uh, if you want binary compatibility between existing C code and a >dynamically-typed language, you'll have a lot of problems. When we No, I mean binary compatibility between different C versions of the Toolkit. Adding new types messes up the tags. In C the type union approach is awkward as the X Toolkit resources have a lot of different types. Unfortunately I don't have a complete list here, but it includes int, String *, WidgetList, Function, Cardinal, AcceleratorTable, Pixel, Pixmap, Colormap, Boolean, Screen, TranslationTable, Dimension, Callback, Position, Visual, Atom, Widget, InitialState, Window, CallbackList, Cursor, FontStruct*, Justify, ShapeStyle, Orientation, float, BackingStore, TextPosition, TextResizeMode, TextScrollMode, TextSelectType*, EditType, AsciiType, and WrapMode. My apologies to anyone I've inadvertantly overlooked, and I hope I didn't repeat any types. These are only the types of the resources for the Athena widgets, the Motif widget resources have a *lot* more types, and it must be possible for any widget writer to add still more. > >>Dynamically typed languages are safer than primitive statically typed >>languages such as C. > >No. Dynamically typed languages are safer than C. Statically typed ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ I believe that's what I said. -- Doug Quale quale@saavik.cs.wisc.edu Primitive statically typed languages are languages that practically force the programmer to use an unchecked simulation of dynamic typing. For a start they generally lack polymorphism, and frequently have little support for generics at all. Sadly, a vast majority of the programs written in static languages are in languages that have very primitive type systems.