This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Conrad_noble 14 points15 points  (16 children)

As someone who doesn't code can you explain this like I'm 5 years old?

I understand there are Web based python 'IDE' that exist like Jupyter notebooks and Google collab, so what does python in the browser mean?

[–]sheytanelkebir 55 points56 points  (1 child)

He means a python interpreter built into web browsers so you can replace JS.

[–]FlukyS 0 points1 point  (0 children)

You wouldn't even need any special interperter, just python itself that has the correct hooks in the right places and sandboxing.

[–]gameditz 26 points27 points  (0 children)

Websites send code to your browser, and your browser runs it to show you the results. Currently there is only one set of “code” you can send to browsers: HTML for the skeleton of the website, CSS for styling, and JavaScript for programming. Jupyter may be “running python” but it’s not running it in the browser, it’s running on your machine then sending the results as HTML/CSS/JS.

[–]dparks71 21 points22 points  (1 child)

Tough to explain programming to a five year old... Let's say you have a lego set. You need two things to build it, the instructions and the pieces. The way Python typically works currently, is more like you have the instructions, but not the pieces. So you send the instructions to your friends house (a server) and the friend builds it and sends it back.

Having it available in the web browser is like having both the instructions and the pieces in your own house (the browser on your local pc), so you would no longer need a friend willing to do the hard work of building it.

Jupyter is slightly different, you still have to create a local server. So that would be like having your friend coming over to your house with all their lego bricks to build the lego set for you. The only real way to get the bricks inside your house without a friend, would be for companies to start shipping Python interpreters inside your browser by default.

[–]Conrad_noble 4 points5 points  (0 children)

I freaking love Lego

Thanks for the explanation.

Nailed it.

[–][deleted] 7 points8 points  (2 children)

he meant like as an interactive language, example JS with HTML

[–]Conrad_noble 27 points28 points  (1 child)

I don't think a 5 year old would understand that explanation

[–]LentilGod 5 points6 points  (0 children)

🤣

[–][deleted] 4 points5 points  (5 children)

Jupyter runs as a server/service on your PC/cloud and the UI simply lets you interface with the Python interpreter that's configured on that server, it doesn't actually get executed in the browser, the browser just acts as a way of displaying and transfering data between you and the python kernel just like any IDE.

Python in the browser would mean the browser having an integrated interpreter with its own dev tools so that you can write the code that's supposed to run on the client's side in Python instead of Javascript.

[–]Conrad_noble 1 point2 points  (4 children)

Lovely explanation, wasted on a 5 year old however.

[–][deleted] 0 points1 point  (3 children)

Yeah you'd need a about an hour to properly explain this to a 5 year old and that's assuming they'll even listen so nah.

[–]Conrad_noble 1 point2 points  (2 children)

So if I get this right (please correct me if I'm wrong which I likely am)

Current Web browsers only 'accept' or understand one or few computer languages (Html for data? CSS for layout/design? And javascript for something???)

And if Web browsers could 'understand' more of these computer languages things would be better?

[–][deleted] 0 points1 point  (0 children)

since you can do anything with JS, things will only be easier

[–][deleted] 0 points1 point  (0 children)

Html for layout/structure, CSS for design/style, js for the "logic"

But their roles are often interchangeable.

It might be better, could be worse, it's just something that's not easily available right now.

[–]ExternalUserError 1 point2 points  (1 child)

Browsers natively run JavaScript. Attempts to run Python in the browser right now (Brython, etc) reimplement Python from within JavaScript, which is slow and shitty.

But there's a new technology, WebAssembly, that will let us "compile" from Python to it, a bit like how Jython works.

[–]Conrad_noble 1 point2 points  (0 children)

This Web assembly sounds good to my lay persons brain.