7–11 Apr 2025
ISIS Neutron and Muon Source
Europe/London timezone

Thoughts on improving programming practices in EPICS

9 Apr 2025, 10:00
20m
Pickavance Lecture Theatre/Visitor Center (ISIS Neutron and Muon Source)

Pickavance Lecture Theatre/Visitor Center

ISIS Neutron and Muon Source

Rutherford Appleton Laboratory Harwell Campus, Didcot Oxfordshire, OX11 0QX. UK
Standard Talk EPICS Core EPICS Plenary Session

Speaker

Jure Varlec (Cosylab d.d.)

Description

For years now, the push to adopt memory-safe languages in lieu of C and C++ has been growing steadily. On the management side, it was spurred by various government-issued orders and directives. Among programmers, it was spurred by appearance of Rust as a viable contender to replace C++. The "rewrite the world" trend is going strong. However, there are open questions on how to transition an entire ecosystem, especially one such as EPICS where backwards compatibility is a high priority. It seems inevitable that introducing a memory-safe language into EPICS core is going to be a slow process.

Using a modern memory-safe language improves the quality of software because, unlike C/C++, both the language and the library ecosystem force the programmer to adopt practices and a mindset that are quite different from those of traditional C++. I would like to put forward the notion that modern C++ allows the programmer to adopt such a mindset as well, with the advantage of excellent backwards compatibility afforded by C++. To demonstrate that, I present three examples, ranging from a humble scope guard (a small utility for managing resources when interfacing with legacy C code), through a different take on managing inter-thread locking (a demonstration of a change in mindset), to a re-imagining of the user-facing API for the aSub record.

Primary author

Jure Varlec (Cosylab d.d.)

Presentation materials

There are no materials yet.