Skip to content

Commit 6414933

Browse files
authored
Update in_browser_compiler.md
1 parent 347348e commit 6414933

File tree

1 file changed

+17
-38
lines changed

1 file changed

+17
-38
lines changed

software/in_browser_compiler.md

Lines changed: 17 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -13,66 +13,45 @@ lang: en
1313
## Overview
1414

1515
There are a number of different code editors for the micro:bit.
16-
Of the available editors; [MakeCode](https://makecode.microbit.org) and [Python](https://python.microbit.org) have an
17-
in-browser compiler. This means that when you hit the **Download** button
18-
to translate your code into a language supported by the micro:bit, all of the
19-
hard work takes place inside your web browser.
16+
Of the available editors; [MakeCode](https://makecode.microbit.org) and [Python](https://python.microbit.org) have an in-browser compiler.
17+
This means that when you hit the **Download** button to translate your code into a language supported by the micro:bit, all of the hard work takes place inside your web browser.
2018

2119
You can also use MicroPython offline by installing the [Mu editor](https://codewith.mu) on your computer.
2220

23-
The in-browser build process is useful, because you are not dependent
24-
on an internet connection in order to code and innovate with your
25-
micro:bit - once you have the web page open and the editor is cached
26-
on your computer, you can work independently of internet access.
21+
The in-browser build process is useful, because you are not dependent on an internet connection in order to code and innovate with your micro:bit.
22+
Once you have the web page open and the editor is cached on your computer, you can work independently of internet access.
2723

28-
By being web based, these editors allow you to write code for the
29-
micro:bit without needing to install any special software on your
30-
computer, which is especially important if working in a previously
31-
unused classroom, or on a public computer.
24+
Since they are web based, these editors allow you to write code for the micro:bit without needing to install any special software on your computer.
25+
This is especially important if you are working in a previously unused classroom, or on a public computer.
3226

3327
## How it Works
3428

3529
![img](/docs/software/assets/browser-build-pipeline.png)
3630

37-
The above diagram shows an example of how blocks code is converted into a
38-
.hex file that can be loaded onto your micro:bit
31+
The above diagram shows an example of how blocks code is converted into a .hex file that can be loaded onto your micro:bit
3932

40-
1a. Edit your script; this is automatically saved inside the web browser cache on your
41-
computer.
33+
1a. Edit your script; this is automatically saved inside the web browser cache on your computer.
4234

43-
1b. Press the **Download** button, and the script is first
44-
converted into javascript. The in-browser-compiler then converts it into Arm machine code instructions.
35+
1b. Press the **Download** button, and the script is first converted into javascript. The in-browser-compiler then converts it into Arm machine code instructions.
4536

46-
1c. The Arm machine code instructions are 'linked' with the Lancaster University
47-
runtime code, [the DAL](/software/runtime) and converted into an [Intel-HEX file
48-
format](/software/hex-format). This is done by ensuring that the in-browser-compiler knows the entry points
49-
of key functions that it needs to be able to call out into.
37+
1c. The Arm machine code instructions are 'linked' with the Lancaster University runtime code, [the DAL](/software/runtime) and converted into an [Intel-HEX file format](/software/hex-format). This is done by ensuring that the in-browser-compiler knows the entry points of key functions that it needs to be able to call.
5038

51-
2. You accept the download of the .hex file, which is stored in the filing system
52-
on your computer.
39+
2. You accept the download of the .hex file, which is stored in the filing system on your computer.
5340

54-
3. Download/Flash the .hex file onto the MICROBIT drive, and the interface
55-
processor on the micro:bit copies it into the flash memory inside the application
56-
processor. Your code now runs.
41+
3. Download/Flash the .hex file onto the MICROBIT drive, and the interface processor on the micro:bit copies it into the flash memory inside the application processor. Your code now runs.
5742

58-
Because code is compiled in-browser, the compiler needs to have a copy of
59-
the runtime/DAL code in order to create a complete distributable package.
60-
There is a pre-compiled copy of the runtime (DAL+Mbed) that gets loaded
61-
when you first load the editor.
43+
Because code is compiled in-browser, the compiler needs to have a copy of the runtime/DAL code in order to create a complete distributable package.
44+
There is a pre-compiled copy of the runtime (DAL+Mbed) that gets loaded when you first load the editor.
6245

6346

6447
## Other Features
6548

66-
MakeCode supports two-way conversion of code, so you can write code as blocks and
67-
see what the generated code looks like in Javascript/MakeCode Python. You can also write Javascript/MakeCode Python code, and if
68-
possible, MakeCode will convert this back into blocks automatically.
49+
MakeCode supports two-way conversion of code, so you can write code as blocks and see what the generated code looks like in Javascript/MakeCode Python.
50+
You can also write Javascript/MakeCode Python code and, if possible, MakeCode will convert this back into blocks automatically.
6951

7052
Makecode also allows you to [write your own block types](https://makecode.com/extensions) and [publish them as Extensions](https://makecode.microbit.org/extensions).
7153

72-
The Python web editor does not use the in-browser compiler. It only
73-
sits inside the frame of the website, but it gains access to the
74-
save and import functionality for saving and loading scripts
75-
to local files, and to and from a cloud store.
54+
The Python web editor does not use the in-browser compiler. It only sits inside the frame of the website, but it gains access to the save and import functionality for saving and loading scripts to local files, and to and from a cloud store.
7655

7756
Read more about how MicroPython works: [MicroPython on micro:bit](/software/micropython)
7857

0 commit comments

Comments
 (0)