3 ms·
As always when this topic comes up, I have to plug Ceu[0] (formerly Céu) and the programming paradigm it represents. It doesn't use coroutines but synchronous c
by vanderZwan 3y ago
As always when this topic comes up, I have to plug Ceu[0] (formerly Céu) and the programming paradigm it represents. It doesn't use coroutines but synchronous concurrency. On top of that it's a reactive language:
// 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 https://github.com/ceu-lang/ceu-arduino
[1] http://ceu-lang.org/ http://ceu-lang.org/
[2] https://github.com/fsantanna/dceu https://github.com/fsantanna/dceu
[3] https://github.com/blech-lang/blech https://github.com/blech-lang/blech
- syncurrent 3y agoRight, imperative synchronous programming simplifies real time processing a lot. Somehow it does not get the attention it should, which is IMHO due to the fact that it is not available in common programming languages. This is why I tried to create DSLs for C and Swift so that more people could potentially play around with that. https://github.com/frameworklabs/proto_activities https://github.com/frameworklabs/proto_activities
- vanderZwan 3y agoOooh, this is delightful, thank you for sharing!