You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Event-driven programming drives computation through events (user interactions, messages, timers) and callbacks. It is the dominant model in UI frameworks and server-side I/O (Node.js):
167
+
168
+
.. code-block:: javascript
169
+
170
+
// Node.js HTTP server: execution is driven by incoming request events
Event-driven programming is closely related to the reactive paradigm (see above), with the key difference that reactive programming typically provides composable operators (``map``, ``filter``, ``merge``) over streams of events, whereas plain event-driven code uses ad-hoc callbacks.
182
+
166
183
167
184
Constraint Programming
168
-
``````````````````````
185
+
~~~~~~~~~~~~~~~~~~~~~~
169
186
170
187
Constraint programming extends logic programming by allowing variables to be constrained over a domain (e.g., integers, reals, finite sets) and using specialised solvers to find solutions. SWI-Prolog's ``clpfd`` library is a widely used constraint solver:
171
188
@@ -184,23 +201,3 @@ Constraint programming extends logic programming by allowing variables to be con
184
201
% X = 1, Y = 9 ; X = 2, Y = 8 ; ...
185
202
186
203
See also the discussion of Prolog and backtracking in :doc:`/70-logic`.
187
-
188
-
Event-driven Programming
189
-
````````````````````````
190
-
191
-
Event-driven programming drives computation through events (user interactions, messages, timers) and callbacks. It is the dominant model in UI frameworks and server-side I/O (Node.js):
192
-
193
-
.. code-block:: javascript
194
-
195
-
// Node.js HTTP server: execution is driven by incoming request events
Event-driven programming is closely related to the reactive paradigm (see above), with the key difference that reactive programming typically provides composable operators (``map``, ``filter``, ``merge``) over streams of events, whereas plain event-driven code uses ad-hoc callbacks.
0 commit comments