lecture-5

lecture-5 - OCaml The PL for the discerning hacker Hello Im...

Info iconThis preview shows pages 1–12. Sign up to view the full content.

View Full Document Right Arrow Icon
OCaml The PL for the discerning hacker.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Hello. I’m Zach, one of Sorin’s students. [email protected]
Background image of page 2
ML Anatomy 101 ML Program = One Giant, Complex Expression Controlling complexity is the essence of computer programming. B. Kerninghan A complex system that works is invariably found to have evolved from a simple system that worked. J. Gall ML Program = ? ? ?
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Building ML Programs ML provides tools to control complexity Build complex exprs from simple exprs Build complex types from simple types PREV NOW
Background image of page 4
Building Types 1. basic (recap) 2. function 3. record 4. variant 5. demo M.C. Escher’s Relativity in LEGO
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
basic Who cares about types anyway? Every good programmer! (not just old timers) Types provide: 1. Documentation 2. Early bug warning system 3. Performance!
Background image of page 6
basic Who cares about types anyway? Even programmers without a type system! I think it may just be a property of large systems in dynamic languages, that eventually you end up rewriting your own type system, and you sort of do it badly. -- Twitter
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
basic Expression Type Kind of Type 5 int basic “hello” string basic (5, “hello”) int * string tuple [1; 2; 3; 4] int list list [ (1, 1) ; (2, 2) ; (3, 3) ] (int * int) list tuple+list
Background image of page 8
more on tuples Expression Type (5, (10, 15)) int * (int * int) ((5, 10), 15) (int * int) * int
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
more on tuples Expression Type (5, (10, 15)) int * (int * int) ((5, 10), 15) (int * int) * int ( [ (1, 2); (3, 4); (5, 6) ] , (“hello”, “ india ”) , (5, “ int ”, (1, 2, 3)) )
Background image of page 10
Expression Type (5, (10, 15)) int * (int * int) ((5, 10), 15) (int * int) * int ( [ (1, 2); (3, 4); (5, 6) ] , (“hello”, “
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 12
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/08/2011 for the course CSE cse130 taught by Professor Cs during the Fall '10 term at UCSD.

Page1 / 46

lecture-5 - OCaml The PL for the discerning hacker Hello Im...

This preview shows document pages 1 - 12. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online