device-137.home 2026-2-19:14:12:57

This commit is contained in:
oskar
2026-02-19 14:12:58 +01:00
parent f6bc02b61d
commit 2299d93cfe
5 changed files with 224 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@@ -5,7 +5,7 @@
{
"id": 1,
"name": "Ma bibliothèque",
"lastUpdate": 1771179977261
"lastUpdate": 1771504979244
}
],
"renderCitations": true,

View File

@@ -1,5 +1,5 @@
{
"logLevel": "INFO",
"logLevel": "ALL",
"citationEditorSuggester": true,
"showCitekeyInSuggester": true,
"literatureNoteFolder": "sources/zotero",

View File

@@ -14,6 +14,8 @@ source:: [[ParadigmeProgrammation]]
> Le paradigme fournit (et détermine) la vision du développeur sur l'exécution de son programme.
^definition
[@undefined]
> [!cite]- [Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/groups/5383243/items/673TMQRT) - [Page 10](zotero://open-pdf/groups/5383243/items/P4L4LCJZ?page=2&annotation=2294PTUD)
> A programming paradigm is an approach to programming a computer based on a mathematical theory or a coherent set of principles.
>

View File

@@ -0,0 +1,219 @@
---
zotero-key: NYZDJ4E6
zt-attachments:
- "434"
aliases:
- "Programming Paradigms for Dummies: What Every Programmer Should Know"
up: "[[zotero literature notes]]"
link: "[attachment](<file:///Users/oscarplaisant/Zotero/storage/Y32P72P2/Roy%20-%20Programming%20Paradigms%20for%20Dummies%20What%20Every%20Prog.pdf>)"
zotero-link: "[Zotero](zotero://select/library/items/NYZDJ4E6)"
tags:
- "#s/PKM"
- "#zotero"
- "#t/source"
---
> [!zotero]+ <span style="color: #2ea8e5; --link-external-color: #2ea8e5;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 10](zotero://open-pdf/library/items/Y32P72P2?page=2&annotation=HZ6WH25D)</span>
> A programming paradigm is an approach to programming a computer based on a mathematical theory or a coherent set of principles.
>
> > [!note] Notes
> > Paradigme: approche (éventuellement mathématique) de la programmation
> >
> > - chaque paradigme est défini à partir de principes de base (éventuellement une théorie mathématique)
> ^HZ6WH25DaY32P72P2p2
> [!zotero]+ <span style="color: #ffd400; --link-external-color: #ffd400;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 10](zotero://open-pdf/library/items/Y32P72P2?page=2&annotation=NN6IIXM7)</span>
> Each paradigm supports a set of concepts that makes it the best for a certain kind of problem. For example, object-oriented programming is best for problems with a large number of related data abstractions organized in a hierarchy. Logic programming is best for transforming or navigating complex symbolic structures according to logical rules. Discrete synchronous programming is best for reactive problems, i.e., problems that consist of reactions to sequences of external events.
>
> > [!note] Notes
> > Les concepts supportés par les différents paradigmes les rendent adaptés pour la résolution de différents problèmes.
> ^NN6IIXM7aY32P72P2p2
> [!zotero]+ <span style="color: #ffd400; --link-external-color: #ffd400;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 10](zotero://open-pdf/library/items/Y32P72P2?page=2&annotation=FNUKXQI4)</span>
> A language should ideally support many concepts in a well-factored way, so that the programmer can choose the right concepts whenever they are needed without being encumbered by the others.
>
> > [!note] Notes
> > Les langages devraient tous être multiparadigmes, pour pouvoir choisir les bons concepts en fonction du problème.
> ^FNUKXQI4aY32P72P2p2
> [!zotero]+ <span style="color: #ffd400; --link-external-color: #ffd400;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 13](zotero://open-pdf/library/items/Y32P72P2?page=5&annotation=I2ZSTN3Q)</span>
> ![[images/zotero/I2ZSTN3Q.png]]
> ^I2ZSTN3QaY32P72P2p5
> [!zotero]+ <span style="color: #2ea8e5; --link-external-color: #2ea8e5;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 13](zotero://open-pdf/library/items/Y32P72P2?page=5&annotation=GQVVSQ54)</span>
> This explains why functional programming is so important: it is based on the concept of first-class function, or closure, which makes it equivalent to the λ-calculus which is Turing complete.
> ^GQVVSQ54aY32P72P2p5
> [!zotero]+ <span style="color: #2ea8e5; --link-external-color: #2ea8e5;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 14](zotero://open-pdf/library/items/Y32P72P2?page=6&annotation=TVLXQRI6)</span>
> nondeterminism is when the execution of a program is not completely determined by its specification, i.e., at some point during the execution the specification allows the program to choose what to do next. During the execution, this choice is made by a part of the run-time system called the scheduler
>
> > [!note] Notes
> > non-déterminisme = la spécification du programme ne détermine pas complètement le résultat
> > cela implique que le programme "choisit" ce qu'il doit faire parfois.
> ^TVLXQRI6aY32P72P2p6
> [!zotero]+ <span style="color: #ffd400; --link-external-color: #ffd400;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 14](zotero://open-pdf/library/items/Y32P72P2?page=6&annotation=KVWZXWDV)</span>
> But paradigms that have the power to express observable nondeterminism can be used to model real-world situations and to program independent activities.
> ^KVWZXWDVaY32P72P2p6
> [!zotero]+ <span style="color: #ffd400; --link-external-color: #ffd400;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 14](zotero://open-pdf/library/items/Y32P72P2?page=6&annotation=QZEZKYF3)</span>
> We conclude that observable nondeterminism should be supported only if its expressive power is needed.
>
> > [!note] Notes
> > C'est le pouvoir d'expression apporté qui peut justifier d'accepter certains problèmes de certains paradigmes.
> ^QZEZKYF3aY32P72P2p6
> [!zotero]+ <span style="color: #2ea8e5; --link-external-color: #2ea8e5;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 14](zotero://open-pdf/library/items/Y32P72P2?page=6&annotation=TCAZT56G)</span>
> State is the ability to remember information, or more precisely, to store a sequence of values in time.
> ^TCAZT56GaY32P72P2p6
> [!zotero]+ <span style="color: #ffd400; --link-external-color: #ffd400;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 16](zotero://open-pdf/library/items/Y32P72P2?page=8&annotation=IZ3E9CQY)</span>
> Concepts are not combined arbitrarily to form paradigms. They can be organized according to the creative extension principle. This principle was first defined by Felleisen [18] and independently rediscovered in [50].
>
> > [!note] Notes
> > Le principe de l'*extension créative* permet d'organiser les concepts pour former réellement un paradigme.
> ^IZ3E9CQYaY32P72P2p8
> [!zotero]+ <span style="color: #ffd400; --link-external-color: #ffd400;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 17](zotero://open-pdf/library/items/Y32P72P2?page=9&annotation=E8NGPAQ5)</span>
> If we need to model several independent activities, then we will have to implement several execution stacks, a scheduler, and a mechanism for preempting execution from one activity to another. All this complexity is unnecessary if we add one concept to the language: concurrency.
> ^E8NGPAQ5aY32P72P2p9
> [!zotero]+ <span style="color: #ffd400; --link-external-color: #ffd400;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 17](zotero://open-pdf/library/items/Y32P72P2?page=9&annotation=6L7393YH)</span>
> If we need to model updatable memory, that is, entities that remember and update their past, then we will have to add two arguments to all function calls relative to that entity. The arguments represent the input and output values of the memory. This is unwieldy and it is also not modular because the memory travels throughout the whole program. All this clumsiness is unnecessary if we add one concept to the language: named state.
>
> > [!note] Notes
> > Les *états nommés* sont une solution efficace pour modéliser la mémoire que l'on peut mettre à jour.
> >
> > Cela évite d'avoir à ajouter des arguments à toutes les fonctions qui utilisent cet état.
> ^6L7393YHaY32P72P2p9
> [!zotero]+ <span style="color: #ffd400; --link-external-color: #ffd400;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 17](zotero://open-pdf/library/items/Y32P72P2?page=9&annotation=7YIL4EUX)</span>
> If we need to model error detection and correction, in which any function can detect an error at any time and transfer control to an error correction routine, then we need to add error codes to all function outputs and conditionals to test all function calls for returned error codes. All this complexity is unnecessary if we add one concept to the language: exceptions.
>
> > [!note] Notes
> > les exceptions sont une solution efficace pour éviter d'avoir à gérer soi-même les codes d'erreurs, leur propagation etc.
> ^7YIL4EUXaY32P72P2p9
> [!zotero]+ <span style="color: #ffd400; --link-external-color: #ffd400;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 17](zotero://open-pdf/library/items/Y32P72P2?page=9&annotation=VYAGT4XY)</span>
> The common theme in these three scenarios (and many others!) is that we need to do pervasive (nonlocal) modifications of the program in order to handle a new concept. If the need for pervasive modifications manifests itself, we can take this as a sign that there is a new concept waiting to be discovered. By adding this concept to the language we no longer need these pervasive modifications and we recover the simplicity of the program.
>
> > [!note] Notes
> > Modification envahissante = signe qu'un nouveau concept peut être découvert
> >
> > ajouter ce concept au langage => éviter les modifications envahissantes => retrouver la simplicité
> ^VYAGT4XYaY32P72P2p9
> [!zotero]+ <span style="color: #a28ae5; --link-external-color: #a28ae5;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 18](zotero://open-pdf/library/items/Y32P72P2?page=10&annotation=TQ3EVZM4)</span>
> Prolog: The first paradigm is a logic programming engine based on unification and depth-first search. The second paradigm is imperative: the assert and retract operations which allow a program to add and remove program clauses.
>
> > [!note] Notes
> > prolog supporte 2 paradigmes :
> > - programmation logique
> >
> > - programmation impérative (ajout et rétraction de clauses)
> ^TQ3EVZM4aY32P72P2p10
> [!zotero]+ <span style="color: #a28ae5; --link-external-color: #a28ae5;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 18](zotero://open-pdf/library/items/Y32P72P2?page=10&annotation=WH6FSS2U)</span>
> Modeling languages (e.g., Comet, Numerica [48]): The first paradigm is a solver: constraint programming (see Section 7), local search (see the chapter by Philippe Codognet [8]), satisfiability (SAT solvers), and so forth. The second paradigm is object-oriented programming.
>
> > [!note] Notes
> > Langages de modélisation : supportent 2 paradigmes :
> > - programmation par contraintes (avec un solver)
> > - OOP
> ^WH6FSS2UaY32P72P2p10
> [!zotero]+ <span style="color: #a28ae5; --link-external-color: #a28ae5;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 18](zotero://open-pdf/library/items/Y32P72P2?page=10&annotation=CA7HHNJL)</span>
> Solving libraries (e.g., Gecode): The first paradigm is a solver library based on advanced search algorithms, such as Gecode [43, 47]. The second paradigm is added by the host language, e.g., C++ and Java support object-oriented programming.
>
> > [!note] Notes
> > certaines librairies peuvent ajouter un paradigme à un langage (comme les librairies de *solver*).
> ^CA7HHNJLaY32P72P2p10
> [!zotero]+ <span style="color: #a28ae5; --link-external-color: #a28ae5;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 18](zotero://open-pdf/library/items/Y32P72P2?page=10&annotation=VMB965WX)</span>
> Language embedding (e.g., SQL): SQL already supports two paradigms: a relational programming engine for logical queries of a database and a transactional interface for concurrent updates of the database. The host language complements this by supporting object-oriented programming, for organization of large programs. This example goes beyond two paradigms to show a design with three complementary paradigms.
>
> > [!note] Notes
> > L'intégration d'un langage (embedding) permet de créer une architecture où plusieurs paradigmes complémentaires interagissent.
> >
> > exemple : SQL supporte le paradigme relationnel, et le paradigme par transactions. Il peut être intégré dans un langage objet.
> ^VMB965WXaY32P72P2p10
> [!zotero]+ <span style="color: #ffd400; --link-external-color: #ffd400;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 19](zotero://open-pdf/library/items/Y32P72P2?page=11&annotation=XDIL2TJS)</span>
> Erlang Programming highly available embedded systems for telecommunications. This project was undertaken by Joe Armstrong and his colleagues at the Ericsson Computer Science Laboratory starting in 1986. The Erlang language was designed and a first efficient and stable implementation was completed in 1991 [5, 6]. An Erlang program consists of isolated named lightweight processes that send each other messages. Because of the isolation, Erlang programs can be run almost unchanged on distributed systems and multi-core processors. The Erlang system has a replicated database, Mnesia, to keep global coherent states. Erlang and its programming platform, the OTP (Open Telecom Platform) system, are being used successfully in commercial systems by Ericsson and other companies [57, 17].
> ^XDIL2TJSaY32P72P2p11
> [!zotero]+ <span style="color: #ffd400; --link-external-color: #ffd400;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 19](zotero://open-pdf/library/items/Y32P72P2?page=11&annotation=U52LG8YQ)</span>
> E Programming secure distributed systems with multiple users and multiple security domains. This project was undertaken over many years by different institutions. It started with Dennis and Van Horns capability model in 1965 [13] and Carl Hewitts Actor model in 1973 [24] and it led via concurrent logic programming to the E language designed by Doug Barnes, Mark Miller, and their colleagues [32, 31]. Predecessors of E have been used to implement various multiuser virtual 19 Peter Van Roy environments. An E program consists of isolated single-threaded vats (processes) hosting active objects that send each other messages. Deterministic concurrency is important in E because nondeterminism can support a covert channel.
> ^U52LG8YQaY32P72P2p11
> [!zotero]+ <span style="color: #2ea8e5; --link-external-color: #2ea8e5;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 23](zotero://open-pdf/library/items/Y32P72P2?page=15&annotation=62YW7KX7)</span>
> A record is a data structure: a group of references to data items with indexed access to each item.
>
> > [!note] Notes
> > enregistrement = un ensemble de références à des données avec un accès indexé
> > enregistrement = concept derrière le dictionnaire
> ^62YW7KX7aY32P72P2p15
> [!zotero]+ <span style="color: #2ea8e5; --link-external-color: #2ea8e5;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 23](zotero://open-pdf/library/items/Y32P72P2?page=15&annotation=JQTFQ4I7)</span>
> A symbolic programming language is able to calculate with records: create new records, decompose them, and examine them.
>
> > [!note] Notes
> > programmation symbolique => calculer avec des enregistrements
> ^JQTFQ4I7aY32P72P2p15
> [!zotero]+ <span style="color: #ffd400; --link-external-color: #ffd400;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 23](zotero://open-pdf/library/items/Y32P72P2?page=15&annotation=H49IDZ8M)</span>
> Many important data structures such as arrays, lists, strings, trees, and hash tables can be derived from records.
> ^H49IDZ8MaY32P72P2p15
> [!zotero]+ <span style="color: #2ea8e5; --link-external-color: #2ea8e5;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 24](zotero://open-pdf/library/items/Y32P72P2?page=16&annotation=JYPCBF83)</span>
> From an implementation viewpoint, a closure combines a procedure with its external references (the references it uses at its definition).
>
> > [!note] Notes
> > fermeture = combiner une fonction avec ses références externes
> ^JYPCBF83aY32P72P2p16
> [!zotero]+ <span style="color: #2ea8e5; --link-external-color: #2ea8e5;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 24](zotero://open-pdf/library/items/Y32P72P2?page=16&annotation=XFBKXF9N)</span>
> From the programmers viewpoint, a closure is a “packet of work”: a program can transform any instructions into a closure at one point in the program, pass it to another point, and decide to execute it at that point. The result of its execution is the same as if the instructions were executed at the point the closure was created.
>
> > [!note] Notes
> > fermeture := permet que le résultat soit le même que si les instructions étaient éxécutées à l'endroit où la fermeture à été créée.
> ^XFBKXF9NaY32P72P2p16
> [!zotero]+ <span style="color: #a28ae5; --link-external-color: #a28ae5;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 24](zotero://open-pdf/library/items/Y32P72P2?page=16&annotation=69QT8GC5)</span>
> We have separated the definition of <stmt> from its execution. With this ability we can define control structures such as an if statement or while loop.
>
> > [!note] Notes
> > Les fermetures permettent de définir les structures de contrôle (`if`, `while`...).
> ^69QT8GC5aY32P72P2p16
> [!zotero]+ <span style="color: #a28ae5; --link-external-color: #a28ae5;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 24](zotero://open-pdf/library/items/Y32P72P2?page=16&annotation=8WFC8D27)</span>
> Instantiation and genericity, normally associated with object-oriented programming, can be done easily by writing functions that return other functions. In object-oriented programming the first function is called a “class” and the second is called an “object”.
>
> > [!note] Notes
> > les fermetures permettent l'instantiation et la généricité, en définissant des fonctions d'ordre supérieur (qui retournent d'autres fonctions).
> ^8WFC8D27aY32P72P2p16
> [!zotero]+ <span style="color: #a28ae5; --link-external-color: #a28ae5;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 25](zotero://open-pdf/library/items/Y32P72P2?page=17&annotation=5MH9NH9C)</span>
> Separation of concerns, normally associated with aspect-oriented programming, can be done easily by writing functions that take other functions as arguments. For example, Erlang has a function that implements a generic fault-tolerant client/server. It is called with a function argument that defines the servers behavior. Aspectoriented programming in object-oriented languages is explained in the chapter by Pierre Cointe [9]. It is usually done by syntactic transformations
> ^5MH9NH9CaY32P72P2p17
> [!zotero]+ <span style="color: #2ea8e5; --link-external-color: #2ea8e5;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 25](zotero://open-pdf/library/items/Y32P72P2?page=17&annotation=TPWVBJHL)</span>
> For example, consider a program that consists of instructions executing one after the other. The instructions are not independent since they are ordered in time. To implement independence we need a new programming concept called concurrency. When two parts do not interact at all, we say they are concurrent.3 (When the order of execution of two parts is given, we say they are sequential.)
> ^TPWVBJHLaY32P72P2p17
> [!zotero]+ <span style="color: #ffd400; --link-external-color: #ffd400;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 25](zotero://open-pdf/library/items/Y32P72P2?page=17&annotation=38Q4XNLQ)</span>
> The real world is concurrent: it consists of activities that evolve independently.
> ^38Q4XNLQaY32P72P2p17
> [!zotero]+ <span style="color: #2ea8e5; --link-external-color: #2ea8e5;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 26](zotero://open-pdf/library/items/Y32P72P2?page=18&annotation=4PJFAMJR)</span>
> Distributed system: a set of computers connected through a network. A concurrent activity is called a computer. This is the basic structure of the Internet.
> ^4PJFAMJRaY32P72P2p18
> [!zotero]+ <span style="color: #2ea8e5; --link-external-color: #2ea8e5;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 26](zotero://open-pdf/library/items/Y32P72P2?page=18&annotation=48JXGDKM)</span>
> Operating system: the software that manages a computer. A concurrent activity is called a process. Processes have independent memories. The operating system handles the task of mapping the process execution and memory to the computer. For example, each running application typically executes in one process.
> ^48JXGDKMaY32P72P2p18
> [!zotero]+ <span style="color: #2ea8e5; --link-external-color: #2ea8e5;">[Programming Paradigms for Dummies: What Every Programmer Should Know](zotero://select/library/items/NYZDJ4E6) - [Page 26](zotero://open-pdf/library/items/Y32P72P2?page=18&annotation=UFQ2X38C)</span>
> Activities inside one process. A concurrent activity is called a thread. Threads execute independently but share the same memory space. For example, the different windows in a Web browser typically execute in separate threads.
> ^UFQ2X38CaY32P72P2p18