dypl - people.dsv.su.sebeatrice/dypl_12/l1_dypl_vt12_4pp.pdf · exam • “take-home” exam •...
TRANSCRIPT
![Page 1: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/1.jpg)
O
n
DYPL
Monday, January 16, 12
![Page 2: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/2.jpg)
Course information
• 14 Lectures
• 3 Assignments (3x1.5 credit)
• 3 credit exam
• Course information on web page
• Discussion in FC and in the weekly seminar
http://people.dsv.su.se/~beatrice/DYPL/
Monday, January 16, 12
![Page 3: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/3.jpg)
Lectures
1. What do you mean “dynamic”? 2. Shortcomings of dynamic programming languages
3. Duelling Banjos I: Ruby vs. Python 4. Duelling Banjos II: Ruby vs. Python
Monday, January 16, 12
![Page 4: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/4.jpg)
Lectures, cont’d
5. More on Python6. More on Ruby7. Dynamic Languages III: Reflection and Metaprogramming8. Back to the future: Smalltalk9. Dynamic Languages IV:Philosophy and all that jazz
Monday, January 16, 12
![Page 5: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/5.jpg)
Lectures, cont’d
• Lisp
• Javascript
• Smalltalk
• Erlang
• Combining static and dynamic typing
Monday, January 16, 12
![Page 6: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/6.jpg)
Assignments
• Examines programming part
• 3 x 1.5 credit
• Python, Ruby + other new language
• Must work in pairs and rotate pairs
• Solutions presented and defended
Monday, January 16, 12
![Page 7: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/7.jpg)
Weekly Seminars
• We prepare some discussion topic and/or programming problem
• The time will be used for discussions about some theoretical problem, programming problem or other course related topics
Monday, January 16, 12
![Page 8: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/8.jpg)
Literature Seminars
• “Hackers and Painters” - Paul Graham
• “The Cathedral and the Bazaar” - Eric S. Raymond
• “The Best Software Writing” - ed. Joel Spolsky
Monday, January 16, 12
![Page 9: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/9.jpg)
Exam• “Take-home” exam
• Might be combination of theoretical and practical problems
• Example questions will be distributed
• Bonus credits can be used to “buy” answers
• The exam will be published 2012-03-14 08.00 on the course web page
• The exam should be handed in according to the instructions in the exam document on 2012-03-17
Monday, January 16, 12
![Page 10: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/10.jpg)
Deadlines
• We have no hard deadlines during this course
• But, that doesn’t mean that you shouldn’t set up deadlines for yourself!
• We recommend you to finish ๏ Assignment 1 by February 6๏ Assignment 2 by February 21๏ Assignment 3 by March 7
Monday, January 16, 12
![Page 11: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/11.jpg)
O
n
Questions?
Monday, January 16, 12
![Page 12: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/12.jpg)
O
n
What do you mean “dynamic”?
Monday, January 16, 12
![Page 13: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/13.jpg)
Dynamic?
Monday, January 16, 12
![Page 14: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/14.jpg)
• [Process or system] characterised by constant change, activity, or progress
• [A person] positive in attitude and full of energy and new ideas
• A force that stimulates change or progress within a system or process
Oxford Dictionary
Monday, January 16, 12
![Page 15: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/15.jpg)
• Energetic, spirited, active, lively, vital, vigourous, forceful, powerful, positive
• High-powered, aggressive, bold, enterprising
• Informal go-getting, peppy, full of get-up-and-go, full of vim and vigour.
Synonyms
Monday, January 16, 12
![Page 16: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/16.jpg)
Scripting Language
• Script comes from performing arts
• One-off tasks
• Customising admin tasks
• Simple, repetitive tasks
Monday, January 16, 12
![Page 17: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/17.jpg)
• A belittling term
• Script implies “a small program”
• We use dynamic [programming] language
“Scripting language”
Monday, January 16, 12
![Page 18: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/18.jpg)
• LISP (~1956)
• Smalltalk (1972)
• Self (1986)
• Perl (1987)
• Python (1991)
• Ruby (1993)
A Few DYPLs
Monday, January 16, 12
![Page 19: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/19.jpg)
What does dynamic mean for PLs?
Monday, January 16, 12
![Page 20: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/20.jpg)
Dynamic typing
Monday, January 16, 12
![Page 21: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/21.jpg)
Static Typing• Each variable must be declared with a
particular type and it must be used in ways that are appropriate for the type
• Type checking at compiletime
• C, C++, Java, ML, Haskell, etc.
public int sumOfWages( BaseballPlayer[] bs ) { int sum = 0; for ( int i=0; i < bs.length; ++i ) { sum += bs[ i ].wage( ); } return sum; }
Monday, January 16, 12
![Page 22: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/22.jpg)
Dynamic Typing
• In a dynamically typed language, you can send any message to any object, and the language only cares that the object can accept the message
def sumOfWages( aList ): ! sum = 0 ! for item in aList: ! ! sum += item.wage( ) ! return sum
Monday, January 16, 12
![Page 23: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/23.jpg)
Dynamic Type Checking?
Monday, January 16, 12
![Page 24: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/24.jpg)
Dynamic Type?
Monday, January 16, 12
![Page 25: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/25.jpg)
Typing?
• Two forms of typing ๏ Strong ๏ Weak
• Strong typing and static typing are orthogonal concepts
Monday, January 16, 12
![Page 26: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/26.jpg)
Weak or Strong Typing?• Decides how a type is enforced, or
interpreted
• In a weakly typed language, variables can be coerced easily -- interpreted as something else
PythonRuby
Smalltalk
JavaPascal
PHP
C++
Weaker typing
Moredynamic
Monday, January 16, 12
![Page 27: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/27.jpg)
>> 1+"2"TypeError: String can't be coerced into Fixnum from (irb):1:in `+' from (irb):1>> "1"+2TypeError: can't convert Fixnum into String from (irb):2:in `+' from (irb):2
>>> "1"+2Traceback (most recent call last): File "<stdin>", line 1, in <module>TypeError: cannot concatenate 'str' and 'int' objects>>> 1+"2"Traceback (most recent call last): File "<stdin>", line 1, in <module>TypeError: unsupported operand type(s) for +: 'int' and 'str'
Monday, January 16, 12
![Page 28: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/28.jpg)
High-level
Monday, January 16, 12
![Page 29: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/29.jpg)
Systems Languages
None
Dynamic Languages
Assembly
StrongDegree of Typing
1000
100
10
1
Instruction/
Statement
Tcl/Perl
Visual Basic
C
C++Java
Slightly modified illustration from [1]
Monday, January 16, 12
![Page 30: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/30.jpg)
Productive
Monday, January 16, 12
![Page 31: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/31.jpg)
Briefly: LOC
• LOC/hour is invariant of PL [11, 2 via 1]
• 1 LOC C ≈ 3–7 assembly instr. [1]
• 1 LOC Python ≈ 3 LOC C [11]
• 1 LOC TCL ≈ 3–47 LOC C [1]
Monday, January 16, 12
![Page 32: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/32.jpg)
PLs Comparison
• “An Empirical Comparison of Seven Programming Languages”, Lutz Prechelt [11]
• Designing and writing the program in Perl, Python, Rexx, or Tcl takes no more than half as much time as writing it in C, C++, or Java — and the resulting program is only half as long.
Monday, January 16, 12
![Page 33: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/33.jpg)
`cat wordlist`.split("\n").collect do |w| w.strip if w =~ /^#{match}/ end.compact
Monday, January 16, 12
![Page 34: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/34.jpg)
Interpreted (rather than compiled)
Monday, January 16, 12
![Page 35: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/35.jpg)
Interpreted Languages
• Interpreting is the process of mapping encoded instructions to some actual operations associated with them
• This way interpretation and execution are basically the same thing -- the only difference is the level at which the interpretation is done
• Most interpreted languages combine both compilation and interpretation
Monday, January 16, 12
![Page 36: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/36.jpg)
Interpreted Languages
• Platform independence
• Reflective usage of the evaluator
• Dynamic typing
• Ease of debugging
Monday, January 16, 12
![Page 37: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/37.jpg)
Flexible at run-time
Monday, January 16, 12
![Page 38: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/38.jpg)
What is run-time?
Monday, January 16, 12
![Page 39: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/39.jpg)
Extensible through metaprogramming
Monday, January 16, 12
![Page 40: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/40.jpg)
2.weeks + 4.days + 3.minutes + 8.seconds3.weeks.from_today.on_sunday
Monday, January 16, 12
![Page 41: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/41.jpg)
# Augment the built-in classes # (As numeric is already defined --# it is standard-- # these methods are added to the # Numeric class)
class Numeric def minutes; self * 60; end def hours; self * 60.minutes; end def days; self * 24.hours; end ! # etc. end
# A time interval 3.years + 13.days + 2.hours
# Four months from now, on a Monday 4.months.from_now.next_week.monday
Monday, January 16, 12
![Page 42: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/42.jpg)
Fun
Monday, January 16, 12
![Page 43: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/43.jpg)
REPL?
Monday, January 16, 12
![Page 44: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/44.jpg)
Garbage collected
Monday, January 16, 12
![Page 45: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/45.jpg)
Suitable for non- programmers also
Monday, January 16, 12
![Page 46: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/46.jpg)
Pragmatic
Monday, January 16, 12
![Page 47: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/47.jpg)
Why are DYPLs not as successful as system PLs?
Monday, January 16, 12
![Page 48: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/48.jpg)
• Dynamically typed languages:• Statically typed languages:
Origin of Languages
Monday, January 16, 12
![Page 49: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/49.jpg)
System PLs
• Optimisation
• Fine-grained resource control
• Static checking
• Typing is documentation
• Conservative is safe
Monday, January 16, 12
![Page 50: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/50.jpg)
John K. Ousterhout
• Scripting languages are designed for “gluing” applications; they use type- less approaches to achieve a higher level of programming and more rapid application development than system programming languages. [1]
Monday, January 16, 12
![Page 51: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/51.jpg)
[DYPLs are] old in years but young in maturity [1]
Monday, January 16, 12
![Page 52: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/52.jpg)
Use DYPLs when [1]
• mainly connecting components
• manipulating many different things
• needing a GUI
• rapid evolution is expected
• extensibility is important
Monday, January 16, 12
![Page 53: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/53.jpg)
Don’t use DYPLs [1]
• when complex data structures and algorithms are needed
• when manipulating large datasets
• under heavy time-constraints
• when all functions are well-defined and slow evolution is expected
Monday, January 16, 12
![Page 54: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/54.jpg)
David Ascher [2]
• Technical “purity” — not pushing X
• Optimising person time, not machine time
• Open source rooted
• Evolution by meritocracy and natural selection
• Platform neutrality
Dynamic languages:
Monday, January 16, 12
![Page 55: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/55.jpg)
Use DYPLs for [2]
• Scripting tasks
• Prototyping
• When needing loose coupling (distributed programs)
• Business logic
Monday, January 16, 12
![Page 56: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/56.jpg)
Don’t use DYPLs [2]
• when you only have a little memory
• for (some) high-performance tasks
Monday, January 16, 12
![Page 57: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/57.jpg)
Myths about DYPLs [2]
• Cannot be used for real applications
• They are brittle
• Cannot be used for large systems
Monday, January 16, 12
![Page 58: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/58.jpg)
Myths about DYPLs [2]
• They are not well-supported
• There are no good tools
• Not fitting for JVM, CLR, etc.
Monday, January 16, 12
![Page 59: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/59.jpg)
Sam Wilmott
• Dynamic programming languages are especially useful for trying out new ideas [3]
Monday, January 16, 12
![Page 60: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/60.jpg)
Static types ok
Semantics ok
Syntax ok
Program text
Monday, January 16, 12
![Page 61: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/61.jpg)
David Ungar
• […] the system gets out of the way, and the true creative abilities of your users are let loose to make magic. That's why I believe in dynamic languages. [4]
Monday, January 16, 12
![Page 62: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/62.jpg)
Bruce Tate [12]
• The change from Java to the “next language” is imminent
• Ruby is a likely candidate
• DYPLs rarely need things like AOP
• Java was once like kayaking
Monday, January 16, 12
![Page 63: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/63.jpg)
Will DYPLs ever be mainstream?
Monday, January 16, 12
![Page 64: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/64.jpg)
Some that made it
• (LISP)
• (Smalltalk)
• JavaScript
• Perl
• PHP
Monday, January 16, 12
![Page 65: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/65.jpg)
Growing Support
Monday, January 16, 12
![Page 66: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/66.jpg)
Bye to system PLs?
• Who needs C/C++ anymore?
• JVM is the new OS
Monday, January 16, 12
![Page 67: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/67.jpg)
Programmers were reluctant to move to macro assembler
Monday, January 16, 12
![Page 68: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/68.jpg)
O
n
Questions?
Monday, January 16, 12
![Page 69: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/69.jpg)
Monday, January 16, 12
![Page 70: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/70.jpg)
O
n
The End
Monday, January 16, 12
![Page 71: DYPL - people.dsv.su.sebeatrice/DYPL_12/L1_DYPL_VT12_4pp.pdf · Exam • “Take-home” exam • Might be combination of theoretical and practical problems • Example questions](https://reader033.vdocuments.us/reader033/viewer/2022060421/5f1862c51e23f540c152a4d7/html5/thumbnails/71.jpg)
References[1] John K. Ousterhout, Scripting: Higher Level Programming for the 21st Century
[2] David Ascher, Dynamic Languages, Ready for the Next Challenges, by Design
[3] Sam Wilmott, When Is A Dynamic Programming Language Not Dynamic
[4] David Ungar, Why I believe in dynamic languages
[11] Lutz Prechelt, An empirical comparison of C, C++, Java, Perl, Python, Rexx, and Tcl for a search/string-processing program
[12] Bruce Tate, Beyond Java
(Reference numbers corresponds to number in Article Index on the course’s web page)
Monday, January 16, 12