Why Rewrite Libraries in Multiple Programming Languages

librariesprogramming-languages

There are some libraries, which are available in their versions written in many different programming languages, like for example Lucene, which is written in Java (as they say, 100% pure Java), but has also its versions in C++, C, Perl, Ruby, Lisp and some other languages. And I'm talking about implementations in these languages, not just FFI interfaces.

Why do people do that? I can see one obvious reason: deployment and distribution (and probably development as well) easier when a project has fewer dependencies. But is there anything else? In what situations is it worth it?

Best Answer

Some reasons I've done it (rewrite C code in Haskell, in my case):

  • easier deployment: one build chain only
  • fewer dependencies (to gain more adoption)
  • more portable (e.g. to Windows) if the code is in a high level language
  • to add support for parallelism not easily done in low level C
  • to make the code a bit safer with its resoures
  • to make the code easier to trust
  • more idiomatic (strong types, simpler API, more reuse)
Related Topic