You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: software/in_browser_compiler.md
+17-38Lines changed: 17 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,66 +13,45 @@ lang: en
13
13
## Overview
14
14
15
15
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.
20
18
21
19
You can also use MicroPython offline by installing the [Mu editor](https://codewith.mu) on your computer.
22
20
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.
27
23
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.
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
39
32
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.
42
34
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.
45
36
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.
50
38
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.
53
40
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.
57
42
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.
62
45
63
46
64
47
## Other Features
65
48
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.
69
51
70
52
Makecode also allows you to [write your own block types](https://makecode.com/extensions) and [publish them as Extensions](https://makecode.microbit.org/extensions).
71
53
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.
76
55
77
56
Read more about how MicroPython works: [MicroPython on micro:bit](/software/micropython)
0 commit comments