Ceu is a synchronous programming language that reconciles Structured Concurrency with Event-Driven Programming to extend classical structured programming:
- Structured Deterministic Concurrency:
- A set of structured primitives to lexically compose concurrent tasks
(e.g.,
spawn
,par-or
,toggle
). - A synchronous and deterministic scheduling policy, which provides predictable behavior and safe abortion of tasks.
- A set of structured primitives to lexically compose concurrent tasks
(e.g.,
- Event Signaling Mechanisms:
- An
await
primitive to suspend a task and wait for events. - A
broadcast
primitive to signal events and awake awaiting tasks.
- An
Ceu is inspired by Esterel and Lua.
Follows a summary of the main ideas in the design of Ceu:
Follows an extended list of functionalities in Ceu:
- Dynamic typing
- Statements as expressions
- Dynamic collections (tuples, vectors, and dictionaries)
- Stackless coroutines (the basis of tasks)
- Restricted closures (upvalues must be final)
- Deferred statements (for finalization)
- Exception handling (throw & catch)
- Hierarchical Tags and Tuple Templates (for data description)
- Seamless integration with C (source-level compatibility)
Ceu is in experimental stage. Both the compiler and runtime can become very slow.
Displays Hello World!
every second, until 10 seconds elapse:
spawn {
watching :10:s {
every :1:s {
println("Hello World!")
}
}
}
- Install
gcc
andjava
:
sudo apt install gcc default-jre
- Install
ceu
:
wget https://github.com/fsantanna/dceu/releases/download/v0.3.1/install-v0.3.1.sh
sh install-v0.3.1.sh ./ceu/
- You may want to
- add
./ceu/
to yourPATH
- modify
./ceu/
to another destination
- add
- Execute
ceu
:
./ceu/ceu ./ceu/hello-world.ceu
hello
world
The best way to try Ceu is through pico-ceu
, a graphical library based on
SDL:
- A toy Problem: Drag, Click, or Cancel
- https://fsantanna.github.io/toy.html
- Run with
pico-ceu
inceu/pico/tst/
:../../ceu --lib=pico click-drag-cancel-x.ceu
- Comparison with JS generators:
- A simple but complete 2D game in Ceu:
- https://github.com/fsantanna/pico-ceu-rocks
- Clone in
ceu/pico/
, cd to it, and run withpico-ceu
:../../ceu --lib=pico main.ceu
- Academic publications: