Re:A Python Interpreter Written in Rust
by bbernard on Saturday February 02, 2019 @02:05PM
(#19064934)
There's already a client-side implementation of Python in JavaScript. See: https://brython.info/
But it might not give you the sort of compatibility between the client and server code that you're looking for.
Re:A Python Interpreter Written in Rust
by tylerl on Saturday February 02, 2019 @12:49PM
(#19064420)
You mean like repl.it or skulpt or ... actually there's a few different option with different features, but doing python in the browser has been a thing for many years.
Re:A Python Interpreter Written in Rust
by half-kh-hacker on Saturday February 02, 2019 @01:29PM
(#19064691)
Running Python, client-side in the browser.
Re:A Python Interpreter Written in Rust
by StavrosK on Saturday February 02, 2019 @02:26PM
(#19065062)
There are already various options, many using Emscripten.
Re:A Python Interpreter Written in Rust
by soperj on Saturday February 02, 2019 @12:46PM
(#19064397)
>There are advantages to running the same language on the server and client
I see this said quite often. What are they?
Re:A Python Interpreter Written in Rust
by mjw1007 on Saturday February 02, 2019 @01:09PM
(#19064554)
If you have a traditional server-rendered web application and you want to add a little bit of scripting on the client side, it can be nice to be able to share pieces of domain-specific code (for example, you might want the client and server to have the same notion of what a well-formed stock code looks like).
In more sophisticated systems, people sometimes like the client to "optimistically" do the same processing as it expects the server to do, so it can update its display more quickly.
Or if you have a mostly client-side application which builds up some fancy widget tree, sometimes people like to have the server do the same rendering as the client would so that it's there on initial page load, or so that search engines can see it.
You often have the same data types on the server and the client for data exchange. When both sides use the same language, you only write these types once and it’s impossible for the client and server implementations to differ.
Re:A Python Interpreter Written in Rust
by Zelmor on Saturday February 02, 2019 @01:07PM
(#19064539)
To make sure the same bootcamp hacks can work on your backend and frontend, neither of which they fully understand.
Re:A Python Interpreter Written in Rust
by nsstring96 on Saturday February 02, 2019 @12:54PM
(#19064457)
Saving in developer salaries is the only tangible one. You could argue there is less context switching for developers between languages, but I’ve never actually heard that from someone who builds the apps.
(There are advantages to running the same language on the server and client, and there's plenty of server-side web application Python code out there.)