Lean4 is a general purpose programming language.
Have you tried writing any programs in it?
I don't see why it would be particularly difficult beyond not already having a lot of IO libraries (like Kafka connectors or whatever). Pure functional programming in Scala with IO monads is quite pleasant.