JobLeonard/dceu

★ 0Forks 0GitHub ↗Compare

README

The Programming Language Ceu

Ceu is a synchronous programming language that reconciles Structured Concurrency with Event-Driven Programming. Ceu extends classical structured programming with three main functionalities:

  • Structured Deterministic Concurrency:
    • A set of structured primitives to 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 container primitive to hold dynamic tasks, which automatically releases them on termination.
  • Event Signaling Mechanisms:
    • An await primitive to suspend a task and wait for events.
    • A broadcast primitive to signal events and awake awaiting tasks.
  • Lexical Memory Management:
    • Even dynamic allocation is attached to lexical blocks.
    • Strict escaping rules to preserve structure reasoning.
    • Garbage collection restricted to local references only.

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
  • Expression based (statements are expressions)
  • Stackless coroutines (the basis of tasks)
  • Restricted closures (upvalues must be explicit and final)
  • Deferred statements (for finalization)
  • Exception handling
  • Dynamic collections (tuples, vectors, and dictionaries)
  • Hierarchical 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.

Manual

Install

  1. Install gcc and java:
$ sudo apt install gcc default-jre
  1. Install ceu:
$ wget https://github.com/fsantanna/dceu/releases/download/v0.1.0/install-v0.1.0.sh
$ sh install-v0.1.0.sh ./ceu/
  • You may want to
    • add ./ceu/ to your PATH
    • modify ./ceu/ to another destination
  1. Execute ceu:
$ ./ceu/ceu ./ceu/hello-world.ceu
[0,hello]
[1,world]

pico-ceu

The best way to try Ceu is through pico-ceu, a graphical library based on SDL:

  1. Install SDL:
$ sudo apt install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-gfx-dev
  1. Clone pico-ceu:
$ cd ceu/
$ git clone https://github.com/fsantanna/pico-ceu pico/
  1. Clone pico-sdl:
$ cd pico/
$ git clone https://github.com/fsantanna/pico-sdl sdl/
  1. Execute pico-ceu:
$ cd ../../ # back to your initial working directory
$ ./ceu/ceu --lib=pico ./ceu/pico/tst/par.ceu
  • Your directory hierarchy should become as follows:
+ ceu/
|---+ pico/
    |---+ sdl/

Resources

Contributors

fsantanna

Issues