>>850715 (OP)
the Borg method:
>download webkit
>build it
>build it, this time with superior lang embedded
>piecemeal-replace webkit with superior lang
>one (glorious) day webkit's original code is limited to some library wrappers and the important stuff is your own
requires good two-way communication between the host language and the new language, not simply an FFI.
in order for this to have any point, the superior language needs to be really superior. If you can just encode the old logic in the new language with no changes, then you'll end up having to fix the same security bugs in the new code.
language candidates:
1. ATS
2. ??? (dozens of languages with good enough C interop, but the languages themselves aren't good)
>but wait WebKit is written in C++
it's still possible
but have you considered replacing w3m instead?