Synchronous programming language: Difference between revisions

Content deleted Content added
No edit summary
Adding short description: "Programming language for programming reactive systems"
 
(46 intermediate revisions by 36 users not shown)
Line 1:
{{Short description|Programming language for programming reactive systems}}
A '''synchronous programming language''' is a [[computer]] [[computer programming|programming]] [[programming language|language]] optimized for programming '''reactive systems'''. Computer systems can be sorted in three main classes: (1) '''transformational systems''' that take some inputs, process them, deliver their outputs, and terminate their execution; a typical example is a compiler; (2) '''interactive systems''' that interact continuously with their environment, at their own speed; a typical example is the web; and (3) reactive systems that interact continuously with their environment, at a speed imposed by the environment; a typical example is the automatic flight control system of modern airplanes. Reactive systems must therefore react to stimuli from the environment within strict time bounds. For this reason they are often also called [[Real-time computing|real-time systems]], and are found often in [[Embedded system|embedded systems]].
{{Multiple issues|
{{refimprove|date=June 2012}}
{{lead too long|date=April 2012}}
}}
 
A '''synchronous programming language''' is a [[computer programming language]] optimized for programming [[reactive system]]s.
'''Synchronous programming''' (also '''synchronous reactive programming''' or '''SRP''') is a computer programming [[Programming paradigm|paradigm]] supported by synchronous programming languages. The principle of SRP is to make the same abstraction for programming languages as the synchronous abstraction in digital circuits. Synchronous circuits are indeed designed at a high-level of abstraction where the timing characteristics of the electronic transistors are neglected. Each gate of the circuit (or, and, ...) is therefore assumed to compute its result instantaneously, each wire it assumed to transmit it signal instantaneously. A synchronous circuit is clocked and at each tick of its clock, it computes instantaneously its output values and the new values of its memory cells (latches) from the its input values and the current values of its memory cells. In other words, the circuit behaves as if as if the electrons were flowing infinitely fast.
 
[[Computer system]]s can be sorted in three main classes:
The synchronous abstraction makes reasoning about time in a synchronous program a lot easier, thanks to the notion of '''logical ticks''': a synchronous program reacts to its environment in a sequence of ticks, and computations within a tick are assumed to be instantaneous, i.e., as if the processor executing them was infinitely fast. The statement “'''a||b'''” is therefore abstracted as the package “'''ab'''” where “'''a'''” and “'''b'''” are simultaneous. To take a concrete exemple, the Esterel statement “'''every 60 second emit minute'''” specifies that the signal “'''minute'''” is exactly synchronous with the 60-th occurrence of the signal “'''second'''”. At a more fundamental level, the synchronous abstraction eliminates the non-determinism resulting from the interleaving of concurrent behaviors. This allows '''deterministic''' semantics, therefore making synchronous programs amenable to formal analysis, verification and certified code generation, and usable as formal specification formalisms.
# ''Transformational systems'' take some inputs, process them, deliver their outputs, and terminate their execution. A typical example is a compiler.
# ''Interactive systems'' interact continuously with their environment, at their own speed. A typical example is the web.
A# '''synchronous programming language''' is a [[computer]] [[computer programming|programming]] [[programming language|language]] optimized for programming '''reactiveReactive systems'''. Computer systems can be sorted in three main classes: (1) '''transformational systems''' that take some inputs, process them, deliver their outputs, and terminate their execution; a typical example is a compiler; (2) '''interactive systems''' that interact continuously with their environment, at their own speed; a typical example is the web; and (3) reactive systems that interact continuously with their environment, at a speed imposed by the environment;. aA typical example is the [[automatic flight control]] system of modern airplanes. Reactive systems must therefore react to stimuli from the environment within strict time bounds. For this reason they are often also called [[Real-time computing|real-time systems]], and are found often in [[Embeddedembedded system|embedded systems]]s.
 
