i have nothing to declare but my genius

Download I Have Nothing to Declare But my Genius

If you can't read please download the document

Upload: denis

Post on 09-Jan-2016

55 views

Category:

Documents


1 download

DESCRIPTION

I Have Nothing to Declare But my Genius. -or- Late Binding as a Philosophy of Life Brian Foote [email protected] http://www.laputan.org. Why I’m (Still) Here. The Dynamic Vision from James VI through George III Architectural Balkanization in the Post-Linguistic Era - PowerPoint PPT Presentation

TRANSCRIPT

  • I Have Nothing to Declare But my Genius-or-Late Binding as a Philosophy of LifeBrian [email protected]://www.laputan.org

  • Why Im (Still) HereThe Dynamic Vision from James VI through George IIIArchitectural Balkanization in the Post-Linguistic EraThe Future of Objects in a Global Ultrascale Ecosphere

  • #1: Dynamic PolymorphismWhat other kind is there?Easy as PIEGreat for Wrapping StuffModularityApplication LevelComponent Level

  • #2: Callipygian CompilationDeutsch and ShiffmanSelf and HotspotA Cast of ThousandsThe JITtersComplets

  • Smalltalk-80Everything I know about OO I learned from the ImageBrowsers / IDEsWindows GUIsDynamic Translation (JITs)Building Programs Out of Objects

  • A Language Built of First-Class ObjectsObjectBehaviorClassDescriptionClassMetaclassMethodMethodDictionaryCompiledMethodByteArrayContextMethodContextBlockContextMessageProcessProcessSchedulerSemaphoreSharedQueueCompilerSystemDictionary

  • #3: ReflectionGrew out of the Lisp TraditionPrograms able to access a causally connect representation of themselves Self RepresentationIntrospection / Intercession

  • The ManifestUser ConfigurationEvolutionA mapA manifestUser configurable codeAd hoc reflection

  • Class Menagerie1. Monitors2. Encapsulators3. Message Forwarding4. Property List Manipulations5. Accessible Objects (Dicts=Records=Props)6. Multiple Views (Database style)7. Capabilities (Access Control)/OS Style Protection8. Multiple Inheritance9. Tracing10. Debugging (Many Mentions)11. Futures12. Remote (Distributed) Objects13. Multitasking (transparent, perhaps)14. Constraints15. Reflection16. Part/Whole Relationships17. Active Values Active Variables Active Messages Active References18. "Smart" Variables19. Lightweight (Anonymous) Classes20. Melds (Garlan & Kaiser)21. Actors/Daemons22. Lazy Evaluation23. Caching Schemes24. Memo Memory Functions (as in POP2 and friends)25. Read-Only Variables26. Logging27. Metering/Statistics/Performance Data Collection28. Component Delegation29. Atomic Objects/Actions30. Protocol Translators/Adaptors31. Open Systems (Protocol Negotiators?)32. Multiple Inheritance Schemes33. Delegated Inheritance (and other forms of sharing)34. Multimethods (and other generic dispatch schemes)35. Method Combination/Composition36. Prototypes (ala Borning)37. Modules (ala Wirfs-Brock)38. Continuations? Catch/Throw?39. Exception Handling of various sorts...40. Dynamic Behavior Changes

  • Class Menagerie41. Dynamic Class Changes42. Dynamic Class Construction43. "Smart" Paths (see Part/Whole)44. Flavors (now CLOS)-Style Method Combination45. Two Way Implicit Group Membership (like Part/Whole?) (Perhaps encompassing the idea of "Enrollment" (Randall Smith))46. Implicit Coercion Schemes47. X-Style Substructure Redirection48. Event Dispatching (see Multimethods)49. Alternate Memory Allocation Schemes50. Multilevel (Virtual, in the OS sense) Object Allocation51. Sundry Dynamic and Other Optimizations (Cointe)52. Escape Operators (see Continuations) (B. C. Smith)53. "Deviant" Variable Passing Protocols (B. C. Smith)54. Planning/Supervisory Code (Genesereth, others)55. Behavior Based Programming56. Active Types57. Strategy Computation 58. Truth Maintenance59. Program Supervision60. Multiprocessor Load Balancing

    61. Active Values/Access Oriented Programming62. Self Analysis (Code Walking) 63. Self description of a program's operational semantics64. Smart Comments65. Logic Variables/Unification66. Agents67. Virtual Time (Time Warp)68. Version Management69. Garbage Collection70. Persistent Objects71. Active Protocols72. Algorithm animation73. Language Level Viruses74. Program Transformation

  • CLOS and the MOPT| STANDARD-OBJECT| | CONSTRUCTOR| | METHOD-COMBINATION| | | STANDARD-METHOD-COMBINATION| | | | LONG-METHOD-COMBINATION| | | | SHORT-METHOD-COMBINATION| | PLIST-MIXIN| | | | | DEFINITION-SOURCE-MIXIN| | | | | METAOBJECT| | | GENERIC-FUNCTION| | | | STANDARD-GENERIC-FUNCTION| | | METHOD| | | | TRACED-METHOD| | | | STANDARD-METHOD| | | | | STANDARD-ACCESSOR-METHOD| | | | | | STANDARD-WRITER-METHOD| | | | | | STANDARD-READER-METHOD| | | SLOT-DEFINITION| | | | STANDARD-SLOT-DEFINITION| | | | | STANDARD-EFFECTIVE-SLOT-DEFINITION| | | | | STANDARD-DIRECT-SLOT-DEFINITION| | | | EFFECTIVE-SLOT-DEFINITION| | | | | STANDARD-EFFECTIVE-SLOT-DEFINITION| | | | DIRECT-SLOT-DEFINITION| | | | | STANDARD-DIRECT-SLOT-DEFINITION| | | SPECIALIZER| | | | EQL-SPECIALIZER| | | | CLASS| | | | | PCL-CLASS| | | | | | BUILT-IN-CLASS| | | | | | FORWARD-REFERENCED-CLASS| | | | | | STD-CLASS| | | | | | | FUNCALLABLE-STANDARD-CLASS| | | | | | | STANDARD-CLASS
  • Objects We BuiltMultiMethodSpecializerClassSpecializerEqualSpeciealizerGenericMessageMethodCombinationDiscriminatingMethodQualifiers (#Before #After, etc.)SubStandardMethodCombinationSimpleMethodCombinationBetaMethodCombinationDispatchingMethodCombination

  • ActorsAsynchrony is only now coming into vogueA Glamorous World: Models ActorsA strategic architecture reserve

  • One of These is TrueMeta considered harmfulMeta considered harmful

  • The VisionLanguages Built out of ObjectsOpen LanguagesOpen JITTERSA Framework For LanguagesCompile Time is any TimeLinguistic Imperialism

  • The RealityUtopian Monocultures were wonderful idea incubatorsMore pragmatic languages prevailedWe live in a heterogeneous polyglot world We need to play well with othersThe Rise of Worse is Better

  • The Great Schism of 97ObjectivistsAspectivistsPragmatistsFormalists

  • The MedusaAn apparition so hideous that all who gaze upon her are turned to stone

    "This thing you call language, though...most remarkable. You depend on it for so very much, but is any one of you really its master?" -- Spock/Kollos, Is There in Truth No Beauty?

  • XSLT Example

    ,

  • Of Slugs and BugsHow Star-Crossed Software Lost the Mars Climate Orbiter

    The fault, dear Brutus, is not in our stars, But in ourselves, that we are underlings

  • A Comic Book Tragedy?Perfectly good spaceshipPerfectly good software onboardSupport software working as intendedDived into Martian atmosphere, just as it was told toThe culprit: a simple unit conversion

  • The CarpetbaggersType TheoristsMethodologistsLanguages DesignersTestersManagement ConsultantsSystem IntegratorsInterface Design Engineers?

  • The Root CauseThe failure to use metric units in the coding of a ground software file, Small Forces used in trajectory models. Specifically, thruster performance data in English units rather than metric units was used in the software application code titled SM_FORCES (small forces).

  • Angular Momentum DesaturationMCO uses both reaction wheels and thrusters RWs allow more precise attitude controlIn an ideal world, they never saturateOn an ideal spacecraft, there is no residualOn an ideal mission, residuals cancel outIn an ideal model, these are properly accounted for

  • How MCO was Lost

  • Dollars and Francs

  • Mass, Weight, Force and ImpulseF = ma1 N = (1 kg)(1 m/s2)1 lbf = (1 slug)(1 ft/s2) 1 lbf = 32.174 lbm (1 ft/s2)1 lbf = 1 lbm (32.174 ft/s2)1 lbm = .4536 kg1 ft = .3048 m1 N = 4.448 lbf1 N-sec = 4.448 lbf-sec 4.448 = (32.174)(.3048)(.4536)1 N-sec = 1 kg-m/sN = kg (9.81 m/s2)

    Weight = 32.174 lbfMass = 1 slugMass = 32.174 lbmMass = 14.6 kgWeight = 143 N

  • SM_FORCESAlthough starting from MGS-heritage software, the coded thruster equations had to be changed because of the different size RCS thruster that MCO employed. As luck would have it, the 4.45 conversion factor, although correctly included in the MGS equation by the previous development team, was not immediately identifiable by inspection (being buried in the equation) or commented code in an obvious way that the MCO team recognized it.

  • A Typeless Tragedy?Metric units were in the SISPaper is not executableSIS was complied with under MGSLMA is an English Unit shopUnclear whether Whole Values would have helped catch this problemProgrammers are not executable

  • A Hatchet JobMCO: Faster Better Cheaper (pick two)Reused instruments Reused software Just one more cut-n-paste horror storyAll that paper, but yet the right information wasnt before the right person when it was sorely needed

  • If it aint been testedFull end-to-end test never performedPrograms were lateOlfactory Method not followedPaper is not always the your weapon of choiceManagers dont win games, players do

  • The Olfactory MethodKent Beck: May be Best Remembered as the Man Who brought Scatology and Software Engineering together

    If it stinks, change it!--Grandma Beck

    Code Smells are (not so) subtle indications a piece of code is in need of attention and is a likely candidate for refactoring

  • My JourneyUnits?Types?Metadata?Process?Testing?Mud!

  • A $327 Million Fireworks Displayin the night time Martian sky, watched by no one-- 23 September, 1999

  • The End-to-End PrincipleApplies to programming languages tooWhy dote if you have to do it over?Types build of real first class runtime objects can be customized

  • The Post Linguistic EraThe is a five hundred pound gorilla in the roomThe Program Model is CentralThe ASCII is fungible, round- trippableRepresentations are freely convertiblePrograms built of objects can be changedAnything can be swapped out

  • Building Program Out of ObjectsMonitoring, Debugging, Tracing, etc.Patterns are all in PlayDynamic Objects Models and Frameworks Grow into Programming Languages You can debug, edit, browse, you name it

  • MegafaunaGlobal NamespaceThe ManifestPolymorphism, Reflection, JittingVegetable, not AnimalRuntime Testing, Communication, Metering

  • Engineering TolerancesWe cant type each line tree timesWe can leave in the goaliesWhat are we thinking taking them out?We can engineer our objects to self test

  • The Gang of FourDesign Patterns: Elements of Reusable Object-Oriented Software

    Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides

    A landmark book that changed the way programmers think about building object-oriented programs

  • The CornucopiaMoores Law has bought three, four orders of magnitude in performanceWeve squandered it on eyewashCant we afford to leave the goal tender in?Testing shows the valueThose runtime type errors? Welcome to the 21st centuryNetwork, DB, are slower than reflection

  • The Frugal Fussbudgets of FormalismStatic languages throw away all the information we need at runtime. Why???This made some sense in 1982Its peanuts to keep this stuff nowIts almost malpractice not to

  • Dynamic Types are Strong TypesWeak vs. Strong and Static vs. Dynamic are distinct dimensionsI dont care about mere declarations, I want to know what enforces them

  • Embrace StuffEmbrace FailureEmbrace DiversityEmbrace RuntimeEmbrace HeterogeneityEmbrace Change

  • Soft MachinesAre made of objectsAre easy to changeAre easy to hardenAre virtual machinesAre configurable machines

  • The Holocene ExplosionIntegrationBrokers and Reflection CORBA?SOM!

  • The Cobblers Children

  • Oscar Wilde, is, of course, one Ireland's most gifted minters of colorful epigrams...

    Wilde, when, visiting America for the first time, was asked upon arriving at the New York Customs House if he had anything to declare, and is said to have replied: I have nothing to declare except my genius . -Oscar Fingal OFlahertie Wills Wilde (1854-1900) (Wow, when he was my age, hed been dead for nearly five years.)

    Ive always thought this would be nifty / ideal / epigram for a talk on dynamic types. Hence, here goes nothing.

    Of Type Systems and customs posts. Goal posts

    It seems rather bizarre that one still has to make the case that dynamic types are as strong as static types, but one does. Id claim they are, in fact stronger.

    Close-form, close world type theorists seem like soccer (er, this is Europe so football) coaches who seek to show that their game plan is so foolproof that it can be conclusively shown that no shot on goal is possible, conceivable, and hence no goalie is even necessary. In fact, they seek to assert that the game need not even be played, since victory is certain, and any rational adversary would capitulate, forfeit in the faceof such claims, of such an irrefutable demonstration. With a dynamic type system, we just keep the goalie. Which approach makes YOU feel safer?

    Earlier this year, I finally came across one of the greatest classic papers Id never read: End-to-End Arguments in System Design by Saltzer, Reed, and Clark. The end-to-end argument was developed in the realm of internet protocol design. Succinctly put (and this format allows for no alternative) it argues that facilities, such as error checking, which one might be tempted to place at the lower levels of a system or network, might actually be redundant, and therefore useless as the lower levels, when they must be included in the upper levels of the system as well.We argue that this argument applies as well to programming language design as it does to networking. For instance, facilities that some languages provide for security, protection, synchronization, namespace management, or type checking must often be re-implemented in applications programs in a variety of different ways, many at odds with the manner in which these facilities were provided in these underlying languages. Such duplication raises the question of why these now redundant facilities need be present in these programming languages at all. This argument suggests a simpler, more dynamic approach to programming language design, based on an end-to-end analysis of the kinds of facilities users really use, may be better suited to the demands of our clustered, networked, threaded multi-core 21st world.

    Real applications live, and breath, function, and yes fail, in a world well beyond our formal logistics train. Real computer science is an empirical, even behavior science, and not the feeble parody of seventeenth century closed-form mathematics some in CS make it out to be.

    There are patterns of programming language design. Objects for lists of states, or zip codes, these are the types our clients demand. Will the legacy of the reflection movement be that we get out of their way, and finally give people the tools to build these as first-class runtime entities?

    Complets

    Write once run anywhere foundered on the shoals of GUIdom, yet?

    I cant begin to tell you how impressed I was, when I was first learning Smalltalk, to discover that programs were themselves built out of objects, and that you could change and extend these too, just like an other. Its a big part of why Im still here, and standing before you today.

    (Give a brief rundown of what these do at runtime)

    There is really very little that you cant get at in Smalltalk. We identified the things you cant override back in 89: sending a message, receiving a message, returning from a context, and reading and writing instance variables.

    A short time after I learned Smalltalk, I came across another effort to build a language out of objects, the Common Lisp Object System.

    Here are the CLOS like objects we built atop of Smalltalk to implement our multimethods.

    (Explain these, one by one)

    In fact, we went well beyond simple multmethods. The collection of metabojects we built is a surprisingly complete / comprehensive implementation of the CLOS MOP. The major missing elements are multiple inheritance, and around methods.

    Choreographer is a better name for MethodCombination that is Method Combination. A number of the names are rather droll. Is this in part to blame for this works relative, and undeserved, obscurity?

    The two mops coexist fairly harmoniously, especially in contrast with Javas dueling type systems.

    There is a potential synergy between these two mops that I regret to say remains undemonstrated to this day. Between the two of em, theyve nearly got the space covered. But thats a talk for another day.

    Same here.what Kent Beck so vividly refers to as a Code Smell.

    Kent Beck is one of the more remarkable figures the OO community has produced. I met him about twenty years ago when he managed to help get me an under-the-table copy of the Apple Smalltalk interpreter and image for the Apple Lisa. His seminal contributions are too numerous to mention but as intellectual paternity goes where do we begin?

    His brainchildren are numerous: father of the patterns movement, Smalltalk evangelist, with Ward, one of the original pair of pair programmers, the Vince Lombardi of Extreme Programming However, it is sad that real genius exhibits itself in the gaps, at the borders, between disciplines. It is for this reason that I think that Kent will be best remembered as the Founder of the field of Computational Scatology.

    The notion of code smell is vivid, compelling, immediate ingenious. Beck veritably channels Marcel Proust.

    and, my friends, type cases are redolent of code rot

    The essential field guide

    Once as farce, once as tragedy