What is bootstrapping?

I keep seeing "bootstrapping" mentioned in discussions of application development. It seems both widespread and important, but I've yet to come across even a poor explanation of what bootstrapping actually is; rather, it seems as though everyone is just supposed to know what it means. I don't, though. Near as I can figure, it has something to do with initialization tasks required of an application upon launch, but I could be completely wrong about that. Can anyone help me to understand this idea?


"Bootstrapping" comes from the term "pulling yourself up by your own bootstraps." That much you can get from Wikipedia.

In computing, a bootstrap loader is the first piece of code that runs when a machine starts, and is responsible for loading the rest of the operating system. In modern computers it's stored in ROM, but I recall the bootstrap process on the PDP-11, where you would poke bits via the front-panel switches to load a particular disk segment into memory, and then run it. Needless to say, the bootstrap loader is normally pretty small.

"Bootstrapping" is also used as a term for building a system using itself -- or more correctly, a predecessor version. For example, ANTLR version 3 is written using a parser developed in ANTLR version 2.


An example of bootstrapping is in some web frameworks. You call index.php (the bootstrapper), and then it loads the frameworks helpers, models, configuration, and then loads the controller and passes off control to it.

As you can see, it's a simple file that starts a large process.


The term "bootstrapping" usually applies to a situation where a system depends on itself to start, sort of a chicken and egg problem.

For instance:

  • How do you compile a C compiler written in C?
  • How do you start an OS initialization process if you don't have the OS running yet?
  • How do you start a distributed (peer-to-peer) system where the clients depend on their currently known peers to find out about new peers in the system?

In that case, bootstrapping refers to a way of breaking the circular dependency, usually with the help of an external entity, e.g.

  • You can use another C compiler to compile (bootstrap) your own compiler, and then you can use it to recompile itself
  • You use a separate piece of code that sets up the initial process without depending on any functions provided by the OS
  • You use a hard-coded list of initial peers or a hard-coded tracker URL that supplies the peer list

etc.


See on the Wikipedia article on bootstrapping.

There is a section and links explaining what it means in Computing. It has four different uses in the field.

Here are some quotes, but for a more in depth explanation, and alternative meanings, consult the links above.

"...is a technique by which a simple computer program activates a more complicated system of programs."

"A different use of the term bootstrapping is to use a compiler to compile itself, by first writing a small part of a compiler of a new programming language in an existing language to compile more programs of the new compiler written in the new language."