'''Synchronous programming''', (also called '''synchronous reactive programming''' or ('''SRP'''), is a computer programming [[Programmingprogramming paradigm|paradigm]] supported by synchronous programming languages. The principle of SRP is to make the same abstraction for programming languages as the synchronous abstraction in digital circuits. Synchronous circuits are indeed designed at a high- level of abstraction where the timing characteristics of the electronic transistors are neglected. Each gate of the circuit (or, and, ...) is therefore assumed to compute its result instantaneously, each wire itis assumed to transmit itits signal instantaneously. A synchronous circuit is clocked and at each tick of its clock, it computes instantaneously its output values and the new values of its memory cells (latches) from the its input values and the current values of its memory cells. In other words, the circuit behaves as if as if the electrons were flowing infinitely fast. The first synchronous programming languages were invented in France in the 1980s: [[Esterel]], [[Lustre (programming language)|Lustre]], and [[SIGNAL (programming language)|SIGNAL]]. Since then, many other synchronous languages have emerged.
In contrast, in the asynchronous model of computation, on a sequential processor, the statement “'''a||b'''” can be either implemented as "'''a;b'''" or as "'''b;a'''". This is known as the '''interleaving-based non determinism'''. The drawback is that it intrinsically forbids deterministic semantics (e.g., race conditions), which makes formal reasoning such as analysis and verification more complex. Nonetheless, asynchronous formalisms are very useful to model, design and verify distributed systems, because they are intrinsically asynchronous.
 
The synchronous abstraction makes reasoning about time in a synchronous program a lot easier, thanks to the notion of '''logical ticks''': a synchronous program reacts to its environment in a sequence of ticks, and computations within a tick are assumed to be instantaneous, i.e., as if the processor executing them waswere infinitely fast. The statement “'''"a||b'''”" is therefore abstracted as the package “'''"ab'''”" where “'''"a'''”" and “'''"b'''”" are simultaneous. To take a concrete exempleexample, the Esterel statement “''"'every 60 second emit minute'''”" specifies that the signal “'''"minute'''”" is exactly synchronous with the 60-th occurrence of the signal “'''"second'''”". At a more fundamental level, the synchronous abstraction eliminates the non-determinism resulting from the interleaving of concurrent behaviors. This allows '''[[deterministic''']] semantics, therefore making synchronous programs amenable to formal analysis, [[formal verification|verification]] and certified code generation, and usable as [[formal specification]] formalisms.
==Implementations==
 
In contrast, in the asynchronous model of computation, on a sequential processor, the statement “'''"a||b'''”" can be either implemented as "'''a;b'''" or as "'''b;a'''". This is known as the '''[[interleaving-based non determinism''']]. The drawback with an asynchronous model is that it intrinsically forbids deterministic semantics (e.g., race conditions), which makes formal reasoning such as analysis and verification more complex. Nonetheless, asynchronous formalisms are very useful to model, design and verify distributed systems, because they are intrinsically asynchronous.
The [[ESTEREL]] language is an example of a synchronous programming language.<ref name="Berry Gonthier">G. Berry and G. Gonthier. The synchronous programming language ESTEREL: Design, semantics, implementation. ''Science of Computer Programming'', 19(2), 1992.</ref>
 
Also in contrast are systems with processes that basically ''interact synchronously''. An example would be systems based on the [[Communicating sequential processes|Communicating sequential processes (CSP)]] model, which allows deterministic (external) and nondeterministic (internal) choice.
 
==Synchronous languages==
*[[Argos{{see also|List of synchronous programming language|Argos]]languages}}
*[[Argos (programming language)|Argos]]
*[[Atom_Atom (programming_languageprogramming language)|Atom]] (a DSL[[___domain-specific language]] in [[Haskell_Haskell (programming_languageprogramming language)|Haskell]] for hard realtime embedded programming)
*[[Averest]]
*[[Blech (programming language)|Blech]]
*[[ChucK]] (a synchronous reactive programming language for audio)
The *[[ESTERELEsterel]] language is an example of a synchronous programming language.<ref name="Berry Gonthier">G. Berry and G. Gonthier. The synchronous programming language ESTEREL: Design, semantics, implementation. ''Science of Computer Programming'', 19(2), 1992.</ref>
*[[Esterel]]
*[[LabVIEW]]
*[[LEA (programming language)|LEA]]
*[[Lustre (programming language)|Lustre]]
*[[PLEXIL]]
*[[SIGNAL (programming language)|SIGNAL]] (a dataflow-oriented synchronous language enabling multi-clock specifications)
*[[Secure Operations Language|SOL]]
*[[SyncCharts]]
 
==See also==
* [[Asynchronous programming]]
* [[Concurrency (computer science)]]
== References ==
* Nicolas Halbwachs. "Synchronous programming of reactive systems". Kluwer Academic Publishers, 1993. http://www-verimag.imag.fr/~halbwach/newbook.pdf
 
{{Reflist}}
 
== External links ==
*[http://www-verimag.imag.fr/SYNCHRONE/ The Synchronous group] at Verimag lab.
*[http://www.irisa.fr/espresso/Polychrony/ The SIGNAL programming language].
*[httphttps://wwwweb.archive.org/web/20050324021405/http://ece.purdue.edu/~hankd/CARP/XPC/paper.html Unification of Synchronous and Asynchronous Models for Parallel Programming Languages] -- Proposes—Proposes [[parallel languages]] based on [[C (programming language)|C]], lets programmers specify and manage parallelism on a broad range of computer architectures.
 
{{Programming languageparadigms navbox}}
== References ==
{{Types of programming languages}}
* Nicolas Halbwachs. "Synchronous programming of reactive systems". Kluwer Academic Publishers, 1993. http://www-verimag.imag.fr/~halbwach/newbook.pdf
{{Reflist}}
 
[[Category:Synchronous programming languages| Synchronous programming language]]
==See also==
* [[Asynchronous programming]]
 
{{Programming language}}
 
[[Category:Synchronous programming languages| Synchronous programming language]]
[[Category:Programming language classification]]
 
{{compu-lang-stub}}
 
[[de:Synchrone Programmiersprache]]
[[fr:Programmation synchrone]]