the moby scheme compiler for smartphones (is that a parenthesis in your pocket?) danny yoo zhe zhang...
TRANSCRIPT
![Page 1: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/1.jpg)
The Moby Scheme Compiler
for Smartphones(Is That a Parenthesis in Your
Pocket?)
Danny YooZhe ZhangKathi Fisler
Shriram Krishnamurthi
![Page 2: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/2.jpg)
![Page 3: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/3.jpg)
Vital Statistics
Middle-school, after-school programming courseAll teaching by volunteers
Nearly 300 students (average age: 11y9m)24% female; 70% reporting race are minority;
70% on free or reduced-price lunch
Greater Boston, Bay Area, Austin, New York City
![Page 4: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/4.jpg)
![Page 5: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/5.jpg)
Bad News
The reason they’re smilingisn’t the parentheses
![Page 6: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/6.jpg)
![Page 7: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/7.jpg)
Program = Design + Programming System + Execution Model
![Page 8: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/8.jpg)
Program Execution Model
![Page 9: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/9.jpg)
Pascal
![Page 10: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/10.jpg)
“Pascal is for building pyramids—imposing, breathtaking, static structures built by armies pushing heavy blocks into place. […] In Pascal the plethora of declarable data structures induces a specialization within functions that inhibits and penalizes casual cooperation.”
—Alan Perlis
“Pascal is part of the same machinery as hall passes, dress codes, advisors’ signatures, single-sex dorms, and so on.”
—Brian Harvey
![Page 11: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/11.jpg)
begin
…
end;
begin
…
…
end;
begin
…
…
…
end;
begin
…
…
end;
begin
…
…
…
…
…
…
…
…
…
…
end;
begin
…
…
…
…
…
…
…
…
…
…
…
…
end..begin
…
end;
![Page 12: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/12.jpg)
flights from PVD to CDG
list of flights
the third outward flight
restricted list of return flights
the second return flight
ok
must remember list of flights
must rememb
er restricted list of return flights
![Page 13: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/13.jpg)
user typed ‘(’
ok
user moved mouse
ok
user clicked mouse button
ok
differentkinds ofhandlers
![Page 14: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/14.jpg)
user moved right 10 yards
ok
user tilted phone left
ok
user moved left 10 yards
ok
loc: (10,0)
loc: (0,0)
loc: (10,0)
loc: (10,0)
loc: (0,0)
loc: (10,0)
![Page 15: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/15.jpg)
void
void
void
![Page 16: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/16.jpg)
database,memory store,remoteWebservice
![Page 17: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/17.jpg)
database, hidden fields,cont’ns
![Page 18: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/18.jpg)
Why is this Bad?
![Page 19: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/19.jpg)
What good are functions from
high-school algebra?
![Page 20: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/20.jpg)
A LISP programmer knows the value of everything, […]
—Alan Perlis
You’ve disappointed Alan Perlis.
![Page 21: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/21.jpg)
2006 PISA scores: USA not in top 20 in math, science, or reading
“Economic Time Bomb”—June Kronholz, WSJ
![Page 22: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/22.jpg)
void
void
void
Why void?
The hostileoperatingsystem
Why hostile?
Becauseit’s neutral
Butneutrality
hostility
Neutrals can cooperate
(impartially)
![Page 23: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/23.jpg)
User
OS
Callback
“World”
“World”
“World”
“World”
![Page 24: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/24.jpg)
Current value of World
New value of World
Might be enriched with
additional event
information
Phone example: World is current location
Will invoke event-specific
functions
(define (on-move w d) (posn+ w d))
(define (on-tilt w o) w)
![Page 25: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/25.jpg)
on-tick :: w w
on-move :: w dist w
on-tilt :: w incl w
on-key :: w key w
on-click :: w btn w
on-redraw :: w scene
stop-when :: w bool
![Page 26: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/26.jpg)
![Page 27: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/27.jpg)
(define width 400)(define height 300)
(define initial-world 0)
(define PLANE )
(define (incr-time w) (add1 w))
(define (render-world w) (place-image PLANE (* w 10) (image-height PLANE) (empty-scene width height)))
(big-bang width height 1/10
(on-tick incr-time)
(on-redraw render-world))
![Page 28: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/28.jpg)
World
World
Scene
World
World
World
![Page 29: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/29.jpg)
World
World
Scene
World
World
Bool
![Page 30: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/30.jpg)
Moby
![Page 31: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/31.jpg)
What It’s Not
A “Scheme compiler for smartphones”
![Page 32: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/32.jpg)
What It Is
Compiles programs written in
Scheme (Beginner Scheme, for now)+World
Currently for Android, partially for J2ME
![Page 33: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/33.jpg)
A Little More
Scheme (Beginner Scheme, for now)+World+ GPS+ Tilt+ GUI-World + Rudimentary Web Services
![Page 34: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/34.jpg)
Baseline
All student programs will run on phone*
* A little legalese elided
![Page 35: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/35.jpg)
Rolling Out of Time
![Page 36: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/36.jpg)
![Page 37: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/37.jpg)
![Page 38: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/38.jpg)
(define WIDTH 300)(define HEIGHT 300)
(define-struct vel (x y))
(define target (make-posn (random WIDTH) …))
(define-struct world (posn r vel))
(define initial-w (make-world (make-posn …) 30 (make-vel 0 0)))
;; game-ends?: world -> boolean
(define (game-ends? w)(or (<= (world-r w) 1) (collide? w)))
![Page 39: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/39.jpg)
;; tick: world -> world
(define (tick w)(make-world (posn+vel (world-posn w) (world-vel w)) (- (world-r w) 1/3) (world-vel w)))
;; tilt: world number number number -> world
(define (tilt w azimuth pitch roll)(make-world (world-posn w) (world-r w) (make-vel roll (- pitch))))
(big-bang WIDTH HEIGHT 1/20 initial-w (on-redraw render) (on-tick tick) (on-tilt tilt) (stop-when game-ends?))
(define (tilt w azimuth pitch roll) (update-world-vel w (make-vel roll (- pitch))))
![Page 40: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/40.jpg)
Minding the Store
![Page 41: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/41.jpg)
![Page 42: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/42.jpg)
(define mymaps-url"http://maps.google.com/maps/ms?ie=UTF8&...&msid=...")
(define ALL-PLACES(parse-places (parse-xml (get-url mymaps-url))))
(define ALL-ITEMS …)
(big-bang ... (on-redraw render) (on-location-change update-loc))
;; update-loc: world number number -> world
(define (update-loc w lat long)
(make-loc lat long))
![Page 43: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/43.jpg)
;; render: world -> scene
(define (render w)... (description w) ...)
;; description: world -> string
(define (description w)(items->string (matching-items-nearby w)))
;; matching-items-nearby: world -> (listof item)
(define (matching-items-nearby w)(places-matching-items (nearby-places ALL-PLACES w)))
![Page 44: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/44.jpg)
Homeward Bound
![Page 45: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/45.jpg)
![Page 46: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/46.jpg)
![Page 47: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/47.jpg)
The World is Not Enough
![Page 48: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/48.jpg)
Parallelism/ConcurrencyIn-place updates
“Safe at any speed”—John Jannotti
Universe for distributed computing
Moore versus Mealy
![Page 49: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/49.jpg)
On the Internet, nobody knows
you’re aScheme program
JavaScript
Java
Processing
J2ME
Flash/
ActionScri
pt
Objective-CNXTNXCRobotC
BricxCC
DesignProgramming systemExecution model
{
![Page 50: The Moby Scheme Compiler for Smartphones (Is That a Parenthesis in Your Pocket?) Danny Yoo Zhe Zhang Kathi Fisler Shriram Krishnamurthi](https://reader030.vdocument.in/reader030/viewer/2022032517/56649cb95503460f94980d64/html5/thumbnails/50.jpg)
Port Moby! [email protected]
Teach Bootstrap!www.bootstrapworld.org
Thanks:
Danny YooZhe ZhangKathi Fisler
Emmanuel SchanzerMatthias Felleisen(rest )