Did anyone ever try to write philosophy in verse?
Anyone in any tradition, which makes the question v broad but thanks.
Boethius's The Consolations of Philosophy (6th century AD) was written in alternating prose and verse. It was translated to English from the Latin by H.R. James (1897). Here is one translated excerpt, part of a poetic exposition of Plato's theory of Recollection.
Whence he who yearns the truth to find
Is neither sound of sight nor blind.
For neither does he know in full,
Nor is he reft of knowledge quite;
But, holding still to what is left,
He gropes in the uncertain light,
And by the part that still survives
To win back all he bravely strives.
Alexander Pope's Essay on Man puts philosophical and cosmological arguments in English heroic verse. He would not have claimed to be the philosopher, however, but instead a poet rendering others' ideas in verse.
Many, indeed most of the pre-Socratics. Parmenides, Heraclitus, Empedocles.
Perhaps the most influential versifier in philosophy was the Roman atomist Lucretius, whose "On Nature" was recovered by the Renaissance, where it influenced proto-scientific thinking. In a sense, Nietzsche's "Zarathustra" aspires to the mytho-poetic. Perhaps the last in the "naturalist" tradition was Erasmus Darwin, Charles's father, who penned an early version of evolutionary theory in rhyme.
Of course, one might describe certain poets, from Sophocles or Ovid to Holderlin or Eliot as philosophers of a sort. There were probably poetilogical hybrids in late German idealism. Heidegger can seem like "poetry as philosophy," while Wallace Stevens might qualify as a practicing Heideggerian phenomenologist. His "jar in Tennessee" is akin to Heidegger's world-founding object, the Greek temple.
My own belief is that the tradition of metered, speculative effusion has waned in modern times because so few words rhyme with cogito, epistemology, and ding-an-sich.
There is, in it, much of a religious nature toward the end. The author moves from a tone of wisdom and life experience to one of abject worshipfulness as the text proceeds. Just a word of warning.