Lecture 21

Software licensing

MCS 260 Fall 2020
Emily Dumas

Reminders

  • Quiz 7 due today
  • Quiz 8 coming soon
  • Multiple quiz work sessions OK
  • Worksheet 8 available
  • Project 3 description to be released on Friday
  • Interpreted vs compiled languages

    Python is primarily an interpreted language, meaning that you write a program in the language, and then another program (e.g. python.exe) reads and executes it.

    In Python, distributing your program typically means distributing the .py files you wrote (the source code).

    No OS can run .py files directly.

    C and C++ are compiled languages, meaning that you write a program in the language, and then a program called the compiler translates this source code into an executable, a file the OS can execute directly.

    E.g. the compiler turns prog.c (source code) into prog.exe (executable).

    You can distribute an executable without sharing the source code.

    Caveat about Python

    Python actually interprets programs in two steps. First they are converted to a compact representation (bytecode). Then, another part of the interpreter runs the bytecode. The interpreter is required for each step.

    This means you can distribute bytecode (.pyc files) instead of source code.

    Warning

    The rest of this lecture talks about laws in the USA, but it is not legal advice. I am not a lawyer.

    Copyright

    Copyright is a set of protections granted to authors of "original works" for a certain time after creation.

    Software in source code or executable form is protected by copyright. The creators of the software are considered the authors.

    Key point: Software you write is automatically and immediately protected by copyright.

    Copyright provides the authors the exclusive right to:

    • Reproduce the work
    • Make derivative works
    • Sell copies of the work
    • Authorize others to do things that would otherwise be prohibited by these protections
    • Transfer ownership of copyright to another person or entity

    If you find some code on the internet and there is no accompanying information that grants you permission to do the things below, then they are typically prohibited:

    • Distributing the code
    • Modifying / using the code in your own program

    Software Licenses

    A software license is a document that grants a person, group, or entity rights to use a piece of software in certain ways.

    Usually a license will permit certain actions that would otherwise be prohibited by copyright protections.

    Whenever you find a program or source code file on the internet, look for a license that applies to you!

    Licensing example

    I write an inventory management program in C++.

    I license the executable to everyone to use and distribute, but I do not share the source code.

    For a fee, I license the source code to one company so they can modify it for their own purposes.

    Open source

    An important class of software license is an open source license, which grants anyone permission to:

    • See the source code
    • Distribute the software and source code
    • Make derivative works

    (Other actions may still be restricted.)

    There isn't universal agreement about the definition of "open source", but the definition from the Open Source Initiative is often used.

    Software that is not open source is proprietary.

    Some popular licenses

    • Public domain declaration - Declares that the copyright owner waives all exclusive rights afforded by copyright. Most permissive license possible.
    • MIT License - Very permissive. Only requires that a statement about the copyright ownership be included in all derivative works. Derivative works can have different licenses (e.g. may be proprietary).
    • GNU General Public License (GPL) - More restrictive than MIT; distribution of a derived work is only allowed if no additional restrictions are applied. In particular, every derived work must be open source.

    Examples

    • The Python interpreter is open source. Its license is less restrictive than GPL.
    • Linux is open source, licensed under the GPL.
    • Microsoft Windows is proprietary.

    References

    Revision history

    • 2020-10-11 More refs and reminders
    • 2020-10-10 Initial publication