API Background of Google v. Oracle

Decentralizing Data Governance Summer Privacy Institute, 2023

Understanding APIs (“application programming interfaces”) is important for understanding the Google v Oracle litigation, and its implications for interoperability.

An API is a general concept:  It refers to the way that two programs talk to each other, or how a programmer might use other software in their own applications.

For example:  the Facebook mobile app communicates with Facebook’s servers via an API.  This is a private” API, in that Facebook does not allow third-party Facebook apps.  You often hear about private” vs. public APIs in the interoperability context.  For example, when a software program from Apple can do things on the iPhone that third parties cannot, it is often because Apple is using a private API.

Twitter used to have an API that it used for its own apps, and allowed third parties to use.  Then (long before Musk) Twitter started putting new functions only in its private API, and limiting the use of the public API, until early this year it cut off third-party Twitter apps entirely.

An API is in essence a protocol, or a method of communication.  A sort of call-and-response. One way that APIs are useful is in allowing programmers to use pre-built building blocks in software instead of having to re-invent everything from scratch. For example, a Mac app does not need to devise from scratch how to create a text-editing field or display an image. There are pre-written building blocks for this, and they are called” via an API.

An API can provide fairly basic functionality as well.

The API at issue in the Google v Oracle litigation relates to how programmers use basic features of the Java programming language.  Different programming languages make different choices about what features are built in to a language, versus what features are part of a library.”  Very basic functions will be built-in, but others rely on pre-built building blocks that combine those basic functions.

Let’s take a simplified programming language where addition is built in, but not multiplication.

In this pseudo-code, a program to add two numbers could be:


sum = 5 + 3
print sum

This program would print out 8” for us.  Very handy.

But, this programming language for some reason does not have multiplication. Multiplication is just repeated addition, so we can use the building block we already have—addition—to define a function.  Computer programmers define functions all the time. A basic function like this would be set out in a different computer program called a library” that defines many functions. The programmer would then indicate Hey, I am going to use the functions defined over here.” A computer program that defines a bunch of functions is called a library.”


# Declaring code tells other programs how to interact with the function. It defines how the function is used:  the programmer would use the command “multiply” followed by two values in parentheses. 

function multiply(a, b)

# This is the implementing code, which performs multiplication via repeated addition.

function multiply(a, b) {
    result = 0
    for i in 1 to b {
        result = result + a
    return result

To make use of this function in a program, a developer would import” the library that defines it. The function can then be used like other commands can.


# First, we have to tell our app that we will be using the function defined elsewhere.  


# Now, our app knows about the “multiply” function.  So, we can use it.

product = multiply(5, 3)
print product 

We now have a program that prints out 15.” Cool!

Obviously the software at issue in the Google v Oracle case is much more complex. But the distinction between declaring and implementing code, and why Google would want to copy the declaring code, can be seen with these examples.

First, the case is not about the copyrightability of the Java language per se. There are complex issues to think about when it comes to the copyrightability of a programming language considered in the abstract. But generally speaking, merely writing a program in a programming language is not considered to infringe on any IP rights. Similarly, writing a new compiler” for a language is not considered to be infringing. A compiler is the software program that translates human-written code into machine code. There are analogies here to how facts, sequences of instructions such as recipes or rules for a game, etc, are not protected by copyright.

Rather, the litigation was about Google’s copying of declaring code.” In our examples above, let’s say that Google want to create its own version of my fake programming language. It would like it so that existing programs written in that language can run on its implementation. The copyright issue arises because to make sure that this can happen, it’s not enough to make sure that building block” stuff like addition works the same way. You want to make sure that programs that call functions like multiply” don’t need to be rewritten.

To do this, it’s necessary for Google to copy my declaring code. That’s the code that actually defines the API—how the function is called. But how the function works under the hood can be different.


# Declaring code tells other programs how to interact with the function. It defines how the function is used:  the programmer would use the command “multiply” followed by two values in parentheses. This declaring code has to be identical to create a compatible function.  

function multiply(a, b)

# By contrast, implementing code can be very different.  All that matters is that it provides the same result.  Here is declaring code that performs addition a different way:  through doubling and halving.

function multiply(a, b) {
    result = 0
    while (a > 0) {
        if (a is odd) {
            result = result + b
        a = a / 2
        b = b * 2
    return result

# Here's the same declaring code yet again.

function multiply(a, b)

# Here the function is defined yet another way:  repeated addition using recursion, rather than looping.  This shows that while there is room for more creativity and variation in implementing code, declaring code always has to be the same for compatability.

function multiply(a, b) {
    // Base case: if b is 0, the result is 0
    if b equals 0 then
        return 0
    // Recursive case: add a to the result of multiply(a, b-1)
        return a + multiply(a, b-1)

Copyright nerd aside: In the toy example here, the way the function is defined is so straightforward that there are obvious arguments to make about copyrightability from an originality standpoint (or merger doctrine, or scène à faire), as unprotectable short names or titles, or under some of the theories discussed in Judge Alsup’s original opinion about functionality and methods of operation. I still think those approachs are better than having to jump to fair use, but due to how the Federal Circuit handled the case those issues never made it to SCOTUS.

Code that calls the multiply function will work the same way whether it is using the first, second, or third function. (Ideally the import” command would be the same too, and these functions would be defined in big libraries called things like math.”)

The dispute in the Google v. Oracle case boiled down to whether copying declaring code like function multiply(a, b)” was allowed. There was litigation about whether this code should be protectable by copyright at all, and then, if it was, whether copying it was fair use. Ultimately, the Supreme Court decided that copying this kind of declaring code was a fair use, in part because of how it enabled competition and interoperability.

June 4, 2023

Acid Tracks.

May 30, 2023

VCR+ was a great hack.VCR+ was a great hack.

May 19, 2023

Box with Holes

first published June 9, 2014.

This is my concept for a house called the Box with Holes.

Imagine a house. It would be a concrete cuboid with no support walls. It would have various door-shaped holes in it at various points at ground level. You could use those holes to install door or window modules. So you could have a normal window if the bottom of the unit you install into the standard hole is solid. Or you could have a french window. It is key that all the holes in the box be uniform.

Here is a quick floor plan:

|      |
|      | 
|      |

Side view with example holes:

|   _      _   | 
|  [ ]    [ ]  |
|  [ ]    [ ]  |

There would be some system of movable walls but these would not be structural.

The house would have no plumbing, heating, electricity, or communication wires installed as part of the design. Rather, these would run through ducts attached to the walls and ceiling that can be changed out/upgraded, or rearranged over time. The walls must all be solid, and the movable walls will have to make allowances for shifting ductwork.

If there are multiple floors or a basement access to them would be through a standard hole in the floor (which, when not in use, would be plugged with a standard hole plug module). You could attach a spiral staircase or descending ladder to allow access (or, outdoors, a tenement-style staircase for access to upper floors).

Utility access to the house would also be through a standard hole. Items like a central air conditioner or water heater could be located in a cabinet outside the box, or in the basement, with access between the basement and the other floors through pipes in ducts that go through standard holes.

May 19, 2023

Yip, Yap,
Arf, Woof
Bow Wow Wow
Wish that dogs
Just said Me-ow.
What a racket
All night long
Wish they’d stop
Their barking song.
Yip, Yap,
Arf, Woof
Bow Wow Wow
Wish that dogs
Just said Meow.”

— Peppy Puppy Songs. If you know, you know.

May 19, 2023

blog post about social security.

(blog post from 2018 that annoyed some people. links are broken but who cares.)

I think it is unfortunate that so many people view Social Security retirement benefits as a savings” program rather than a welfare program, largely because it allows them to psychologically differentiate between the good” government checks they do (or will) receive and the bad, nasty welfare checks that moochers get. So I would rather that people thought of Social Security as welfare” not to stigmatize it but rather to de-stigmatize other government programs. And it’s not like I’m the first person to make this observation.

Many of the reactions to this involve weird insults that assume I am making the common right-wing move that welfare = bad, therefore Social Security = bad, and honestly I can see the confusion there. Maybe the cause of rehabilitating the word welfare” in the American mind is hopeless and I should pick a different word. See the final paragraph.

As to substantive disagreements, the two that I have seen (online and in person) are 1) No, it really is a savings program, and 2) No, it’s actually a form of insurance. I don’t think these are merely definitional quibbles, either, since I think there are actual factors that meaningfully distinguish savings and insurance from Social Security.

not savings

To respond to the it’s really savings” argument, it’s usually enough to point out that current retirees are paid by current workers, that Social Security checks started being cut right after the program was passed and before anything could have been saved” individually or socially, and that the program is (mildly) progressive–that is, the lowest quintile of earners are typically paid more in benefits than they paid in taxes, and the highest quintile of earners pay more in taxes than they receive in benefits. This is handy estimate of taxed paid vs. benefits received for different a demographics and age cohorts.

That said, it is only mildly progressive:

Results show that the Social Security program is modestly progressive on a lifetime basis, about halfway between a pure DC program and a program paying a flat-dollar benefit.

If I were designing a program it would be much more redistributive! And considered alone, payroll taxes are somewhat regressive, since they’re capped, and the amount that a retiree is paid does, in part, reflect past earnings (and thus taxes paid). Also, for the most part you have to have paid payroll taxes to get Social Security later–with some major exceptions, as it is also possible to receive retirement benefits without having worked at all. While it is not perfect considerations of social equity are built into the program that are not typically associated with savings” programs.

Taking all this into account Social Security does not look very much like a savings plan, but like a welfare program that was designed to be only a little bit redistributive, and to have broad popular support. The fact that you are in a sense owed” social security payments in the same sense that your bank owes you your savings does not make it into savings either. My assets may be someone else’s liabilities but this does not mean that if the government declares that I am owed something that I have thereby saved anything.

There are some other arguments that Social Security is a form of savings. One is that any government plan that most pay into, and most collect from, is a form of savings,” regardless of the disconnect between the payments and benefits. (Maybe add on to this the bookkeeping maneuver of the Social Security Trust Fund, whereby the government is required to pay back money it borrowed from itself.) The problem with this argument is that it proves too much: Is any government program that I pay taxes for, and hope to benefit from, really a form of savings? Is any inter-generational social program really a form a savings? Would it still be plausible to claim that Social Security was a form of savings if it was funded via normal income taxes and if equal benefits were paid to all the elderly regardless of their previous work history? In this latter case, if not, I wonder where the line is that transforms a program from being a straight-up government transfer program to an esoteric form of savings.

In short I think to meaningfully be a savings program Social Security would have to work more or less like many people think it does–that is, that you pay into an account with your name on it, that you then draw out from (with interest). And when it runs out, it runs out. That would be a suck-ass program but it would be savings program for sure.

The fallback position here is, I suppose, to say that it’s a social savings program, not an individual one. But at this point this just sounds like another word for either insurance, or welfare.

not insurance

A number of economists who realize that Social Security can’t be accurately described as savings” instead maintain that it is a form of insurance.

To be fair it’s also right there in the name.

This is an interesting way of looking at things but in the end I think it is wrong. You insure against risk, spreading it around a population. If you’re lucky, you pay more in premiums than you get in benefits because needing insurance benefits is usually associated with something bad happening.

But getting old is not a risk,” it’s inevitable, unless of course you die first. It’s something to plan for, not something to insure against. If you do not receive retirement payments, again it is likely because you have died. Not great.

(It is true that many important insurance programs need nearly everyone to pay in, and shouldn’t allow people to opt out of paying premiums, because that defeats the whole point. But then this is also true of taxes that fund welfare programs.)

Mark Thoma writes that Social Security is mainly a means of insuring against economic risk. It is fundamentally an insurance program, not a saving program, and as such it is not mainly welfare.’”

This sounds like an excellent idea for a social program but it doesn’t describe Social Security as it exists, which pays benefits regardless of need. It’s like a fire insurance program that pays you whether or not your house burns down. (He does try to address this argument, making correct observations about political realities and buy-in, but it is those very realities that transform the program into what it is, mildly redistributive welfare, and what make it no longer insurance.”). This of course points to a major rhetorical danger of the insurance” framing, which is that it immediately suggests means-testing as a common sense cost-saving measure. Compared to that, savings” is probably a better framing!

Elsewhere he writes,

When I think of welfare, I think of pure money transfers from one group to another without any economic basis for the transfer. In such cases, one person’s gain arises from another’s loss.”


There is an important distinction between needing insurance ex-ante and needing it ex-post. Insurance does redistribute income ex-post, but that doesn’t imply that it was a bad deal ex-ante (i.e., when people start their work lives).

Thus, by this definition, farm subsidies are welfare. Steel tariffs are welfare. R&D tax credits are probably even welfare, and so is AFDC. All of these are pure ex-post redistributions. That is fundamentally different from the purchase of insurance.

But AFDC (TANF, really) could also be seen as a form of economic risk insurance. In fact it likely has more of a claim to being insurance” than Social Security, since it is more about actual risk (losing one’s job and savings) than about a near certainty (growing old). Similarly farm subsidies could be described as a form of insurance” designed to stabilize domestic food supplies, etc.

welfare is the catch-all

To me this leaves welfare as being the accurate word to describe what happens when the government taxes B to pay A. I don’t think the fact that the government also promises that later it will tax C to pay B changes very much, as typically governments at least promise to provide some sort of benefit to taxpayers in terms of lighthouses, libraries, and riot police.

I don’t think it works to say that it’s only welfare” if the payment is based on need, as that deprives us of terms such as corporate welfare,” but if that’s the working definition then sure, Social Security is not welfare (in addition to not being savings or insurance). Entitlements” has been spoiled so maybe we can go with benefits.”

May 19, 2023