From Céupédia
Jump to: navigation, search

1 Future Programming Workshop (2014)

This video was presented in the "Future Programming Workshop" at StrangeLoop & SPLASH in 2014:

It is the recommended video for an overview about Céu.

2 Curry On (2015)

This video was presented in "Curry On" at ECOOP in 2015:

The video talks about mixing control and data flow in Céu.

3 YouTube Series (2013)

The videos below introduce the reactive programming language Céu through some graphical applications using the SDL library. They assume knowledge of C and SDL (or a similar graphical library).

3.1 Céu basics

  • Introduces the reactive and synchronous execution model of Céu.
  • Shows how concurrent applications can execute deterministically without heavy synchronization primitives (e.g. locks and mutexes).

Particular features of Céu in this video:

The await <evt> statement
Suspends the running line of execution until the referred event occurs.
First-class timers
Support for multiple timers that are automatically adjusted to avoid desynchronization.
The par/and and par/or compositions
Handle creation and termination of lines of execution automatically.
Internal events
A broadcast notification mechanism that follows a stacked execution.

3.2 Céu with SDL

  • Shows in more detail the Céu <=> C integration through the SDL API.
Céu enforces strict policies to C calls that can avoid subtle bugs, such as memory leaks and dangling pointers.
  • Illustrates how Céu can specify (implicit) stateful animations that avoid the hassle of callback soups.
The bouncing animation in the example uses two loops in sequence that don't need to be split into multiple callbacks.
Note the absence of if statements to handle state explicitly.

Particular features of Céu in this video:

External input events
Provide means to interface with the environment.
The finalize construct
Enforces proper handling of side-effect functions that require associated destruction (e.g. malloc/free).

3.3 Céu organisms

  • Introduces Céu organisms, a OO-like abstraction mechanism that encapsulates state (i.e. properties) and lines of execution (i.e. trails) in a single construct.
In the example, we hide the animation behavior in a class that can be parameterized via properties.
  • Shows how organisms are scoped just like normal variables.
In conventional OO, references are scoped, but not the objects themselves (which live in the heap).
In Céu, when an organism goes out of scope, the memory is reclaimed and its associated running code is killed.
  • Relies on the deterministic scheduler to properly handle the z-order implicitly when redrawing objects.

Particular features of Céu in this video:

The class construct
Céu's abstraction mechanism.
The par construct
A parallel composition that never terminates, regardless of what happens to its sub-trails.

3.4 Céu dynamic organisms

  • Illustrates the dynamic allocation of organisms.
Shows that although organisms can be allocated in the heap, they are still automatically managed by lexical scope.

Particular features of Céu in this video:

The new statement
Dynamically allocate a new organism.
The spawn statement
Dynamically allocate a new anonymous organism that is automatically freed when its body terminates.