What is bootstrapping?
Asked Answered
U

15

823

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?

Ungotten answered 10/8, 2009 at 12:16 Comment(5)
According to Wikipedia, there are four uses of the word "bootstrapping" with regards to computing - en.wikipedia.org/wiki/Bootstrapping#ComputingJunno
I just updated HeDinges post with this. I was looking for some clarification on what form of bootstrapping Alex was looking at.Junno
In Software development it refers to the development of successively more complex, faster programming environments.Fluker
In .NET software development, my understanding is that it refers to the setup of the environment in which the application will run such as any services that need to be registered or loaded.Knisley
Im pretty convinced at this point that folks just enjoy the word and use it whenever they want to sound exciting when they really mean "set something up" or "initialize" something.Amoral
A
393

"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.

Annecorinne answered 10/8, 2009 at 12:21 Comment(5)
Correct me if I am wrong. Although this answer explains technical details of what bootstrapping can be, it never answered the original question within the context of the question.Complicity
@Complicity - How would you choose to answer this question? It's an idiomatic expression, and idioms are typically well-understood by the social group that uses them, and incomprehensible outside of it. I tried to answer by example, which I believe is one of the few ways to attempt to translate idiom.Annecorinne
Personally, I look at this question -- and the constant upvotes that I get for the answer -- as symptomatic of a bigger issue within the field of computer programming: a belief that there has to be a rational reason behind every term, every language feature, every design decision. The real world is a lot messier than that.Annecorinne
@kdgregory I wouldn't be able to answer this question as I came here to look for answers. I speculate that the word bootstrapping itself is a metaphor for several different technical concepts that are loosely related, which might be the source of confusion.Complicity
@Complicity - Sometimes a cigar is just a cigar.Annecorinne
K
349

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.

Kinlaw answered 10/8, 2009 at 16:13 Comment(7)
In terms of web development (which was the context of the original question), I think this is the best answer.Murk
Seems pretty related to Laravel, but Laravel was still not there in 2009.Geest
@Wajdan Ali No, this should not be the accepted answer. This is a microscopic view of a new use of the term bootstrapping, which some would argue is actually a misuse of a much earlier term. "To bootstrap" refers to pulling yourself up by your bootstraps, that is, to use the power of something to leverage itself. It is the origin of the term "to boot your computer." The current pop usage in web development is not the only (or the original) usage of the word. Many other answers address this appropriately.Rocker
@Kallaste, fine, but this is the answer I came looking for, and, based on the context of the original question ("application development"), it seems to be the most appropriate answer as already pointed out.Lilylilyan
@aaron.bynum, no, the answer given applies to web development frameworks, and definitely not application development. The answer is misleading and flawed, because it relies on a commonly held misunderstanding of what bootstrapping actually is and where it came from. It's just spreading misinformation. If that's what you came here looking for then fine, but SO as a whole values correct information. Thus my comment.Rocker
FYI, if you want to know what bootstrapping really is, you can look at Ivan Poliakov's answer below. It's actual bootstrapping.Rocker
Best answer so far. And Not just that you answered it in the web development context, I acutally wanted to understand it from a framework and php perspective. Thank youCopy
M
160

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.

Matriarch answered 18/12, 2017 at 17:58 Comment(6)
This really gets at the heart of the question. Where the other two answers, miss it completely.Rosco
I feel like this explanation was the most relevant to software development in general. Really brought the concept home for meLonee
In my humble opinion, this is the wrong context.Ecphonesis
Best answer for me, I was reading the design document of golang, and got confused with the term bootstrapping used there- in their case the question was how do we compile golang using a compiler written in golang. Well, this answers my question.Buskirk
How do you compile X if you need X? just take a look at guix guix.gnu.org/en/blog/2023/…Hers
Very good and important answer. Worth mentioning that the term "bootstrap(ping)" is also used to describe the situation itself where something depends on itself; eg. in statistics and (conventional) machine learning, or even in reinforcement learning, etc.Darleen
P
58

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."

Passant answered 10/8, 2009 at 12:18 Comment(3)
Could you please quote or paraphrase so readers won't have to traverse multiple websites to get their answer?Gasometry
"Software Industry, the: unique business of selling substandard goods legally, and charging for their upgrades."Pilferage
I was looking for an answer Bootstrapping in Compiler. This was helpful.Deshabille
S
31

In the context of application development, "bootstrapping" usually comes up when talking about modular and/or auto-updatable software.

