I did a little game project recently in a new-to-me language. You’ve probably never heard of it.
It’s called Céu. The SDL bindings I used were added to the language super-recently. I wanted to try working in Céu as I’ve been learning about concurrency in Python, and making something in a language that is all about synchronous design and concurrency appealed to me. So it was an interesting and challenging experience to make a game in a couple days with these tools:
Céu is a young language, and there is sparse to no documentation for the SDL environment. There is a nice manual available online, and some academic papers. But both of those have to do with the Céu language more generally.
Error messages in Céu are not Googleable. You are not going to be able to find many helpful answers for issues that come up in Céu development on StackOverflow. There is a Google Group where Céu is discussed, the documentation mentioned above, and a Gitter chat group, but getting an immediate solution to a specific problem is tough using the usual tried and true method of a quick search.
Another error-related feature I take for granted is that the console error message will help me locate and track down bugs as I develop. But Céu has unhelpful console error messages. Console error messages provide a line number in Céu, but it is a wild goose chase. I am speculating, but I think the line number refers to compiled code. So it’s not much help in tracking down bugs, especially small syntactic errors like missing semicolons and
end. It’s not entirely pointless, as errors do at least tell you what issue you are looking for, if not where to find it.
On the plus side, there were twelve example programs that shipped with the SDL environment for Céu. Those were what I referenced whenever I wanted to get something accomplished. Still, there were some really hard problems - getting a string variable that would be updated with the score turned out to be a huge problem. After trying to get it working for a few hours (!), I worked around the issue of having a text variable rendered to screen with a graphical score display.
A lot of the language’s features were new to me. Such as:
This is what a helper function looks like in Céu:
And here’s what a class looks like:
The main feature of Céu is trails of execution, which are marked by blocks starting with
par/or, and connected blocks starting with
with. These trails execute in parallel, and allow the program to model simultaneous threads of logic waiting for multiple events. The three different parallel block keywords indicate different behavior when one of the blocks terminates, which you can see above in the Particle class example.
Céu provides parallel compositions to allow multiple lines of execution, aka trails, to coexist and wait for multiple events. The
await is available to suspend a trail and wait for an event from the outer environment that Céu is running it, and the
emit statement signals an output event back to the environment. Parallel compositions allow the code to wait for and react to multiple events from the environment and from the program itself really fast.
My finished program has some errors at compile time. The late frame warnings are because my antivirus is quite defensive about these programs, so nothing troubling there. But Céu warns me that I have tight loops, or unbounded loops.
Céu wants each path inside the body of a loop to contain at least one
break statement. This is to ensure that reaction chains never run in an arbitrary amount of time.
The compiler detects and warns when trails can run in unbounded time: loops that do not await or break, the so-called tight loops.
One way to rewrite the tight loops which Céu is warning me about would be Ceu’s
await async (variable) do. But the warnings do not negatively impact this small program, so it’s more of an imperative-programmer style incompatibility issue here. Something to overcome next time!
Overall, I really enjoyed working with Céu, and was proud of the end result in proportion to how difficult it was to develop without some of my usual toolkit. I particularly like how the language pushes the developer toward object-oriented design. I could easily see becoming a Céu evangelist; it is an amazing project, and the more I learn the more impressed I am. I’m looking forward to doing more with Céu soon!
The game itself isn’t super interesting, but there’s a gif of gameplay below. The source code is in this repo, and if you have a Windows environment, you can download the complied code there and play the game.