Skip to main content

CALF: C++ ACTOR LIGHT FRAMEWORK

 

Recently I found myself writing a self-contained server-based traffic management software service. This harvested traffic data from a TomTom navigation API. It then used Artificial Intelligence to “learn” from that information and decide on how to advise users. This product made it into the renowned Cape Breton Spark competition, which was a great experience. Since then the project has stalled, but I’ve decided to open-source a part of it in the hopes other people may use it in one of their future projects.

THE PROBLEM

Gathering data over a network and processing it is very asynchronous and the problem lent itself to a simple actor framework. This is a paradigm that’s commonplace in languages such as Erlang, Smalltalk, Go, and others, but I wanted to use C++. My language choice was made based mainly on wanting to hit the ground running and my previous experience in C++ would make that a lot easier. Others too, I’m sure will find themselves in that boat.

THE ACTOR FRAMEWORK

I did a little research and found the credible CAF: C++ Actor Framework project. This, for me, was overkill. It required C++14 and had a lot of baggage. More functionality typically comes at a price: often performance, more often maintainability, breaking changes, bulky prerequisites such as boost, etc. I found other platforms I could use too, such as those in the Apache foundation, but they suffered similar shortcomings, for my project at least.

CALF

So I wrote my own. I wrote the application with the actor framework in separate files to the business logic, so that I could reuse the platform for other future projects. And then I decided to open-source it. My own projects continue to benefit from the generosity of open-source developers, so this is a very small payback, for anyone who stumbles across it and finds it useful.

calf-source on github

Good Luck

SG

Comments

Popular posts from this blog

THE VALUE OF DATA

  Every organization has data, whether they know it or not. A company’s data is their second biggest asset (staff, data, customers, other assets). Without data, how do you make decisions? How do you chose what areas to focus on, what department to grow, which customers need another visit, where your strengths and weaknesses are? Lots of firms neglect their data, leaving it to languish in old computer systems or worse still, paperwork, when they should be making it work for them. It should be updated continuously and used to generate valuable reports for management and staff. WHAT IS JOINED-UP DATA? You’ve probably heard of the phrase joined-up thinking. Well, joined-up data is really the same thing: different departments having a free exchange of data. An example of a system with joined-up data would be the following: Imagine a railway company. One computer system holds the track information – lengths, junctions, stations – in a  GIS  database. Another system handles...

LEARNING COMPUTER CODING

  Many people tell me that they would like to learn programming, and ask my advice on how to get started. I started programming so long ago — constructing BASIC programs on a BBC micro at primary school in the eighties — computing has obviously changed considerably since. Even the term programming is broader. There are many different ways to introduce yourself to programming, some of which I approve of, some I would not recommend. If you’re thinking of dipping your toes into coding, which technologies you start to learn, largely depend on what programming you want to do. I’ll try to give some general advice, based on over thirty years of programming in different languages, to help you decide if software engineering is for you. Programming can be rewarding and a lot fun. It can also be frustrating, so it’s important you have a positive initial experience. As for many new things in life, things worth learning aren’t easy, so allow yourself to struggle and fail occasionally. The good ...