by Accipitriform · 8y ago · 0 comments
No. Julia is a general purpose language that has so far been mainly focused on scientific and mathematical programming.
It's design is probably least friendly to the real-time programming domain (GC based) but it can apparently be used there as well:
I see an extremely bright future ahead for Julia!
https://github.com/JuliaRobotics/RigidBodySim.jl/blob/34ac43...
Notice that this function is purposefully sleeping the differential equation solver in order to slow it down to the exact amount to get the simulation back to real-time.
You can see how much extra time is left for that frame at the targeted frame rate, then sleep for that amount of time.
Then you never have to slow down anything else, you can set a maximum amount of cycles per second and you can sleep once per cycle. The faster the CPU, the less power it should use.