How bad is type piracy actually?

Occasionally there are some really good reasons to pirate. From Julia’s documentation:

Another example might be a package that acts as a thin wrapper for some C code, which another package might then pirate to implement a higher-level, Julia-friendly API.

The “FriendlyWrapper.jl” package would implement Base methods (which it doesn’t own) on “Wrapper.jl” types (which it doesn’t own). The person who wrote Wrapper.jl might want to keep the code “lean” and only support the API that s/he’s familiar with from C, which is that person’s prerogative. But someone who wants a more Julian interface should not be forced to re-wrap the base C library just to support a more comfortable interface for people coming from the Julia world.

This comes up in practice. Many widget toolkits (e.g., Gtk.jl) are pretty huge on their own, but people also want to combine them with Observables.jl/Reactive.jl/whatever to build a nicer GUI programming workflow. It’s OK to write glue packages that bring together multiple components of the ecosystem and effectively create something new.

11 Likes