fine grained language composition
play

Fine-grained language composition Edd Barrett, Carl Friedrich Bolz, - PowerPoint PPT Presentation

Fine-grained language composition Edd Barrett, Carl Friedrich Bolz, Lukas Diekmann, Geoff French, Sarah Mount, Laurence Tratt, Naveneetha Krishnan Vasudevan Software Development Team 2016-01-28 1 / 28 http://soft-dev.org/ Background


  1. Fine-grained language composition Edd Barrett, Carl Friedrich Bolz, Lukas Diekmann, Geoff French, Sarah Mount, Laurence Tratt, Naveneetha Krishnan Vasudevan Software Development Team 2016-01-28 1 / 28 http://soft-dev.org/

  2. Background Background ABCgjy 2 / 28 http://soft-dev.org/

  3. Background Background A perfect programming language 2 / 28 http://soft-dev.org/

  4. Background Background Solution ABCgjy 3 / 28 http://soft-dev.org/

  5. Background Background Solution A new programming language 3 / 28 http://soft-dev.org/

  6. Background Background Reality ABCgjy 3 / 28 http://soft-dev.org/

  7. Background Background Reality Another imperfect programming language 3 / 28 http://soft-dev.org/

  8. What to expect from this talk What to expect from this talk A B 4 / 28 http://soft-dev.org/

  9. What to expect from this talk What to expect from this talk gA ∪ Bg 4 / 28 http://soft-dev.org/

  10. What to expect from this talk What to expect from this talk Python ∪ Prolog 4 / 28 http://soft-dev.org/

  11. What to expect from this talk What to expect from this talk Python ∪ PHP 4 / 28 http://soft-dev.org/

  12. Two levels of challenge Two levels of challenge Tooling 5 / 28 http://soft-dev.org/

  13. Two levels of challenge Two levels of challenge Tooling Language friction 5 / 28 http://soft-dev.org/

  14. Tooling challenges Tooling challenges 6 / 28 http://soft-dev.org/

  15. Tooling challenges Tooling challenges Python PyHyp PHP 6 / 28 http://soft-dev.org/

  16. Tooling challenges Tooling challenges syntax Python runtime syntax PyHyp runtime syntax PHP runtime 6 / 28 http://soft-dev.org/

  17. Tooling challenges Tooling challenges syntax Language boxes Python runtime syntax PyHyp runtime syntax PHP runtime 6 / 28 http://soft-dev.org/

  18. Tooling challenges Tooling challenges syntax Language boxes Python runtime syntax PyHyp runtime syntax PHP Composed runtime meta-tracing VMs 6 / 28 http://soft-dev.org/

  19. Parsing: recognising Parsing: recognising 7 / 28 http://soft-dev.org/

  20. Parsing: recognising Parsing: recognising Input: Bill hits Ben 7 / 28 http://soft-dev.org/

  21. Parsing: recognising Parsing: recognising Input: Bill hits Ben Grammar: noun verb noun 7 / 28 http://soft-dev.org/

  22. Parsing: Context-Free Grammars Parsing: Context-Free Grammars Expr ::= Expr ’+’ Term | Term Term ::= Term ’*’ Factor | Factor Factor ::= ’(’ Expr ’)’ | ’INT’ 8 / 28 http://soft-dev.org/

  23. Parsing: Context-Free Grammars Parsing: Context-Free Grammars Expr ::= Expr ’+’ Term | Term Term ::= Term ’*’ Factor | Factor Factor ::= ’(’ Expr ’)’ | ’INT’ 8 / 28 http://soft-dev.org/

  24. Parsing: Context-Free Grammars Parsing: Context-Free Grammars Expr ::= Expr ’+’ Term | Term Term ::= Term ’*’ Factor | Factor Factor ::= ’(’ Expr ’)’ | ’INT’ 8 / 28 http://soft-dev.org/

  25. Parsing: Context-Free Grammars Parsing: Context-Free Grammars Expr ::= Expr ’+’ Term | Term Term ::= Term ’*’ Factor | Factor Factor ::= ’(’ Expr ’)’ | ’INT’ 8 / 28 http://soft-dev.org/

  26. Parsing: Context-Free Grammars Parsing: Context-Free Grammars Expr ::= Expr ’+’ Term | Term Term ::= Term ’*’ Factor | Factor Factor ::= ’(’ Expr ’)’ | ’INT’ 8 / 28 http://soft-dev.org/

  27. Parsing: Trees Parsing: Trees 2 + 3 Expr Expr T erm T erm Factor Factor 3 2 9 / 28 http://soft-dev.org/

  28. Syntax composition Syntax composition PL X <grammar> expr::= ... term::= ... | ... | ... func ::= ... PL Y <program> for (j : js) { doStuff(); } . . . 10 / 28 http://soft-dev.org/

  29. Syntax composition Syntax composition PL X <grammar> expr::= ... term::= ... | ... | ... func ::= ... Parser PL Y <program> for (j : js) { doStuff(); } . . . 10 / 28 http://soft-dev.org/

  30. Syntax composition Syntax composition PL X <grammar> expr::= ... term::= ... | ... | ... func ::= ... Parser PL Y <program> Parse Tree for (j : js) { doStuff(); } . . . 10 / 28 http://soft-dev.org/

  31. Syntax composition Syntax composition PL X <grammar> expr::= ... term::= ... | ... | ... func ::= ... LR PL Y <program> Parse Tree for (j : js) { doStuff(); } . . . 10 / 28 http://soft-dev.org/

  32. Syntax composition Syntax composition PL X <grammar> expr::= ... term::= ... | ... | ... func ::= ... Generalised PL Y <program> Parse Tree for (j : js) { doStuff(); } . . . 10 / 28 http://soft-dev.org/

  33. Syntax composition Syntax composition PL X <grammar> expr::= ... term::= ... | ... | ... func ::= ... PEG PL Y <program> Parse Tree for (j : js) { doStuff(); } . . . 10 / 28 http://soft-dev.org/

  34. The only choice? The only choice? 11 / 28 http://soft-dev.org/

  35. The only choice? The only choice? SDE 11 / 28 http://soft-dev.org/

  36. The challenge The challenge Challenge: SDE’s power + a text editor feel? 12 / 28 http://soft-dev.org/

  37. Eco demo Eco demo 13 / 28 http://soft-dev.org/

  38. Runtime composition Runtime composition 14 / 28 http://soft-dev.org/

  39. Runtime composition Runtime composition PL X PL Y Interpreter Interpreter C/C++ 14 / 28 http://soft-dev.org/

  40. Runtime composition Runtime composition PL X PL Y Too slow Interpreter Interpreter C/C++ 14 / 28 http://soft-dev.org/

  41. Runtime composition Runtime composition JIT Compiler JIT Compiler PL X PL Y Interpreter Interpreter C/C++ 14 / 28 http://soft-dev.org/

  42. Runtime composition Runtime composition JIT Compiler JIT Compiler PL X PL Y Too much engineering Interpreter Interpreter C/C++ 14 / 28 http://soft-dev.org/

  43. Runtime composition Runtime composition PL X PL Y Interpreter Interpreter JVM/CLR JIT Compiler 14 / 28 http://soft-dev.org/

  44. Runtime composition Runtime composition PL X PL Y Semantic mismatch Interpreter Interpreter JVM/CLR JIT Compiler 14 / 28 http://soft-dev.org/

  45. Runtime composition Runtime composition 14 / 28 http://soft-dev.org/

  46. Runtime composition Runtime composition Meta-tracing PL X PL Y PL Z RPython Interpreters Interpreter Tracing JIT Glue 14 / 28 http://soft-dev.org/

  47. Meta-tracing translation with RPython Meta-tracing translation with RPython Interpreter 15 / 28 http://soft-dev.org/

  48. Meta-tracing translation with RPython Meta-tracing translation with RPython Interpreter translator RPython 15 / 28 http://soft-dev.org/

  49. Meta-tracing translation with RPython Meta-tracing translation with RPython Interpreter translator RPython Optimised JIT Interpreter 15 / 28 http://soft-dev.org/

  50. Meta-tracing translation with RPython Meta-tracing translation with RPython Interpreter translator RPython Optimised JIT Interpreter 15 / 28 http://soft-dev.org/

  51. Meta-tracing translation with RPython Meta-tracing translation with RPython Interpreter translator RPython Optimised JIT Interpreter 15 / 28 http://soft-dev.org/

  52. Runtime composition recap Runtime composition recap 16 / 28 http://soft-dev.org/

  53. Runtime composition recap Runtime composition recap Meta-tracing PL X PL Y PL Z RPython Interpreters Interpreter Tracing JIT Glue 16 / 28 http://soft-dev.org/

  54. Runtime composition recap Runtime composition recap Meta-tracing PyPy Hippy RPython PyHyp Interpreters Interpreter Tracing JIT Glue 16 / 28 http://soft-dev.org/

  55. Composed Richards vs. other VMs Composed Richards vs. other VMs Type VM 9.475 ± 0.0127 CPython 2.7.7 4.264 ± 0.0386 HHVM 3.4.0 0.250 ± 0.0008 Mono HippyVM 0.178 ± 0.0006 PyPy 2.4.0 9.070 ± 0.0361 Composed Zend 5.5.13 17 / 28 http://soft-dev.org/

  56. Composed Richards vs. other VMs Composed Richards vs. other VMs Type VM 9.475 ± 0.0127 CPython 2.7.7 4.264 ± 0.0386 HHVM 3.4.0 0.250 ± 0.0008 Mono HippyVM 0.178 ± 0.0006 PyPy 2.4.0 9.070 ± 0.0361 Composed Zend 5.5.13 0.335 ± 0.0012 Composed PyHyp 17 / 28 http://soft-dev.org/

  57. Datatype conversion Datatype conversion PHPRoot PHPObject PHPInt PHPFunc 18 / 28 http://soft-dev.org/

  58. Datatype conversion Datatype conversion PHPRoot PHPObject PHPInt PHPFunc PyRoot PyObject PyInt PyFunc 18 / 28 http://soft-dev.org/

  59. Datatype conversion: primitive types Datatype conversion: primitive types Python PHP 19 / 28 http://soft-dev.org/

  60. Datatype conversion: primitive types Datatype conversion: primitive types Python PHP 2 : PHPInt 19 / 28 http://soft-dev.org/

  61. Datatype conversion: primitive types Datatype conversion: primitive types Python PHP 2 : PyInt 2 : PHPInt 19 / 28 http://soft-dev.org/

  62. Datatype conversion: user types Datatype conversion: user types Python PHP 20 / 28 http://soft-dev.org/

  63. Datatype conversion: user types Datatype conversion: user types Python PHP o : PHPObject 20 / 28 http://soft-dev.org/

  64. Datatype conversion: user types Datatype conversion: user types PyRoot PyObject PyInt PyFunc 20 / 28 http://soft-dev.org/

Recommend


More recommend