gary marsdenslide 1university of cape town designing usable programming languages
TRANSCRIPT
Gary Marsden Slide 1University of Cape Town
Designing usable programming languages
Gary Marsden Slide 2University of Cape Town
End user programming
• Look at the need to provide “graphical interface” programming languages for novice programmer
• Many reasons why this is important– 40% of homes have computers–
Gary Marsden Slide 3University of Cape Town
Current tools
• We shall call these RAD (Rapid Application Development) tools
Gary Marsden Slide 4University of Cape Town
Problems
• Simplifications are made, which turn out to be “complexifications”
• Computer scientists don’t seem to care
Gary Marsden Slide 5University of Cape Town
Previous end user languages
• BASIC– Did not need to be crippled; hardware was
simple– Encouraging– Extensible (PEEK, POKE)– Teaching language
Gary Marsden Slide 6University of Cape Town
Current Systems
• Passive– Toolkits– Components
• Active– “Zero” functionality– Graphically aided– Interface builders– RAD– Visual Language– Interface spec systems
Gary Marsden Slide 7University of Cape Town
Favourites
• HyperCard– free from Apple,– Graphics program to which was added
language– Most popular on Macintosh
• Visual Basic– Comes in VBA and full flavours– Windows / Office language of choice– Language to which was added graphics
Gary Marsden Slide 8University of Cape Town
Learning Curve
Gary Marsden Slide 9University of Cape Town
Modes
• Design and execute modes
Gary Marsden Slide 10University of Cape Town
Mode Solutions
• Should not be modes• If modes are to be used
– Provide adequate feedback on mode – Not conflict with previous use– Reflect real world metaphor
Gary Marsden Slide 11University of Cape Town
Screw solution
Gary Marsden Slide 12University of Cape Town
Translation
• Compile on demand– Full program need not be written before a part
can be run– Compile errors only reported by sub-program– Should be possible to do full compilation
Gary Marsden Slide 13University of Cape Town
Adding widgets
– HyperCard - methods only– Visual Basic - attributes only– Should allow widgets to be
added as first class citizens (data type completeness)
– Full interface should be available (object browser)
Gary Marsden Slide 14University of Cape Town
Editors
• Detect syntax errors
• Automatic indentation (essential for HC)
• Statement colouring
• Mixed mode
Gary Marsden Slide 15University of Cape Town
Customisation
• Re-use IDE features• Hierarchy of widget
methods/properties• Interface structure reflect
code structure
Gary Marsden Slide 16University of Cape Town
Structure
• Object based• “Reflexive interaction paradigm”• Object instantiation through “cut” and “paste”• Ability to create own objects
Gary Marsden Slide 17University of Cape Town
Syntax
• No ambiguities - either visual or natural language
• Ideally, syntax should resemble “real” language
Gary Marsden Slide 18University of Cape Town
Data Types
• Coercion– Typeless, auto. Coercion, Mixed mode (integer
~ real), Pseudostrong, Strong
• Multimedia• Dynamic binding (visual binding, “me,
this”)• Allow strong typing• Semantically equivalent objects should be
treated identically
Gary Marsden Slide 19University of Cape Town
Data Structures
• HC has none, VB has no dynamic ones• Persistent• Multimedia (universe of discourse)• References
– Form1.text1 = “Hello”– Set card field “1” of card “1” to “Hello”
Gary Marsden Slide 20University of Cape Town
Integration
• Language reflect interface concepts• Universe of discourse
– Use of widgets in IDE not available to programmer
– Control of widgets different from language and IDE
• Self implementation– Compilers written in own language -> IDE
written in script language (reflection)
Gary Marsden Slide 21University of Cape Town
Programmer needs
• Instant gratification• Pleasantness • Low viscosity and low premature
commitment
Gary Marsden Slide 22University of Cape Town
Paradigm
• Functional / Declarative• Visual Languages• Programming By Example
Gary Marsden Slide 23University of Cape Town
Programming by Example
• Great for getting people stared, but there comes a limit to the inference engine and we bring a step into the learning curve
Gary Marsden Slide 24University of Cape Town
Functional / Declarative
• State destination, not journey• Referential transparency• Recursion not so good
– poor transferable skill
• “Functional languages are unnatural to use”– demand premature commitment– role expressive, but highly viscose
Gary Marsden Slide 25University of Cape Town
Declarative IO
• Fudgets• Monads / Continuation• Unique types
– one reference at a time– fac 1 = 1– fac n = n * (fac(n-1))
• Stick with OO for now (possibly ABC or Turing)
Gary Marsden Slide 26University of Cape Town
Representing Widgets
• How do you talk about widgets in a language?– Find fundamental widget “particle”– Align language semantics to widget semantics
• If you can do this, – focus on problem domain– increase language role expressiveness
Gary Marsden Slide 27University of Cape Town
Fundamental widget
• Are all widgets just a subclass of button?
Gary Marsden Slide 28University of Cape Town
Language isomorphism's
• Labels and text box are easy
Gary Marsden Slide 29University of Cape Town
Radio and check buttons
• Radio is easy - enumerated type• Check boxes need a new, variant
enumerated– style = (plain|(bold,italic,underline)
Gary Marsden Slide 30University of Cape Town
Radio and Checkboxes visulaised
Gary Marsden Slide 31University of Cape Town
Pizza
Gary Marsden Slide 32University of Cape Town
Range Selection
• Widgets to select values can be classified as follows:– One from a small range– Several from discrete– Single from continuous– Sub-range from range
Gary Marsden Slide 33University of Cape Town
Range variables
• A = [5<-|->20]• B = [5<-|-|->20]• C = [5<-7->20]• D = [5<-7-13->20]
Gary Marsden Slide 34University of Cape Town
Buttons
• These turn out to be hard as they are verbs rather than nouns
• Settled for objects which contained event handlers for mouse input
Gary Marsden Slide 35University of Cape Town
Prototype
• Some of this has been implemented in Java