Final slides for Ruby.mn talk

db4
Slava Pestov 2008-01-29 00:39:04 -06:00
parent 55fee86717
commit 44de7d5883
2 changed files with 65 additions and 32 deletions

View File

@ -1,5 +1,5 @@
USING: slides help.markup math arrays hashtables namespaces USING: slides help.markup math arrays hashtables namespaces
sequences kernel sequences parser ; sequences kernel sequences parser memoize ;
IN: minneapolis-talk IN: minneapolis-talk
: minneapolis-slides : minneapolis-slides
@ -17,13 +17,14 @@ IN: minneapolis-talk
"Words: named functions, classes, variables" "Words: named functions, classes, variables"
"Combinators: higher-order functions" "Combinators: higher-order functions"
"Quotations: anonymous functions" "Quotations: anonymous functions"
"Other concepts are familiar: classes, objects, etc"
} }
{ $slide "Stack-based programming" { $slide "Stack-based programming"
{ "Most languages are " { $emphasis "applicative" } } { "Most languages are " { $emphasis "applicative" } }
"Words pop inputs from the stack and push outputs on the stack" "Words pop inputs from the stack and push outputs on the stack"
"Literals are pushed on the stack" "Literals are pushed on the stack"
{ $code "{ 1 2 } { 7 } append reverse sum ." } { $code "{ 1 2 } { 7 } append reverse sum ." }
}
{ $slide "Stack-based programming"
"With the stack you can omit unnecessary names" "With the stack you can omit unnecessary names"
"You can still name things: lexical/dynamic variables, sequences, associations, objects, ..." "You can still name things: lexical/dynamic variables, sequences, associations, objects, ..."
} }
@ -37,47 +38,64 @@ IN: minneapolis-talk
{ $code "{ 3 1 3 3 7 } 5 [ + ] curry map ." } { $code "{ 3 1 3 3 7 } 5 [ + ] curry map ." }
} }
{ $slide "Word definitions" { $slide "Word definitions"
{ $code ": name ( inputs -- outputs ) definition ;" } { $code ": name ( inputs -- outputs )"
" definition ;" }
"Stack effect comments document stack inputs and outputs." "Stack effect comments document stack inputs and outputs."
"Example from previous slide:" "Example from previous slide:"
{ $code ": add-each ( seq n -- newseq ) [ + ] curry map ;" } { $code ": add-each ( seq n -- newseq )"
{ $code "{ 3 1 3 3 7 } add-each ." } " [ + ] curry map ;" }
"Copy and paste factoring" { $code "{ 3 1 3 3 7 } 5 add-each ." }
} }
{ $slide "Object-oriented programming" { $slide "Object-oriented programming"
"Define a tuple class and a constructor:" { "Define a tuple class and a constructor:"
{ $code { $code
"TUPLE: person name address ;" "TUPLE: person name address ;"
"C: <person> person" "C: <person> person"
} }
{ "Create an instance:"
{ $code
"\"Cosmo Kramer\""
"\"100 Blah blah St, New York\""
"<person>"
} }
} }
"Create an instance:" { $slide "Object-oriented programming"
{ $code "\"Cosmo Kramer\" \"100 Blah blah St, New York\" <person>" } "We can inspect it and edit objects"
"We can inspect it and edit it" "We can reshape the class!"
"We can reshape the class:" { $code "TUPLE: person" "name address age phone-number ;" }
{ $code "TUPLE: person name address age phone-number ;" } { $code "TUPLE: person" "name address phone-number age ;" }
{ $code "TUPLE: person name address phone-number age ;" }
} }
STRIP-TEASE: { $slide "An example"
$slide "Primary school geometry recap"
{ $code { $code
"TUPLE: square dimension ;" "TUPLE: square dimension ;"
"TUPLE: circle radius ;" "C: <square> square"
"TUPLE: rectangle width height ;"
"" ""
"TUPLE: circle radius ;"
"C: <circle> circle"
""
"TUPLE: rectangle width height ;"
"C: <rectangle> rectangle"
}
}
STRIP-TEASE:
$slide "An example"
{ $code
"USE: math.constants"
"GENERIC: area ( shape -- meters^2 )" "GENERIC: area ( shape -- meters^2 )"
"M: square area square-dimension sq ;" "M: square area square-dimension sq ;"
"M: circle area circle-radius sq pi * ;" "M: circle area circle-radius sq pi * ;"
"M: rectangle area" "M: rectangle area"
" { rectangle-width rectangle-height } get-slots * ;" " dup rectangle-width"
" swap rectangle-height * ;"
} }
; ;
{ $slide "Geometry example" { $slide "An example"
{ $code "10 <square> area ." } { $code "10 <square> area ." }
{ $code "18 <circle> area ." } { $code "18 <circle> area ." }
{ $code "20 40 <rectangle> area ." } { $code "20 40 <rectangle> area ." }
} }
{ $slide "Factor: a meta language" { $slide "Meta language"
"Here's fibonacci:" "Here's fibonacci:"
{ $code { $code
": fib ( x -- y )" ": fib ( x -- y )"
@ -87,7 +105,7 @@ IN: minneapolis-talk
} }
"It is slow:" "It is slow:"
{ $code { $code
"20 [ fib ] map ." "35 [ fib ] map ."
} }
"Let's profile it!" "Let's profile it!"
} }
@ -96,7 +114,11 @@ IN: minneapolis-talk
"What if we could define a word which caches its results?" "What if we could define a word which caches its results?"
{ "The " { $vocab-link "memoize" } " library provides such a feature" } { "The " { $vocab-link "memoize" } " library provides such a feature" }
{ "Just change " { $link POSTPONE: : } " to " { $link POSTPONE: MEMO: } } { "Just change " { $link POSTPONE: : } " to " { $link POSTPONE: MEMO: } }
}
{ $slide "Memoization"
{ $code { $code
"USE: memoize"
""
"MEMO: fib ( x -- y )" "MEMO: fib ( x -- y )"
" dup 1 > [" " dup 1 > ["
" 1 - dup fib swap 1 - fib +" " 1 - dup fib swap 1 - fib +"
@ -104,7 +126,7 @@ IN: minneapolis-talk
} }
"It is faster:" "It is faster:"
{ $code { $code
"20 [ fib ] map ." "35 [ fib ] map ."
} }
} }
{ $slide "The Factor UI" { $slide "The Factor UI"
@ -114,13 +136,6 @@ IN: minneapolis-talk
"You can call Windows, X11, Cocoa APIs directly too" "You can call Windows, X11, Cocoa APIs directly too"
"OpenGL 2.1 shaders, OpenAL 3D audio..." "OpenGL 2.1 shaders, OpenAL 3D audio..."
} }
{ $slide "Implementation"
"Very small C core"
"Non-optimizing compiler"
"Optimizing compiler"
"Generational garbage collector"
"Non-blocking I/O"
}
{ $slide "Live coding demo" { $slide "Live coding demo"
} }
@ -132,6 +147,24 @@ IN: minneapolis-talk
} }
{ $slide "Live coding demo" { $slide "Live coding demo"
}
{ $slide "Deployment"
{ "Let's play " { $vocab-link "tetris" } }
}
{ $slide "Implementation"
"Portable: Windows, Mac OS X, Linux"
"Non-optimizing compiler"
"Optimizing compiler: x86, x86-64, PowerPC, ARM"
"Generational garbage collector"
"Non-blocking I/O"
}
{ $slide "Some statistics"
"VM: 11,800 lines of C"
"Core library: 22,600 lines of Factor"
"Docs, tests, extra libraries: 117,000 lines of Factor"
}
{ $slide "But wait, there's more!"
"Web server and framework, syntax highlighting, Ogg Theora video, SMTP, embedded Prolog, efficient unboxed arrays, XML, Unicode 5.0, memory mapped files, regular expressions, LDAP, database access, coroutines, Factor->JavaScript compiler, JSON, pattern matching, advanced math, parser generators, serialization, RSS/Atom, ..."
} }
{ $slide "Community" { $slide "Community"
"Factor development began in 2003" "Factor development began in 2003"
@ -140,8 +173,8 @@ IN: minneapolis-talk
{ "Web site: " { $url "http://factorcode.org" } } { "Web site: " { $url "http://factorcode.org" } }
"IRC: #concatenative on irc.freenode.net" "IRC: #concatenative on irc.freenode.net"
"Mailing list: factor-talk@lists.sf.net" "Mailing list: factor-talk@lists.sf.net"
{ "Let's play " { $vocab-link "space-invaders" } }
} }
{ $slide "Questions?" }
} ; } ;
: minneapolis-talk minneapolis-slides slides-window ; : minneapolis-talk minneapolis-slides slides-window ;

2
extra/minneapolis-talk/summary.txt Normal file → Executable file
View File

@ -1 +1 @@
Slides for a talk at Catalyst IT NZ, July 2007 Slides for a talk at Ruby.mn, Minneapolis MN, January 2008