back to article You loved running JavaScript in your web browser. Now, get ready for Python scripting

Python, one of the world's most popular programming languages, may soon become even more ubiquitous as it finds a home within web browsers. Ethan Smith, a Berkeley-based software developer, recently revealed a project that allows CPython, the default implementation of the Python programming language, to run within web browsers …

  1. Anonymous Coward
    Anonymous Coward

    The future will be... special

    So we can run python in a web browser. Last week we were told how to install linux into the Windows directory. Is everyone sure this is all a good idea?

    1. Anonymous Coward
      Anonymous Coward

      Re: The future will be... special

      <sarcasm>How naive of you sir! of course its a good idea. </sarcasm>

      Personally I think this is developer masturbation and a way of drawing attention to themselves.

      I don't want Python in my browser it'll be no better than Javascript and will carry all of the library package management nightmares Javascript has.

      1. Korev Silver badge
        Coat

        Re: The future will be... special

        I think Python piped Javascript to the post. with package management hell...

        1. Tom 7 Silver badge

          Re: The future will be... special

          A quick check of my hard drive reveals more VMs than Google or Amazon!

      2. vtcodger Silver badge

        Re: The future will be... special

        I think Python in your browser is probably a bit more likely to work as intended than Javascript which seems often not to do quite what the website author intended. I mean, why would one intentionally put an ad with a non-functioning Close button on top of the order form I am trying to fill out? But I agree that working better not necessarily a good thing.

        1. david 12

          Re: The future will be... special

          Even better would be .. vbscript ..

          That was generally pretty clear and did what was intended.

          1. fajensen Silver badge

            Re: The future will be... special

            ... but, not what we wanted :).

          2. Dan 55 Silver badge
            Alert

            Re: The future will be... special

            Apparently it's still a thing in IE11...

    2. Ross 12

      Re: The future will be... special

      It's the end of days. Nothing matters any more, so why not install Linux on a Windows partition, or run python in a browser, or mount a live github repository as your home directory

      1. Dan 55 Silver badge
    3. fidodogbreath Silver badge

      Re: The future will be... special

      The future will be.... cooling fans screaming at full RPM whenever a browser window is open.

  2. Flocke Kroes Silver badge

    Zombie rising from the ashes

    I thought the idea of running malicious python in a restricted environment had been bombed to extinction with targeted asteroid strikes over a decade ago. This "recent" cobweb for restricted python comes from 2008. Has a large team of dedicated security experts fixed the numerous design issues with cpython that make the very concept of restricted subset of it effectively impossible while I was not looking?

    1. Anonymous Coward
      Anonymous Coward

      Re: Zombie rising from the ashes

      Don't be stupid no one reads history, besides it if was on a website it would have been deleted for SEO reasons.

    2. Charlie Clark Silver badge

      Re: Zombie rising from the ashes

      WASM pretty much takes care of that. But other things like Jupyter notebook have been running client code happily and safely through the browser for years.

  3. Anonymous Coward
    Anonymous Coward

    You're coding it wrong.

    You're supposed to Keep It Simple Stupid, not make the browser so complex it turns into a nightmare of bug riddled kludges trying to be all, do all, and cram in the kitchen sink as well.

    1. spireite Bronze badge
      Trollface

      Re: You're coding it wrong.

      Make a browser with, bug riddled kludges? Are they re-releasing MSIE??

      1. TheMeerkat Bronze badge

        Re: You're coding it wrong.

        It is called Chromium these days.

        Adding more complexity means making entry to the market threshold higher eliminating any potential competition.

    2. vtcodger Silver badge

      Re: You're coding it wrong.

      Don't get me wrong. Python in a browser seems an RBI (Really Bad Idea) from a security viewpoint if nothing else. But also it sounds like the real problem is the WASM capability that enables Python to run.

      Does WASM have anything much to offer users other than a probably small rendering speed improvement and potential bundle of major grief?

  4. dajames Silver badge

    History repeats

    WASM wasn't a good idea when it was called ActiveX, what makes anyone think it will be any better this time around?

    1. Pascal Monett Silver badge

      The Board

    2. fajensen Silver badge
      Black Helicopters

      Re: History repeats

      Bad Ideas are creations of the Old Ones: Like their parents, they can never die, only sleep for a while!

  5. steelpillow Silver badge
    Coat

    Endpoint

    I have a much better idea. Run web apps natively on the OS. You can then write them in any old language by calling up the installed libraries. And, of course, have all those pesky dependencies auto-managed by an AI service - itself managed by an AI firewall. No need for bug-ridden, insecure browsers, no dependency hell, just good, honest hopelessness.

    1. CommonBloke
      Paris Hilton

      Re: Endpoint

      What's this? Actually compiling code for each platform, instead of using a questionable web-backend that's gonna weigh on the end user for no good reason?

      Next you're going to say the whole app could as well be a number of dumb HTML pages with near zero javascript!

  6. Plest Bronze badge
    Facepalm

    Tears before bedtime!

    Javascript was not enough for non-devs to pound the crap out of our browsers now these non-devs needed new weapons, so we've handed them a data miner's scripting language! May God have mercy on our souls!

    All I've seen Python used for is to annoy our DBs! Some muppet in data management trying to flood DB systems with some Python coded nonsense, sure 1 session swas OK so surely 87 sessions must be 87 times better and faster right? FFS!

  7. karlkarl Silver badge

    This is pretty cool and useful to port software with an embedded python interpreter.

    However this does demonstrate one of the best advantages of using C and C++. It is so much more portable.

    For example, Emscripten allowed C, C++ ----> JS, ASM.js, WASM almost a decade before other languages. And before that we had Adobe Alchemy / CrossBridge C, C++ -----> Flash Bytecode.

    Where I used to work, I even had to re-write much of Unity3D (https://github.com/osen/mutiny) to port some of our games over 4 years before Unity Technologies managed to port .NET (or transpile CSharp.NET to C++).

  8. Chubango

    Sure, you can do that....

    ... but does it mean that you should?

  9. Anonymous Coward
    Anonymous Coward

    ...and repeat

    java in browser next?

    python was runnable in older browsers (jython applets)

    Neither help www get to "net zero" (==browser crawls at near zero ops/sec)

  10. Draco
    Windows

    Great! Another way to bloat and slow the browser.

    Don't get me wrong, web browsers are pretty amazing - not to mention, extremely complex. What was once a thin client for remotely viewing and navigating documents has become a rather fat thin-client.

    In fact. each passing iteration seems to be inching the browser closer and closer to being a full OS running as a guest on some target hardware (something Google anticipated back in 2009 with the release of ChromeOS).

  11. Pascal Monett Silver badge
    Thumb Up

    Wonderful news !

    Now I know to be on the lookout for NoPython to install next to NoScript.

    Thanks for the heads-up.

  12. Paper

    Let's wait and see

    Mainly a FE dev myself, but I really respect Python's simple approach and regularity.

    Only downside is that the IDEs aren't quite as advanced as they are with JS and Java. Also the lack of inbuilt typing makes things more confusing (same problem with JS, but at least Typescript exists). I know Python has some optional typing tools, so we'll see.

    Would be awesome to be able to use Java directly in the browser too, static typing FTW.

    1. Ken Hagan Gold badge

      Re: Let's wait and see

      "Would be awesome to be able to use Java directly in the browser too..."

      Wait long enough and some spotty youth will no doubt come up with the idea and tell the old lags how blinkered they are for not thinking of it before.

  13. This is my handle
    Trollface

    Not to sound like a sore loser but ...

    ... now the "we actually *do* care about whitespace" crowd can finally answer seriously the question I've been asking for about a dozen years: What can Python do that Perl can't do better?

    1. W.S.Gosset Silver badge

      Re: Not to sound like a sore loser but ...

      be read/maintained

  14. bussdriver3

    People who don't know Java or ActiveX are doomed to repeat it

    We can't shame and insult these ignorant kids to STFU because they might kill themselves after they ban you and they can't tell fact from opinion if not dismiss all wisdom with "ok boomer."

    Somebody has to stop them from WASM from getting ANY access outside it's jail. Javascript is great duct tape for slapping components together and it should stay that way. WASM is fine for components; could be better for that maybe... I think they should hash and version them with UUIDs (URLs) which would promote caching, filtering/scanning and security. I tried PERL WASM and waiting for MB of perl to download and start before anything could be done was not practical... and PERL is a level beyond python (usability is different topic.)

    1. Anonymous Coward
      Anonymous Coward

      Re: People who don't know Java or ActiveX are doomed to repeat it

      Why? I noticed that I feel a lot better once I stopped giving a shit and began to keep some celebratory single malt in my desk drawer for when Management and the Bright Young Things fall on their faces.

  15. aldolo

    let's upgrade to i9 for the next great web experience

    hope will be enough...

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Biting the hand that feeds IT © 1998–2022