Abstract A new generation of software-based protection systems for high-performance trains has been designed during the last 10 years. The first application is now in operation on the Paris heavy-rail RER, a line with a peak capacity of about 800 000 passengers per day. In this project, the new protection system performs a full overlay of all train protection functions, with the ability to reduce the headway between trains while permanently monitoring train speed. The software is wholly written in modula-2 and represents 20k source lines for the application. This software is safety critical and required (including the development of specific software tools) 1000 man-months for specification and implementation. The paper illustrates the use of modula-2 for the development of safety-critical applications.