livecodelab 2 0 and its language livecodelang davide
play

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,!


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

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

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

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

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

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

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

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

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

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

  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!!

  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! "

  13. 
 How!does!it!work:!translaKon!to! coffeescript! " " rotate fill red box 
 " …becomes! ( “Nested!Closure”!pa^ern ) :! " " rotate (-> fill red, (->box()) "

  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).!

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

  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 "

  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 "

  18. ������������������ ������� ��� ������������ ������������������������ ������ ��������������������������������� ����������� ������������

  19. ��������������� ����������������

  20. �������������

  21. ���������������������� ��������������������������������������������� ���������������������� � ���������������������� � �������������� � �����

  22. ���������� ������ �������� ��� ���

  23. ����� ����������������������������������������� ������� ��������������� �������� ���

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

  25. ��������������������� ������������������������������������������� ����������������������������� ������������������������������������������� ��������

  26. ����������� ����� ������������������������������������ ������ ����������������������������������� ����� ���������������

  27. ����������� ����������������������� ��������������������������������������������� ���������������������������������

  28. �������� ����������������������������������� ������������������������������������������������ ���������������������������������

  29. �������� ���������������������������� ���������� ������ �������� ���� ���� ��������� ���

  30. ��������������� ���������������������������������������������� ������������������������� ������������������������ �

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend