SlideShare une entreprise Scribd logo
1  sur  21
Télécharger pour lire hors ligne
Créativité, contraintes
   et paradigmes

        (ça tape non ?)


            Raphaël Bellec
Péréc, Queneau, Racine



  Quel rapport avec
   l’informatique ?
Question :
Qu’est-ce que c’est ?
La page blanche
L’espace vide à remplir


Amie de la créativité ?
A l’inverse...




Developpe publiquement
des trésors de créativité...
La contrainte ?

• Fixer un élément de la forme
 • Un bras figé
 • Des alexandrins
• Laisser le fond se construire l’idée venant.
Livre : Element du monoïde libre
composé sur l’alphabet et contraint par la
     langue et les choix d’écriture



 Contrainte : limitation de l’espace des
  solutions, intrisequement continu et
 infini, lui donnant des points d’entrées
retournons vers le code
Une autre forme de poésie...
parfois completement
 for my $passion (@to_terminate)
 {
     map {my $body} ($through and $through);
     shift @me,'oh'..'so close to you!';
 }
 listen 'closer',$_ foreach $breath;
 kill $me,'with that little death';
 "What's the meaning of this rhyme"?
 'You will come to learn in' : time;
 if (our $little_code) {'is_run'};
 'Then the two'. $will_be.'as',
 1;
Un programme

• La représentation d’un monde...
• Progressant à l’image de notre pensée...
• Influencée par le langage et surtout...
• Son paradigme
Les paradigmes
•   Objet : Héritage,          •   Typé algebriquement :
    hiérarchie                     types, nature des
                                   habitants du monde
•   Fonctionnel : opérations
    unitaires, structure       •   Logique : relation entre
                                   les éléments, faits, règles.
•   // : op simultannées,
    communication,             •   Lazy - pure : monde pur,
    synchronisation                monde exterieur impur,
                                   structures infinies
•   Systemes Experts :
    regles, ontologie, faits   •   Par contraintes

                               •   Brainfuck : > + .
qsort [] = []                                                                 GENERIC INTERFACE ArraySort(Elem);
                                                                               
                                                                              PROCEDURE Sort(VAR a: ARRAY OF Elem.T; cmp := Elem.Compare);



qsort (x:xs) = qsort ys ++ x : qsort zs where (ys, zs) = partition (< x) xs
                                                                               
                                                                              END ArraySort.
                                                                              GENERIC MODULE ArraySort (Elem);
                                                                               
                                                                              PROCEDURE Sort (VAR a: ARRAY OF Elem.T; cmp := Elem.Compare) =
                                                                                BEGIN
                                                                                   QuickSort (a, 0, NUMBER (a), cmp);
                                                                                   InsertionSort (a, 0, NUMBER (a), cmp);
                                                                                END Sort;
                                                                               
                                                                              PROCEDURE QuickSort (VAR a: ARRAY OF Elem.T; lo, hi: INTEGER;
                                                                                                     cmp := Elem.Compare) =
                                                                                CONST CutOff = 9;
                                                                                VAR i, j: INTEGER; key, tmp: Elem.T;
                                                                                BEGIN
                                                                                   WHILE (hi - lo > CutOff) DO (* sort a[lo..hi) *)
                                                                               
                                                                                     (* use median-of-3 to select a key *)
                                                                                     i := (hi + lo) DIV 2;
                                                                                     IF cmp (a[lo], a[i]) < 0 THEN
                                                                                        IF cmp (a[i], a[hi-1]) < 0 THEN
                                                                                          key := a[i];
                                                                                        ELSIF cmp (a[lo], a[hi-1]) < 0 THEN
                                                                                          key := a[hi-1]; a[hi-1] := a[i]; a[i] := key;
                                                                                        ELSE
                                                                                          key := a[lo]; a[lo] := a[hi-1]; a[hi-1] := a[i]; a[i] :=
                                                                              key;
                                                                                        END;
                                                                                     ELSE (* a[lo] >= a[i] *)
                                                                                        IF cmp (a[hi-1], a[i]) < 0 THEN
                                                                                          key := a[i]; tmp := a[hi-1]; a[hi-1] := a[lo]; a[lo] :=
                                                                              tmp;
                                                                                        ELSIF cmp (a[lo], a[hi-1]) < 0 THEN
                                                                                          key := a[lo]; a[lo] := a[i]; a[i] := key;
                                                                                        ELSE
                                                                                          key := a[hi-1]; a[hi-1] := a[lo]; a[lo] := a[i]; a[i] :=
                                                                              key;
                                                                                        END;
                                                                                     END;
                                                                               
                                                                                     (* partition the array *)
                                                                                     i := lo+1; j := hi-2;
                                                                               
                                                                                     (* find the first hole *)
                                                                                     WHILE cmp (a[j], key) > 0 DO DEC (j) END;
                                                                                     tmp := a[j];
                                                                                     DEC (j);
                                                                               
                                                                                     LOOP
                                                                                        IF (i > j) THEN EXIT END;
                                                                               
                                                                                        WHILE i < hi AND cmp (a[i], key) < 0 DO INC (i) END;
                                                                                        IF (i > j) THEN EXIT END;
                                                                                        a[j+1] := a[i];
                                                                                        INC (i);
                                                                               
                                                                                        WHILE j > lo AND cmp (a[j], key) > 0 DO DEC (j) END;
                                                                                        IF (i > j) THEN IF (j = i-1) THEN DEC (j) END; EXIT END;



qsort( [], [] ).
                                                                                        a[i-1] := a[j];
                                                                                        DEC (j);
                                                                                     END;
                                                                               



qsort( [H|U], S ) :- splitBy(H, U, L, R), qsort(L, SL), qsort(R, SR),
                                                                                     (* fill in the last hole *)
                                                                                     a[j+1] := tmp;
                                                                                     i := j+2;
                                                                               
                                                                                     (* then, recursively sort the smaller subfile *)



append(SL, [H|SR], S).
                                                                                     IF (i - lo < hi - i)
                                                                                        THEN QuickSort (a, lo, i-1, cmp);    lo := i;
                                                                                        ELSE QuickSort (a, i, hi, cmp);      hi := i-1;
                                                                                     END;
                                                                               
                                                                                   END; (* WHILE (hi-lo > CutOff) *)
                                                                                END QuickSort;
                                                                               
                                                                              PROCEDURE InsertionSort (VAR a: ARRAY OF Elem.T; lo, hi: INTEGER;



% splitBy( H, U, LS, RS )
                                                                                                         cmp := Elem.Compare) =
                                                                                VAR j: INTEGER; key: Elem.T;
                                                                                BEGIN
                                                                                   FOR i := lo+1 TO hi-1 DO
                                                                                     key := a[i];



% True if LS = { L in U | L <= H }; RS = { R in U | R > H }
                                                                                     j := i-1;
                                                                                     WHILE (j >= lo) AND cmp (key, a[j]) < 0 DO
                                                                                        a[j+1] := a[j];
                                                                                        DEC (j);
                                                                                     END;



splitBy( _, [], [], []).
                                                                                     a[j+1] := key;
                                                                                   END;
                                                                                END InsertionSort;
                                                                               



splitBy( H, [U|T], [U|LS], RS ) :- U =< H, splitBy(H, T, LS, RS).
                                                                              BEGIN
                                                                              END ArraySort.




splitBy( H, [U|T], LS, [U|RS] ) :- U > H, splitBy(H, T, LS, RS).
L’interêt

• Pas dans le langage ! Ni les Frameworks
• Comprendre une nouvelle façon de penser
• Difficile et prend (un peu de temps)
Ma liste...
•   C                     •   Erlang

•   Ruby (faillotage)     •   Un S.E.

•   XSLT                  •   Contraintes (Oz, Prolog,
                              minion, Gecode...)
•   SQL
                          •   Plus tard : Haskell
•   CAML
                          •   Pour comprendre
•   Scheme                    vraiment (ou pas !) :
                              Coq
•   Prolog
Références
•   Pour les livres, j’ai laissé la couverture complète.

•   Poeme l’oeuf, voir : http://www.digitalcraft.org/iloveyou/
    poetry.htm

•   Feuille d’impot : Formulaire cerfa, auteur inconnu et souhaitant
    probablement rester anonyme.

•   Je n’arrive pas à remettre la main sur les références du poème
    informatique «Paradigm». Toute aide est la bienvenue !

•   Poème en PERL : http://www.perlmonks.org/?node_id=963133

•   Codes sources : voir rosetta code.
Notes importantes
• J’ai placé des langages pour exemple. Le
  plus important est le paradigme et il n’est
  pas toujours lié au langage.
• Plusieurs personnes m’ont dit detester
  XSLT lors de la conf. Je ne préconise pas de
  l’utiliser non plus... juste de l’avoir vu et
  surtout vu Xpath et XQuery.

Contenu connexe

En vedette

Marys prayer (aug)dec10
Marys prayer (aug)dec10Marys prayer (aug)dec10
Marys prayer (aug)dec10@markheybo
 
Final blessing june 2012
Final blessing june 2012Final blessing june 2012
Final blessing june 2012@markheybo
 
Border problems
Border problems Border problems
Border problems guest0a689f
 
Lake Mendota Winter Hike
Lake Mendota Winter HikeLake Mendota Winter Hike
Lake Mendota Winter Hikeguestc39a598d
 
Prayer Spaces Training Day London 2013 Closing Devotion Slides to accompany l...
Prayer Spaces Training Day London 2013 Closing Devotion Slides to accompany l...Prayer Spaces Training Day London 2013 Closing Devotion Slides to accompany l...
Prayer Spaces Training Day London 2013 Closing Devotion Slides to accompany l...@markheybo
 
Fresh Expressions Rural Vision Day March 2012 Diocese of Norwich
Fresh Expressions Rural Vision Day March 2012 Diocese of NorwichFresh Expressions Rural Vision Day March 2012 Diocese of Norwich
Fresh Expressions Rural Vision Day March 2012 Diocese of Norwich@markheybo
 
Investor Group Brochure
Investor  Group  BrochureInvestor  Group  Brochure
Investor Group BrochurePeter Tonkin
 
Hollywood to Holy Orders
Hollywood to Holy OrdersHollywood to Holy Orders
Hollywood to Holy Orders@markheybo
 
Are you tired? Reading
Are you tired? ReadingAre you tired? Reading
Are you tired? Reading@markheybo
 
WebRaize.com - Invite Participants
WebRaize.com - Invite ParticipantsWebRaize.com - Invite Participants
WebRaize.com - Invite ParticipantsWebraize
 
Pause absorb live opening loop
Pause absorb live opening loopPause absorb live opening loop
Pause absorb live opening loop@markheybo
 
Families of prisoners what can i do
Families of prisoners   what can i doFamilies of prisoners   what can i do
Families of prisoners what can i do@markheybo
 
Opening Devotion YMCA Norfolk 2013
Opening Devotion YMCA Norfolk 2013Opening Devotion YMCA Norfolk 2013
Opening Devotion YMCA Norfolk 2013@markheybo
 

En vedette (17)

Marys prayer (aug)dec10
Marys prayer (aug)dec10Marys prayer (aug)dec10
Marys prayer (aug)dec10
 
Final blessing june 2012
Final blessing june 2012Final blessing june 2012
Final blessing june 2012
 
Border problems
Border problems Border problems
Border problems
 
Lake Mendota Winter Hike
Lake Mendota Winter HikeLake Mendota Winter Hike
Lake Mendota Winter Hike
 
Prayer Spaces Training Day London 2013 Closing Devotion Slides to accompany l...
Prayer Spaces Training Day London 2013 Closing Devotion Slides to accompany l...Prayer Spaces Training Day London 2013 Closing Devotion Slides to accompany l...
Prayer Spaces Training Day London 2013 Closing Devotion Slides to accompany l...
 
Fresh Expressions Rural Vision Day March 2012 Diocese of Norwich
Fresh Expressions Rural Vision Day March 2012 Diocese of NorwichFresh Expressions Rural Vision Day March 2012 Diocese of Norwich
Fresh Expressions Rural Vision Day March 2012 Diocese of Norwich
 
Netball1
Netball1Netball1
Netball1
 
IIT Level
IIT LevelIIT Level
IIT Level
 
412 S 31st Philomath OR tour
412 S 31st Philomath OR tour412 S 31st Philomath OR tour
412 S 31st Philomath OR tour
 
Grace
GraceGrace
Grace
 
Investor Group Brochure
Investor  Group  BrochureInvestor  Group  Brochure
Investor Group Brochure
 
Hollywood to Holy Orders
Hollywood to Holy OrdersHollywood to Holy Orders
Hollywood to Holy Orders
 
Are you tired? Reading
Are you tired? ReadingAre you tired? Reading
Are you tired? Reading
 
WebRaize.com - Invite Participants
WebRaize.com - Invite ParticipantsWebRaize.com - Invite Participants
WebRaize.com - Invite Participants
 
Pause absorb live opening loop
Pause absorb live opening loopPause absorb live opening loop
Pause absorb live opening loop
 
Families of prisoners what can i do
Families of prisoners   what can i doFamilies of prisoners   what can i do
Families of prisoners what can i do
 
Opening Devotion YMCA Norfolk 2013
Opening Devotion YMCA Norfolk 2013Opening Devotion YMCA Norfolk 2013
Opening Devotion YMCA Norfolk 2013
 

Slides paradigmes programmation

  • 1. Créativité, contraintes et paradigmes (ça tape non ?) Raphaël Bellec
  • 2. Péréc, Queneau, Racine Quel rapport avec l’informatique ?
  • 4.
  • 6.
  • 7. La page blanche L’espace vide à remplir Amie de la créativité ?
  • 8. A l’inverse... Developpe publiquement des trésors de créativité...
  • 9. La contrainte ? • Fixer un élément de la forme • Un bras figé • Des alexandrins • Laisser le fond se construire l’idée venant.
  • 10. Livre : Element du monoïde libre composé sur l’alphabet et contraint par la langue et les choix d’écriture Contrainte : limitation de l’espace des solutions, intrisequement continu et infini, lui donnant des points d’entrées
  • 12. Une autre forme de poésie...
  • 13. parfois completement for my $passion (@to_terminate) { map {my $body} ($through and $through); shift @me,'oh'..'so close to you!'; } listen 'closer',$_ foreach $breath; kill $me,'with that little death'; "What's the meaning of this rhyme"? 'You will come to learn in' : time; if (our $little_code) {'is_run'}; 'Then the two'. $will_be.'as', 1;
  • 14. Un programme • La représentation d’un monde... • Progressant à l’image de notre pensée... • Influencée par le langage et surtout... • Son paradigme
  • 15.
  • 16. Les paradigmes • Objet : Héritage, • Typé algebriquement : hiérarchie types, nature des habitants du monde • Fonctionnel : opérations unitaires, structure • Logique : relation entre les éléments, faits, règles. • // : op simultannées, communication, • Lazy - pure : monde pur, synchronisation monde exterieur impur, structures infinies • Systemes Experts : regles, ontologie, faits • Par contraintes • Brainfuck : > + .
  • 17. qsort [] = [] GENERIC INTERFACE ArraySort(Elem);   PROCEDURE Sort(VAR a: ARRAY OF Elem.T; cmp := Elem.Compare); qsort (x:xs) = qsort ys ++ x : qsort zs where (ys, zs) = partition (< x) xs   END ArraySort. GENERIC MODULE ArraySort (Elem);   PROCEDURE Sort (VAR a: ARRAY OF Elem.T; cmp := Elem.Compare) = BEGIN QuickSort (a, 0, NUMBER (a), cmp); InsertionSort (a, 0, NUMBER (a), cmp); END Sort;   PROCEDURE QuickSort (VAR a: ARRAY OF Elem.T; lo, hi: INTEGER; cmp := Elem.Compare) = CONST CutOff = 9; VAR i, j: INTEGER; key, tmp: Elem.T; BEGIN WHILE (hi - lo > CutOff) DO (* sort a[lo..hi) *)   (* use median-of-3 to select a key *) i := (hi + lo) DIV 2; IF cmp (a[lo], a[i]) < 0 THEN IF cmp (a[i], a[hi-1]) < 0 THEN key := a[i]; ELSIF cmp (a[lo], a[hi-1]) < 0 THEN key := a[hi-1]; a[hi-1] := a[i]; a[i] := key; ELSE key := a[lo]; a[lo] := a[hi-1]; a[hi-1] := a[i]; a[i] := key; END; ELSE (* a[lo] >= a[i] *) IF cmp (a[hi-1], a[i]) < 0 THEN key := a[i]; tmp := a[hi-1]; a[hi-1] := a[lo]; a[lo] := tmp; ELSIF cmp (a[lo], a[hi-1]) < 0 THEN key := a[lo]; a[lo] := a[i]; a[i] := key; ELSE key := a[hi-1]; a[hi-1] := a[lo]; a[lo] := a[i]; a[i] := key; END; END;   (* partition the array *) i := lo+1; j := hi-2;   (* find the first hole *) WHILE cmp (a[j], key) > 0 DO DEC (j) END; tmp := a[j]; DEC (j);   LOOP IF (i > j) THEN EXIT END;   WHILE i < hi AND cmp (a[i], key) < 0 DO INC (i) END; IF (i > j) THEN EXIT END; a[j+1] := a[i]; INC (i);   WHILE j > lo AND cmp (a[j], key) > 0 DO DEC (j) END; IF (i > j) THEN IF (j = i-1) THEN DEC (j) END; EXIT END; qsort( [], [] ). a[i-1] := a[j]; DEC (j); END;   qsort( [H|U], S ) :- splitBy(H, U, L, R), qsort(L, SL), qsort(R, SR), (* fill in the last hole *) a[j+1] := tmp; i := j+2;   (* then, recursively sort the smaller subfile *) append(SL, [H|SR], S). IF (i - lo < hi - i) THEN QuickSort (a, lo, i-1, cmp); lo := i; ELSE QuickSort (a, i, hi, cmp); hi := i-1; END;   END; (* WHILE (hi-lo > CutOff) *) END QuickSort;   PROCEDURE InsertionSort (VAR a: ARRAY OF Elem.T; lo, hi: INTEGER; % splitBy( H, U, LS, RS ) cmp := Elem.Compare) = VAR j: INTEGER; key: Elem.T; BEGIN FOR i := lo+1 TO hi-1 DO key := a[i]; % True if LS = { L in U | L <= H }; RS = { R in U | R > H } j := i-1; WHILE (j >= lo) AND cmp (key, a[j]) < 0 DO a[j+1] := a[j]; DEC (j); END; splitBy( _, [], [], []). a[j+1] := key; END; END InsertionSort;   splitBy( H, [U|T], [U|LS], RS ) :- U =< H, splitBy(H, T, LS, RS). BEGIN END ArraySort. splitBy( H, [U|T], LS, [U|RS] ) :- U > H, splitBy(H, T, LS, RS).
  • 18. L’interêt • Pas dans le langage ! Ni les Frameworks • Comprendre une nouvelle façon de penser • Difficile et prend (un peu de temps)
  • 19. Ma liste... • C • Erlang • Ruby (faillotage) • Un S.E. • XSLT • Contraintes (Oz, Prolog, minion, Gecode...) • SQL • Plus tard : Haskell • CAML • Pour comprendre • Scheme vraiment (ou pas !) : Coq • Prolog
  • 20. Références • Pour les livres, j’ai laissé la couverture complète. • Poeme l’oeuf, voir : http://www.digitalcraft.org/iloveyou/ poetry.htm • Feuille d’impot : Formulaire cerfa, auteur inconnu et souhaitant probablement rester anonyme. • Je n’arrive pas à remettre la main sur les références du poème informatique «Paradigm». Toute aide est la bienvenue ! • Poème en PERL : http://www.perlmonks.org/?node_id=963133 • Codes sources : voir rosetta code.
  • 21. Notes importantes • J’ai placé des langages pour exemple. Le plus important est le paradigme et il n’est pas toujours lié au langage. • Plusieurs personnes m’ont dit detester XSLT lors de la conf. Je ne préconise pas de l’utiliser non plus... juste de l’avoir vu et surtout vu Xpath et XQuery.