Rather than the user downloading the entire app, including features he does not need, and re-downloading and manually updating it whenever there is an update, the user only downloads and starts a small "bootstrap" executable, which in turn downloads and installs those parts of the application that the user needs. Additionally, the bootstrap component is able to look for updates and install them each time it is started.

Samurai answered 10/8, 2009 at 12:29 Comment(4)
I never heard the term “bootstrapping” used in that particular context.Stepdame
Commonly used in regards to php applications (for instance using Composer to accomplish this)Amphistylar
@Amphistylar composer installs dependencies but it does not bootstrap your php application.Wilson
@DanielW. Yup, the whole definition is more confusing than helpful. Especially with a commonly used CSS framework named Bootstrap and an ML technique to reduce Decision Tree variance, Bootstrap Aggregation and some other definition in the context of BIOS bootloader. It is my opinion that this term should be avoided completely. :DAmphistylar
S
23

Alex, it's pretty much what your computer does when it boots up. ('Booting' a computer actually comes from the word bootstrapping)

Initially, the small program in your BIOS runs. That contains enough machine code to load and run a larger, more complex program.

That second program is probably something like NTLDR (in Windows) or LILO (in Linux), which then executes and is able to load, then run, the rest of the operating system.

Soundproof answered 10/8, 2009 at 14:8 Comment(1)
Although I read all of the answers (which expanded on the term well and I voted some up), this simple "booting" a.k.a. "bootstrapping" comparison gave me the best motivation to read all the others to connect the dots. Srsly, it was like explaining a complex topic to a 5 year old and they get it. Thanks.Manic
E
17

For completeness, it is also a rather important (and relatively new) method in statistics that uses resampling / simulation to infer population properties from a sample. It has its own lengthy Wikipedia article on bootstrapping (statistics).

Expatiate answered 10/8, 2009 at 12:26 Comment(2)
Relatively new? It was part of my statistics education at least 15 years ago.Pneumonic
Which is why I said 'relatively': Efron's initial articles are from the early 1980s as opposed to say the beginning of the robustness literature from the 1960s.Expatiate
L
5

Boot strapping the dictionary meaning is to start up with minimum resources. In the Context of an OS the OS should be able to swiftly load once the Power On Self Test (POST) determines that its safe to wake up the CPU. The boot strap code will be run from the BIOS. BIOS is a small sized ROM. Generally it is a jump instruction to the set of instructions which will load the Operating system to the RAM. The destination of the Jump is the Boot sector in the Hard Disk. Once the bios program checks it is a valid Boot sector which contains the starting address of the stored OS, ie whether it is a valid MBR (Master Boot Record) or not. If its a valid MBR the OS will be copied to the memory (RAM)from there on the OS takes care of Memory and Process management.

Luhey answered 8/9, 2015 at 10:31 Comment(0)
P
5

As the question is answered. For web develoment. I came so far and found a good explanation about bootsrapping in Laravel doc. Here is the link

In general, we mean registering things, including registering service container bindings, event listeners, middleware, and even routes.

hope it will help someone who learning web application development.

Phalan answered 13/2, 2021 at 6:56 Comment(0)
L
3

Bootstrapping has yet another meaning in the context of reinforcement learning that may be useful to know for developers, in addition to its use in software development (most answers here, e.g. by kdgregory) and its use in statistics as discussed by Dirk Eddelbuettel.

From Sutton and Barto:

Widrow, Gupta, and Maitra (1973) modified the Least-Mean-Square (LMS) algorithm of Widrow and Hoff (1960) to produce a reinforcement learning rule that could learn from success and failure signals instead of from training examples. They called this form of learning “selective bootstrap adaptation” and described it as “learning with a critic” instead of “learning with a teacher.” They analyzed this rule and showed how it could learn to play blackjack. This was an isolated foray into reinforcement learning by Widrow, whose contributions to supervised learning were much more influential.

The book describes various reinforcement algorithms where the target value is based on a previous approximation as bootstrap methods:

Finally, we note one last special property of DP [Dynamic Programming] methods. All of them update estimates of the values of states based on estimates of the values of successor states. That is, they update estimates on the basis of other estimates. We call this general idea bootstrapping. Many reinforcement learning methods perform bootstrapping, even those that do not require, as DP requires, a complete and accurate model of the environment.

Note that this differs from bootstrap aggregating and intelligence explosion that is mentioned on the wikipedia page on bootstrapping.

Lubet answered 31/1, 2018 at 10:27 Comment(0)
S
3

