Live data from Hacker News

A Python 3 implementation for client-side web programming

brython.info

111–120 of 120 posts

Re: A Python 3 implementation for client-side web programming

#111
post #83

Earlier quoted context omitted.

The approach and the phrasing seems exactly right to me and not at all off-putting. The goal of Brython is to replace javascript on the web, seems straightforward right? The way they go about it is to implement a compiler in javascript, and use that to bootstrap a python in the browser community. Seems like that is much easier than convincing Chrome/Firefox/IE to include a python compiler in their browser. How would…

Why not provide both options, ala LESS?

Because that takes time and effort and this is relatively new.

Re: A Python 3 implementation for client-side web programming

#112

I love this. I wish someone would do this for Ruby. Not CoffeeScript - I want to be able to write Ruby that manipulates DOM objects.

I dream of a day where I can choose what language to script a page in, using a native implementation, rather than being forced to use javascript. Javascript is great, but I'd rather work in Python and have it be actual Python, not an interpreter written in an interpreted language.

Apologies for going off-topic, but why ISN'T that an option now? Was that not the point of "type" in in the first place? (That's a genuine question; I don't know the history of the tag, or its "type" attribute.

How is V8 wired into Chrome, or Rhino(?) into Firefox, for example? Is there a great technical barrier to making it possible for the user to install an interpreter of their choice? As I understand the course of the browser's history, it already seems to be moving to an OS-style program (or, in Chrome's case, it has BECOME an OS), so it seems like user-loaded language runtimes OUGHT to be on SOMEONE'S mind. And I'd be surprised if it hasn't already occurred to someone before, I just don't know the history.

Has anyone attempted to write a browser that allowed for such a thing? Or has JS just been the accepted scripting language, and no one has yet tried to push past?

Re: A Python 3 implementation for client-side web programming

#113
post #112

Earlier quoted context omitted.

I dream of a day where I can choose what language to script a page in, using a native implementation, rather than being forced to use javascript. Javascript is great, but I'd rather work in Python and have it be actual Python, not an interpreter written in an interpreted language.

Apologies for going off-topic, but why ISN'T that an option now? Was that not the point of "type" in in the first place? (That's a genuine question; I don't know the history of the tag, or its "type" attribute. How is V8 wired into Chrome, or Rhino(?) into Firefox, for example? Is there a great technical barrier to making it possible for the user to install an interpreter of their choice? As I understand the course o…

IIRC, Microsoft tried to get vbscript to catch on, but it didn't. I think it was a case of one language doing the trick adequately, and adding more would just multiply the headaches for development and building cross-browser compatible code. What happens when Firefox supports Python 3, Microsoft supports Python 2 (but not actual python 2, their own proprietary version) and Opera just happens to only ever run javascript?

Re: A Python 3 implementation for client-side web programming

#114
post #30

I can't believe all the negative comments here. Someone has implemented Python in JavaScript. I personally think that is incredible.

I have a better idea for a new language based on python:

    and walked: "through the valley"' he's and feared: not: "evil"!
    # he.and_walked("through the valley").and_feared(not("evil"))!

    drop down:' criminal scum!
    # criminal_scum.drop_down()!

    eat: breakfast' you!
    # you.eat(breakfast)!

    kill: with pistol' maim: blunt object' opponent's check dead:
    # opponent.maim(blunt_object).kill(with_pistol).check_dead()

    print person's name's last
    print person's last' name # ;)
    # print person.name.last

    if my's cookies's jar's empty::
        print "Cookie Monster, why is the Cookie jar empty?"
        why: cookie jar's empty:' cookie monster 

        # why cookie monster, why? :)
        why: cookie jar's empty:' cookie monster's why: "?"

it's called Glas :)

Re: A Python 3 implementation for client-side web programming

#115

Earlier quoted context omitted.

Why not provide both options, ala LESS?

Because that takes time and effort and this is relatively new.

tinco seemed to be arguing that allowing server-side compilation would be harmful to the goals of the project. That's orthogonal to your argument about time and effort.

Re: A Python 3 implementation for client-side web programming

#116
post #43

IMHO, This comment page is an interesting example to how unreasonably emotional programmers can be about their technology. It looks as though, some developers are almost insulted by the idea, that someone tried to replace a language that is so commonly accepted, and that they have worked so hard to master. This also happens in many other fields of science/technology, but I'm always surprised to see it among programme…

> programmers who are considered very practical people.

Ever met an Enterprise Architect?

Re: A Python 3 implementation for client-side web programming

#117

Earlier quoted context omitted.

First of all, he was commenting about this page not displaying ANY content at all. At the very least there should be a noscript tag to tell the user to enable JS. Second, I whitelist sites for javascript. There's nothing absurd about that. Honestly, I can't believe people run any and all JS on every random page they land on.

> First of all, he was commenting about this page not displaying ANY content at all. At the very least there should be a noscript tag to tell the user to enable JS. For most sites that sounds like a good idea, but this is a Javascript project. The number of people interested in a Javscript framework that don't have Javascript enabled and are still befuddled when things don't work correctly must be vanishingly small.

> For most sites that sounds like a good idea, but this is a Javascript project.

Isn't that actually the opposite argument? If you are an expert in that field, you should understand how to degrade gracefully. Besides, you might not know that the project is about javascript until you read the (blank) page.

Re: A Python 3 implementation for client-side web programming

#118

Earlier quoted context omitted.

Noscript allows you to turn the Javascript off. Requiring javascript to see any content at all is a little absurd.

You could also block all images and CSS; that would make for a really terrible web experience though. Why limit yourself intentionally? As a web developer I'm not going to accommodate for users that intentionally turn off features that we've been fighting for years to standardize on.

> You could also block all images and CSS; that would make for a really terrible web experience though

Really? Blocking all images can really improve your web experience in some cases.

Re: A Python 3 implementation for client-side web programming

#119

Earlier quoted context omitted.

Noscript seems like a fetish with some people and almost always it seems they expect the rest of us to accomodate their fetish.

You can safely ignore them. They are less than 2% of Internet traffic and they know how to turn js back on.

> They are less than 2% of Internet traffic

Of course. that's because their computers haven't been exploited and turned into zombies. It's hard to compete with the traffic that botnets create.

Re: A Python 3 implementation for client-side web programming

#120
post #28

Earlier quoted context omitted.

>Javascript is a prerequisite of the modern web. Citation needed.

It is part of the HTML5 spec, which is what modern browsers implement. Not supporting Javascript is not a design goal of the HTML5 project.

> Not supporting Javascript is not a design goal of the HTML5 project.

Which is why the HTML5 spec explicitly mentions disabling scripting?

"6.1.2 Enabling and disabling scripting

Scripting is enabled in a browsing context when all of the following conditions are true:

    The user agent supports scripting.
    The user has not disabled scripting for this browsing context at this time. (User agents may provide users with the option to disable scripting globally, or in a finer-grained manner, e.g. on a per-origin basis.)
    The browsing context's active document's active sandboxing flag set does not have its sandboxed scripts browsing context flag set.
"
Post reply on HN