LiveCodeLab*2.0*and*its*language* LiveCodeLang* ! ! - - PowerPoint PPT Presentation

livecodelab 2 0 and its language livecodelang davide
SMART_READER_LITE
LIVE PREVIEW

LiveCodeLab*2.0*and*its*language* LiveCodeLang* ! ! - - PowerPoint PPT Presentation

LiveCodeLab*2.0*and*its*language* LiveCodeLang* ! ! Davide'Della'Casa,'Guy'John' What!is!LiveCodeLab! dive3in'quick'demo' Processing,!Casey!+!Reas! ! ! Jsaxus,!Jonathan!Brodsky! ! ! Fluxus,!David!Griffiths! ! ! Flaxus,!


slide-1
SLIDE 1

LiveCodeLab*2.0*and*its*language* LiveCodeLang*! ! Davide'Della'Casa,'Guy'John'

slide-2
SLIDE 2

What!is!LiveCodeLab! dive3in'quick'demo'

slide-3
SLIDE 3

Processing,!Casey!+!Reas! ! ! Jsaxus,!Jonathan!Brodsky! ! ! Fluxus,!David!Griffiths! ! ! Flaxus,! Ivanoff!+!Jimenez!!

slide-4
SLIDE 4

Core*values* ! 1)!learnability! 2)!usability! !! simple'syntax,'simple'commands' keywords,'short'programs,' immediate'feedback'and'quick' interac@on'

slide-5
SLIDE 5

box // draws a box
 ! eliminate!parentheses!for!funcKon! invocaKon! ! (there!is!such!a!thing!as!a!funcKon! invocaKon!with!no!arguments!)!

slide-6
SLIDE 6

fill red
 box
 ! freely!use!140!CSS!colour!literals!

slide-7
SLIDE 7

if random > 0.5
 box
 else
 peg! ! Making!use!of!indentaKon!as!a! help!to!avoid!parentheses,!braces! and!semicolons.!

slide-8
SLIDE 8

rotate // affects the box
 "box 
 peg
 !! Making!use!of!indentaKon!as!to! define!the!scope!of!graphics!state! changes.!

slide-9
SLIDE 9

red // instead of “fill red”
 box
 ! Providing!several!shorthands!for! state!changes!in!many!cirU! cumstances.!!

slide-10
SLIDE 10

rotate red box
 peg 
 ! MulKple!instrucKons!can!be! generally!inlined!(which!limits!the! scope)!!

slide-11
SLIDE 11

either = (a,b) ->
 "if random > 0.5 then run a else run b 
 
 either <box>, <peg>



 ! “<>”!notaKon!for!inlined!anonymous!funcKons,!! “run”!is!then!used!to!actually!evaluate!the!passed!funcKons!!

slide-12
SLIDE 12

above = <move 0,-0.5,0>
 box above ball above peg
 
 
 flashing = <if random < 0.5 then scale 0>
 flashing ball
 peg // peg doesn’t flash 
 
 


users!can!invent!their!own!DSLs!"

slide-13
SLIDE 13

How!does!it!work:!translaKon!to! coffeescript!

"

" rotate fill red box



 " …becomes!(“Nested!Closure”!pa^ern):! "

" rotate (-> fill red, (->box())"

slide-14
SLIDE 14

Problems!1/4!

Current!transformaKons!are!based!on!regex! matchers:!nested!cases!not!handled!well.! ! Some!transformaKons!depend!on!actual!literals! used!(e.g.!for!colours!and!colour!funcKons).!

slide-15
SLIDE 15

Problems!2/4!

Some!simple!code!sKll!requires!some!explanaKon:! ! 2 times rotate box" " (why!not!clearly!two!boxes?)!

slide-16
SLIDE 16

Problems!3/4!

Some!understanding!needed!of!difference!between! expressions/values!(something!you!calculate/have)!and! commands!(something!you!do#and#accepts#further#func/ons# as#arguments):! !

something = red" rotate fill something box" ! …vs:! ! something = <peg>" rotate fill red something"

slide-17
SLIDE 17

Problems!4/4!

Three!ways!to!assign!things!and!they!mean!subtly!different!things:! !

something = red" rotate fill something box" ! …vs:! ! something = <peg>" rotate fill red something" " …vs:! " something = -> peg()" rotate fill red, -> something"

slide-18
SLIDE 18
slide-19
SLIDE 19
slide-20
SLIDE 20
slide-21
SLIDE 21
slide-22
SLIDE 22
slide-23
SLIDE 23
slide-24
SLIDE 24

move%&3,%1% 10%+mes%with%x% %10%+mes%with%y% % %move%x,%&y,%0% % % %box%0.7%

slide-25
SLIDE 25
slide-26
SLIDE 26
slide-27
SLIDE 27
slide-28
SLIDE 28
slide-29
SLIDE 29
slide-30
SLIDE 30