// an external input event channel
input int KEY;
// par/or concurrently executes two
// or more blocks (called "trails")
// if one of them terminates, the
// other trails are aborted.
// Compare: par/and, which waits
// for all trails to terminate
// before resuming code
par/or do
// an infinite loop that awaits
// a timer event. Therefore this
// trail never terminates by itself
every 1s do
// Ceu uses C as a host language
// and compiles to (essentially)
// a giant finite state machine
// C functions can be accessed
// using an underscore prefix
_printf("Hello World!\n");
end
with
// this trail awaits a keypress,
// then terminates, ending the entire
// par/or block.
await KEY; // awaits KEY input event
end
_printf("Bye!\n");
The above code prints "Hello World!" ever second, until a key is pressed, after which it prints "Bye!" before terminating the program.The reactivity and intuitive single-threaded concurrency makes it a really nice language for low-powered devices. Or robotics, which is a lot about reacting to sensor input.
It has a dedicated Arduino repo too[1].
In practice it's more of a research language by Francisco Sant’Anna, a professor at UERJ, Brazil, than a language with a big community around it. He's currently working on a new version caleld Dynamic Ceu, or dceu[2]
In the same paradigm there is the Blech[3] language, I believe originating from Bosch. Sadly, that project also has lost some steam.
[0] https://github.com/ceu-lang/ceu-arduino