I belong to the generation who flipped switches to enter a boot program. In the early 1980s, I worked on a microcomputer called Micro-78, developed by Electronics Corporation of India Ltd (ECIL). It was a sort of clone of Altair 8800. I distinctly remember what happens when a small boot program was entered using the toggle switches and executed by pressing a button. The program reads a second boot program contained in the 1st track of the floppy disk and overwrites it on itself in such a way that the second boot program starts executing to load a disk operating system. I think the term "bootstrap" refers to this process of the first boot program reading and overwriting the second boot program on itself, in a way "pulling itself up" with the additional functionality of the second boot program. That may be the origin of the original meaning of "the bootstrap program".

Saxhorn answered 13/3, 2019 at 19:25 Comment(0)
S
2

In terms of it in regards to using the popular Twitter Bootstrap I feel like this type of bootstrapping is the action of integrating a modular component into a Web application without the Web application having to even acknowledge the modular component exists until it needs it or references it.

The developer can seamlessly integrate a default copy of the CSS Twitter Bootstrap theme by simply loading (referencing) it into the Web application. Vuola! Then you may need to override some of these changes, but you can do so in such a way that the resource/component is untouched and completely reusable.

This same concept is how Web Devs implement jQuery APIs and so on, but it's not really expressed by Devs as bootstrapping per se. What it does is it improves flexibility and reusability while allowing the isolation of different components/resources of an app to reside freely either on the same server/s or possibly on a CDN.

NOTE: In computing bootstrapping deals with the MBR and in UNIX it requires a special bootloader or manager which is a small program in ROM that loads the OS into RAM. If you think about it the same concept takes places in the action of the bootstrap loader checking the MBR and loading the OS based on this table which occurs without the OS having any idea that this takes place.

Slump answered 16/11, 2015 at 4:48 Comment(0)
A
2

IMHO there is not a better explanation than the fact about How was the first compiler written?

These days the Operating System loading is the most common process referred as Bootstrapping

Anne answered 31/12, 2015 at 18:12 Comment(0)
P
1

Bootstrap file is responsible for loading contents of main file. It is a wrapper around main file. This way we can catch errors if loading of file was unsuccessful for some reason.

Pinkeye answered 1/4, 2022 at 20:25 Comment(0)
B
-3

As a humble beginner in the world of programming, and flicking through all the answers here after seeing this word used a lot in apparently slightly different ways in different places, I found reading the Wikipedia page on Bootstrapping (duh! I didn't think of it either at first) is very informative to understand differences in use of this word. Could it be......on extremely rare occasions......Wikipedia might even have better explanations of certain terms than....(redacted)? Will they bring in rep points on Wikipedia though?

To me, it seems all the meanings something to do with: start with something as simple as possible Thing1, make something slightly more complex with that Thing2, and now you can use Thing2 to do some kind of tasks more efficiently and quickly than you could originally with Thing1. Then repeat from Thing2 to Thing 3 ad infinitum...

I see it as closely connected to both biological evolution and 'Layers of Abstraction' (newbies like me see, ahem, Wikipedia, cough) - the evolution from 1940's computers with switches, machine code, Assembly, C, Python, AIs you can give all kinds of complex instructions to like "make the %4^% dinner to my default &^$% requirements and clean the floor you %$£"@:~" in drunken slang English or Amazon tribal dialect without them 'raising an exception' (for newbies again...you guessed it) - missed out lot of links there due to simple ignorance.

Then in certain specific software meanings: Meaning1: Thing1 is used to load latest version of Thing2 (because of course Thing2 will be bigger than Thing1, just as Thing3 will be be bigger than Thing2).

Meaning2: Thing1 is a lower level language (closer to 1001011100....011001 than print("Hello, ", user.name)) used to write a little bit of the higher language of Thing2, then this little bit of Thing2 is used to expand Thing2 itself from baby vocabulary level towards adult vocabulary level (Thing2 starts to be processed, or to use correct technical term 'compiled', by the baby version of itself (it's a clever baby!), whereas the baby version of Thing2 itself could of course only be compiled by Thing1, cause it can't exist before it exists, right duh!), then child version of Thing2 compiles Surly Teenager version of Thing2, at which point programming community decides whether Surly Teenager's 'issues' (software term and metaphor term!) are worth spending enough time resolving to be accepted long term, or to abandon them to (not sure where to take the analogy here).

If yes, then Thing2 has 'Bootstrapped' itself (possibly a few times) from babyhood to adulthood: "the child is the father of the man" (Wordsworth, suggest don't try looking up the quote or the author on Stack Overflow).

Blakney answered 1/11, 2017 at 16:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.