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
<p>Why not "view-source" and see for yourself?</p>
64
-
65
-
<h3>What?</h3>
66
-
<p>The initial version of PyScript, demoed
67
-
<ahref="https://www.youtube.com/watch?v=qKfkCY7cmBQ">in a keynote address
68
-
by Peter Wang</a> at PyCon 2022, built on the amazing
69
-
work of the <ahref="https://pyodide.org/en/stable/">Pyodide</a>
70
-
project. But Pyodide isn't the only Python runtime, compiled to WASM, that
71
-
could be used for this purpose.</p>
72
-
73
-
<p>These pages are a technical demonstration, proof of concept and
74
-
playful exploration of how PyScript may work with other scripting language
75
-
runtimes. This initial work focused on the amazing work of the
76
-
<ahref="https://micropython.org">MicroPython</a> project (a full
77
-
re-implementation of Python 3 targeting constrained computing
78
-
environments).</p>
79
-
80
-
<p>Here's what
81
-
<ahref="http://dpgeorge.net/">Damien George</a>
82
-
(creator of MicroPython) says about such efforts:</p>
83
-
84
-
<blockquote>
85
-
<p>MicroPython was written from day one to be easy to embed, and tries to support a wide variety of targets. For example, in a minimal configuration, the only connection to the external world that it needs is a place to output characters.</p>
86
-
<p>Although I never had the idea that MicroPython would be embedded in the browser, it actually fits quite naturally because MicroPython is very self contained. MicroPython's small size and efficient use of resources (RAM and CPU) means that it's well suited to being embedded in a webpage, because the download size and start-up time is minimised. It's pretty exciting to think that MicroPython could gain traction as a way to build websites.</p>
87
-
</blockquote>
88
-
89
-
<h3>Why?</h3>
90
-
91
-
<p>Different runtimes exhibit different strengths and weaknesses. As
92
-
always, there are tradeoffs.</p>
93
-
94
-
<p>Whereas Pyodide is a relatively mature version of standard CPython,
95
-
including powerful native modules such as
96
-
<ahref="https://numpy.org/">numpy</a> and
97
-
<ahref="https://scipy.org/">scipy</a>, it's also rather large (circa 11Mb)
98
-
and slow to start up.</p>
99
-
100
-
<p>Alternatively, MicroPython is a highly regarded, mature and
101
-
battle tested reimplementation of Python 3 but with "micro"
102
-
reimplementations of popular libraries. It is small (base 303Kb) and
103
-
startup time is only a few thousandths of a second (from a warm cache),
104
-
even on mobile devices.</p>
105
-
106
-
<p>Given such tradeoffs, we want folks to be able to choose the runtime
107
-
to use with PyScript that best suits their unique requirements.</p>
108
-
109
-
<h3>How?</h3>
110
-
111
-
<p>The code on these pages is experimental.</p>
112
-
113
-
<p>A small, fast and simple implementation of PyScript, created for
114
-
testing purposes, allows us to quickly explore the
115
-
characteristics of different potential runtimes.</p>
116
-
<p>This version of PyScript, simply does four things:</p>
117
-
<ol>
118
-
<li>Read custom configuration (more on this later), otherwise fall back
119
-
to sensible defaults.</li>
120
-
<li>Download and start the language runtime. Currently, this is
121
-
configured to be MicroPython.</li>
122
-
<li>Register and manage plugins that contain the PyScript platform's
123
-
logic. Currently, there are two: one for the
124
-
<code><py-script></code> tag,
125
-
and one for the <code><py-repl></code> tag.</li>
126
-
<li>Load user defined files onto the runtime's virtual file system (data,
127
-
code, modules etc).</li>
128
-
</ol>
129
-
<p>Drop into the browser console to see what PyScript is doing, under the
130
-
hood.</p>
63
+
<p>Why not "view-source" and see for yourself?</p>
64
+
65
+
<h3>What?</h3>
66
+
<p>The initial version of PyScript, demoed
67
+
<ahref="https://www.youtube.com/watch?v=qKfkCY7cmBQ">in a keynote address
68
+
by Peter Wang</a> at PyCon 2022, built on the amazing
69
+
work of the <ahref="https://pyodide.org/en/stable/">Pyodide</a>
70
+
project. But Pyodide isn't the only Python runtime, compiled to WASM, that
71
+
could be used for this purpose.</p>
72
+
73
+
<p>These pages are a technical demonstration, proof of concept and
74
+
playful exploration of how PyScript may work with other scripting language
75
+
runtimes. This initial work focused on the amazing work of the
76
+
<ahref="https://micropython.org">MicroPython</a> project (a full
77
+
re-implementation of Python 3 targeting constrained computing
78
+
environments).</p>
79
+
80
+
<p>Here's what
81
+
<ahref="http://dpgeorge.net/">Damien George</a>
82
+
(creator of MicroPython) says about such efforts:</p>
83
+
84
+
<blockquote>
85
+
<p>MicroPython was written from day one to be easy to embed, and tries to support a wide variety of targets. For example, in a minimal configuration, the only connection to the external world that it needs is a place to output characters.</p>
86
+
<p>Although I never had the idea that MicroPython would be embedded in the browser, it actually fits quite naturally because MicroPython is very self contained. MicroPython's small size and efficient use of resources (RAM and CPU) means that it's well suited to being embedded in a webpage, because the download size and start-up time is minimised. It's pretty exciting to think that MicroPython could gain traction as a way to build websites.</p>
87
+
</blockquote>
88
+
89
+
<h3>Why?</h3>
90
+
91
+
<p>Different runtimes exhibit different strengths and weaknesses. As
92
+
always, there are tradeoffs.</p>
93
+
94
+
<p>Whereas Pyodide is a relatively mature version of standard CPython,
95
+
including powerful native modules such as
96
+
<ahref="https://numpy.org/">numpy</a> and
97
+
<ahref="https://scipy.org/">scipy</a>, it's also rather large (circa 11Mb)
98
+
and slow to start up.</p>
99
+
100
+
<p>Alternatively, MicroPython is a highly regarded, mature and
101
+
battle tested reimplementation of Python 3 but with "micro"
102
+
reimplementations of popular libraries. It is small (base 303Kb) and
103
+
startup time is only a few thousandths of a second (from a warm cache),
104
+
even on mobile devices.</p>
105
+
106
+
<p>Given such tradeoffs, we want folks to be able to choose the runtime
107
+
to use with PyScript that best suits their unique requirements.</p>
108
+
109
+
<h3>How?</h3>
110
+
111
+
<p>The code on these pages is experimental.</p>
112
+
113
+
<p>A small, fast and simple implementation of PyScript, created for
114
+
testing purposes, allows us to quickly explore the
115
+
characteristics of different potential runtimes.</p>
116
+
<p>This version of PyScript, simply does four things:</p>
117
+
<ol>
118
+
<li>Read custom configuration, otherwise fall back
119
+
to sensible defaults.</li>
120
+
<li>Download and start the language runtime. Currently, this is
121
+
configured to be MicroPython.</li>
122
+
<li>Register and manage plugins that contain the PyScript platform's
123
+
logic. Currently, there are two: one for the
124
+
<code><py-script></code> tag,
125
+
and one for the <code><py-repl></code> tag.</li>
126
+
<li>Load user defined files onto the runtime's virtual file system (data,
0 commit comments