composing the uncomposable
play

Composing the uncomposable Some work, work-in-progress and ideas. - PowerPoint PPT Presentation

Composing the uncomposable Some work, work-in-progress and ideas. Stephen Kell stephen.kell@cs.ox.ac.uk Composing. . . p.1/68 Theres something about software... Software is expensive and inflexible . Tools assume: ground-up


  1. Composing the uncomposable Some work, work-in-progress and ideas. Stephen Kell stephen.kell@cs.ox.ac.uk Composing. . . – p.1/68

  2. There’s something about software... Software is expensive and inflexible . Tools assume: � ground-up � perfect fit � homogeneous � never change, never replace Reality: none of the above! Composing. . . – p.2/68

  3. Outline � the Cake language � interface styles � DwarfPython � interface hiding Composing. . . – p.3/68

  4. Outline Apology � the Cake language � interface styles � DwarfPython � interface hiding Composing. . . – p.3/68

  5. A problem A B These programming tasks arise: � as software evolves � as new user requirements emerge � as software ecosystem evolves � e.g. alternative components become available Composing. . . – p.4/68

  6. Cake in one slide Cake is a tool for tasks like these. It is: � a rule-based language � ... for describing adapters � declarative � black-box � convenient Composing. . . – p.5/68

  7. Common approaches ������������� A A′ B ����������� A B glue code B ����������������� A′′ Composing. . . – p.6/68

  8. Overview ���� ����� ���� ���� ���� ���� ������� ���������� ������� A �� ��� exists elf reloc (”A.o”) A; // assume that object files... exists elf reloc (”B.o”) B; // ... contain debug info derive elf reloc (”whole.o”) = link [A, B] { / ∗ your rules here! ∗ / } ; Composing. . . – p.7/68

  9. Interlude: linking Composing. . . – p.8/68

  10. Simple adaptations ����� ����� � B foo (...) ← → bar (...); Composing. . . – p.9/68

  11. Simple adaptations ����� ����� �������� �������� � � foo (...) ← → bar (...); baz(a, b) ← → baz(b, a); Composing. . . – p.9/68

  12. Simple adaptations ����� ����� �������� �������� ������ ��������� � � foo (...) ← → bar (...); baz(a, b) ← → baz(b, a); xyz(a) ← → xyz(a, 42); Composing. . . – p.9/68

  13. Simple adaptations ����� ����� �������� �������� ������ ��������� � � ��������� ��������� foo (...) ← → bar (...); baz(a, b) ← → baz(b, a); xyz(a) ← → xyz(a, 42); values Br ← → Tr Composing. . . – p.9/68

  14. Simple adaptations ����� ����� �������� �������� ������ ��������� � � ��������� ��������� ����������� ������������ foo (...) ← → bar (...); baz(a, b) ← → baz(b, a); xyz(a) ← → xyz(a, 42); values Br ← → Tr { sz ← → len; } ; The Cake compiler generates wrapper functions from rules. Composing. . . – p.9/68

  15. More complex adaptations ���������������������������� �������������������������� ������������� ��������������� ������������������ �������������� Real interfaces ������������������� ������� ��������������������������� ������������������������������ correspond less simply: ��������� ���������������� ������������������������ ������� ��������������������������� � non-1-to-1 mappings ��������������������������� ����������������� ��������� � context-sensitive ��������������� ������� ������������ ����������������������� ����� ���������������������� ��������������������������� � data, not just code ���������������������������� ������������������������������� ������������������������ ������������������������ �������������� ������������������������ ������������������������ ������ ������������������������ ������������������������ ��������������� ������������ ��������������� ����������� ���� ��� ���������������� �������������� �������� ��������� ���������������������� Composing. . . – p.10/68

  16. Many-to-many mappings ����������� ������������ ������������ ���������������� �������� ����� ������ ������������� �������������� ������������ ������������ ��� !" ������������� �� values (dec: mpeg2 dec s, info: mpeg2 info s, seq: mpeg2 sequence s, fbuf: mpeg2 fbuf s) Composing. . . – p.11/68

  17. Many-to-many mappings ����������� ������������ ��&����� ������� ����� ������������ ���������������� �������� �������������� ��%��(�� ����� ��'� ������ ������������� ���������� �������� �������������� ������� ������������ ������������ ��� !" ������������� ����� ������'� +" ������ ���� +" �� values (dec: mpeg2 dec s, info: mpeg2 info s, seq: mpeg2 sequence s, fbuf: mpeg2 fbuf s) ← → ( ctxt : AVCodecContext, vid idx: int, frame: AVFrame, p: AVPacket, s: AVStream, codec: AVCodec) Composing. . . – p.11/68

  18. Many-to-many mappings ����������� ������������ ��&����� ������� ����� ������������ ���������������� �������� �������������� ��%��(�� ����� ��'� ������ ������������� ���������� �������� �������������� ������� ������������ ������������ ��� !" ������������� ����� ������'� +" ������ ���� +" �� values (dec: mpeg2 dec s, info: mpeg2 info s, seq: mpeg2 sequence s, fbuf: mpeg2 fbuf s) ← → ( ctxt : AVCodecContext, vid idx: int, frame: AVFrame, p: AVPacket, s: AVStream, codec: AVCodec) { seq.width ← → ctxt.width ; } Composing. . . – p.11/68

  19. Many-to-many mappings ����������� ������������ ��&����� ������� ����� ������������ ���������������� �������� �������������� ��%��(�� ����� ��'� ������ ������������� ���������� �������� �������������� ������� ������������ ������������ ��� !" ������������� ����� ������'� +" ������ ���� +" �� values (dec: mpeg2 dec s, info: mpeg2 info s, seq: mpeg2 sequence s, fbuf: mpeg2 fbuf s) ← → ( ctxt : AVCodecContext, vid idx: int, frame: AVFrame, p: AVPacket, s: AVStream, codec: AVCodec) { seq.width ← → ctxt.width ; seq.display width ← → frame.linesize [0]; } / ∗ ← − - more rules go here... ∗ / Composing. . . – p.11/68

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