Live data from Hacker News

A Python 3 implementation for client-side web programming

brython.info

31–40 of 120 posts

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

#32
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?

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

#33
I don't get the point why should I use Python to run Javascript.

JS has been in use around the web for a long time now and I don't see the need why should I go about using Python for the very same? Doesn't one language has a purpose of it's own?

If it wasn't the case, then people would have worked on creating a unified language for all our needs.

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

#34
post #30

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

I think it's the hubris that's putting people off:

> Brython is designed to replace Javascript as the scripting language for the Web

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

#35
post #34
post #30

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

I think it's the hubris that's putting people off: > Brython is designed to replace Javascript as the scripting language for the Web

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

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

#36
post #20
post #13

Earlier quoted context omitted.

Python 'compiles' to .pyc files, but I'm not show how much that compresses them, or if it's possible to reconstruct the source from it.

.pyc files are very reversible. there are open source projects that decompile them to runnable code, the original symbol names are even intact - this means you don't lose the original naming of variables, functions, arguments, etc.

Doesn't stop you from obfuscating Python separately just like any other language, though.

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

#37
post #8

Earlier quoted context omitted.

The ctx global and 'from html import *' are just part of the demo code. Look at line 289 of the HTML file where ctx is initialized. It's not some magic thing baked into Brython, it's just sample code. Of course you could write either of these in any way you prefer.

A demo of a new way to use a programming language shouldn't be full of these "Oh, that crap is just for the demo, it would look better in practice." It's a programming language demo, show us something that makes us want to use it.

I agree completely: sample/demo code should be the best you can make it. And I'm sure the Brython authors would welcome a pull request that improves their demo code.

But the comment I replied to was a bit misleading (no doubt unintentionally): it made two quite valid complaints about coding practices, without mentioning that these are only in the demo code.

When I read that comment I thought, "WTF? Brython injects a magic 'ctx' global into your Python code?" It doesn't, so I thought it was worth pointing out that these are just sample code issues that wouldn't affect any code you write in Brython.

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

#38
post #34
post #30

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

I think it's the hubris that's putting people off: > Brython is designed to replace Javascript as the scripting language for the Web

If I wrote a Python implementation in JavaScript, I'd probably have some hubris about it as well.

I'm not sure if the developer is one person or if they wrote the landing page as well, but let's assume it is that same person.

If someone has focused enough energy to implement a language in JavaScript, it is probably fair say that marketing isn't his or her primary skill.

At the same time, reading over the text again, people have said crazier things and done much less. If the developer's goal is to replace JavaScript with Python and his or her first attempt is to implement Python in JavaScript, I, for one, applaud their effort.

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

#39
post #34

Earlier quoted context omitted.

I think it's the hubris that's putting people off: > Brython is designed to replace Javascript as the scripting language for the Web

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.

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

#40
post #28
post #26

Earlier quoted context omitted.

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

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

JavaScript is like the electricity of the web. If you disable it, it's like walking around the real world with an "emp field", sure some things will still work, but it's kind of dumb to expect the modern technologies to work without their main food source.

The technologies have evolved... Why are you trying to keep us in the stone age? Or why do you expect backwards compatibility?

Post reply on HN