I don't actually know what a self driving car should run on, I would want to make it in Erlang or Rust but - what do you think a self driving car should be running on?
It takes around 100 - 400 msec to blink, so an occasional 200msec GC pause doesn't sound too bad. Though I'd sure hate to be in a car that gets stuck in a 15 second full GC freeze.
> occasional 200msec GC pause doesn't sound too bad
I guess you never used Windows.
But seriously occasional 200ms pause is in ideal scenario if you have some kind of memory leaks those might become longer etc.
Hard RT system has defined hard deadline for every operation and if it says it needs to react within 200ms it will or it will be considered a failure of the system.
This might not be obvious to many people, but as cars becoming more computerized you no longer directly control it, for example when you press a brake, it is not directly connected to car's brakes by steel line, instead it is just sending signal to braking mechanism. That system is hard real-time, and it is designed so if you press a brake, the car has maximum time it needs to react to that. There is no excuse to do it later, because it was doing something else at the time.
Same thing should be with autonomous driving. It absolutely HAS to react before a deadline.
Actually lets assume the GC will always take at most 200ms and the component needs to react within 300ms, if that can always satisfied then you can call the system a real time system.
The problem with GC is that typically you can't guarantee that it will finish in 200ms or even 400ms. You can see this quite often with our desktop computers and servers which are not RT and many times you see a slow application or not responsive.
The difference here is that that when GC is taking its time, your website might have slower response, it might get you annoyed, maybe it will even make you swear at the developer of the application/system. When this happens to a car, someone gets killed.
For real-time embedded there are basically 3 options, C, C++ and Rust. And Rust isn't that widely used, so my guess would be on C/C++. You can't have a GC.
True, I forgot about Ada. While ugly, Ada2012 is a very modern language with a lot of benefits compared to C, especially for embedded control systems programming.
Ada got a bad rap in the past and didn't spread very wide outside US military circles. But it is a very good language. For adoption today it would need some big backing though.
Hard real time system. Meaning every operation has a hard deadline and the car absolutely needs to react before then. No unknown delays because of garbage collection etc.
Sadly, I suspect that most of these self driving cars don't do that, because RT is hard.
I'm only half joking.