Write your stored procedures in any language you like. Postgres supports pgSQL, Tcl, Perl, and Python out of the box, with third-party bindings for some other languages.
When procedural coding is necessary, use a procedural language, in your stored procedures. What's the problem?