Live data from Hacker News

A Python 3 implementation for client-side web programming

brython.info

51–60 of 120 posts

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

#51
post #26

Earlier quoted context omitted.

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

Javascript is a prerequisite of the modern web. Refusing to accept that is absurd.

Couldn't agree more.

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

#52

Most disappointing part of most -> js languages is that they adopt the async nature of JavaScript, thus making them pretty dissimilar from their native environments. Is it that difficult to rewrite a sync workflow to an async one by the interpreter?

That's because an synchronous client-side scripting language would be useless for the web.

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

#54

Most disappointing part of most -> js languages is that they adopt the async nature of JavaScript, thus making them pretty dissimilar from their native environments. Is it that difficult to rewrite a sync workflow to an async one by the interpreter?

You mean async to sync workflow, this is possible with generators https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_... it similar to what is done in gevent. BUT, such sync code for async is just style, the code is still async you just write it like it sync code. In this sens it can be understood as a feature of the language but generators are meant for more than that.

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

#55
post #14

I do like the idea, but it inevitably suffers from the same flaw that afflicts all other compile-to-js libraries: making sense of errors will still require knowledge of how the underlying javascript works. Perhaps a development plugin for Chrome would allow debugging in python?

Every exception in brython has original line source, you don't need source maps. The thing is that you can't type Python in the console, yet.

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

#56

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.

You can do it while following a similar approach to what is done for PythonScript, it's easy. PythonScript is compiled to Javascript, it use the Python abstract syntax tree module to parse python code then generate javascript. The subset of python that is (directly) translated to Javascript is PythonJS. With PythonJS is implemented some runtime stuff and higher level construct of Python. http://apppyjs.appspot.com/ Sorry the editor is broken.

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

#57
post #47

Earlier quoted context omitted.

Why is it absurd?

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.

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

#58
Why the hate on JavaScript? I know it's not the most elegant language in the world, but do we really need this? Instead of a program "x" run in "y", how about we just expand our horizons a bit and learn another language with different paradigms?

Python is great for some stuff, but let JS do what it does.

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

#59
post #39

Earlier quoted context omitted.

That's a silly complaint. Doesn't every language designer feel that their product is better than the thing it desires to replace?

A better question: Is python really any better than JavaScript? Sure, it has advantages here and there. But there are things I like about JavaScript that are better than python. For example, having anonymous functions that are more than a single expression inside a lambda. Yes, I know you can declare a function inside another and you get a closure. But, JavaScript's syntax is just nicer.

Obligatory https://www.destroyallsoftware.com/talks/wat

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

#60

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.

Here's eight options for you. Enjoy: https://github.com/jashkenas/coffee-script/wiki/List-of-lang...
Post reply on HN